emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: John Kitchin <jkitchin@andrew.cmu.edu>
To: Nick Dokos <ndokos@gmail.com>
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: To interrupt org-latex-pdf-process to regexp-replace some string of the .tex intermediate file and continue to export
Date: Fri, 25 Apr 2014 19:17:01 -0400	[thread overview]
Message-ID: <CAJ51EToZT2uQCWa-J6RU-VgV+ZXgvwe+cDKE3LcLyb95tGtHcw@mail.gmail.com> (raw)
In-Reply-To: <87y4ytwd7s.fsf@alphaville.bos.redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2497 bytes --]

Thanks Nick, for the more helpful explanation than mine ;)

The function I provided is part of this file:

which I have been working on for publishing scientific manuscripts. This
file provides a new export menu option that not only removes the extensions
in the latex file, but also replaces the \bibliography{} line with the
contents of the .bbl file so that you have a single, standalone tex file
for submission. There is even an export and mail option for a pdf ;)

With this library installed, you can just type: C-c C-e j m
to build your latex file with extensions removed, bibliography replaced,
and open the pdf through the regular org-mode export menu. This may be more
helpful than trying to do the steps manually as I described.


John Kitchin
Associate Professor
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213

On Fri, Apr 25, 2014 at 1:06 PM, Nick Dokos <ndokos@gmail.com> wrote:

> Leu Zhe <lzhes43@gmail.com> writes:
> > Dear John,
> >
> > Thanks very much for your help.
> >
> > I have tried your code but nothing happened. However, I think it is
> close to my remand.
> >
> > I have some questions about your code:
> >
> > 1. When should this command be called?  Don't I need to call it before
> the org-latex-pdf-process?
> >
> As it says in the comment:
> "Run this from an org-buffer after you have exported it to a LaTeX file"
> The function assumes that you have already produced a .tex file from
> your .org file (e.g. with C-c C-e l l). Then, in your org file buffer
> you call it:
>     M-x ox-manuscript-remove-image-extensions RET
> > I am studying elisp now, but your code is really difficult for me, so
> can you help me dig in?
> What the function does is get the filename for the current buffer
> (i.e. the name of your org file), derive the name of the produced
> tex file, get the contents of the tex file assigned (as a string)
> to tex-contents, do a search-and-replace operation on tex-contents
> and write the result back into the tex file. The search-and-replace
> operation searches for strings that look like this:
>           \includegraphics[...]{foo.png}
> and replaces each occurrence with
>           \includegraphics[...]{foo}
> Nick

[-- Attachment #2: Type: text/html, Size: 3344 bytes --]

  reply	other threads:[~2014-04-25 23:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-24 12:46 To interrupt org-latex-pdf-process to regexp-replace some string of the .tex intermediate file and continue to export Leu Zhe
2014-04-25 12:29 ` Feng Shu
2014-04-25 13:54 ` John Kitchin
2014-04-25 15:23   ` Leu Zhe
2014-04-25 16:56     ` John Kitchin
2014-04-26  6:06       ` Kyutech
2014-04-25 17:06     ` Nick Dokos
2014-04-25 23:17       ` John Kitchin [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-04-25 15:28 Leu Zhe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJ51EToZT2uQCWa-J6RU-VgV+ZXgvwe+cDKE3LcLyb95tGtHcw@mail.gmail.com \
    --to=jkitchin@andrew.cmu.edu \
    --cc=emacs-orgmode@gnu.org \
    --cc=ndokos@gmail.com \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).