From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos 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 13:06:31 -0400 Message-ID: <87y4ytwd7s.fsf@alphaville.bos.redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39343) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WdjaT-0003Y8-UZ for emacs-orgmode@gnu.org; Fri, 25 Apr 2014 13:07:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WdjaK-0006fg-6J for emacs-orgmode@gnu.org; Fri, 25 Apr 2014 13:06:57 -0400 Received: from plane.gmane.org ([80.91.229.3]:48896) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WdjaJ-0006fc-Uj for emacs-orgmode@gnu.org; Fri, 25 Apr 2014 13:06:48 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WdjaI-0006L8-9n for emacs-orgmode@gnu.org; Fri, 25 Apr 2014 19:06:46 +0200 Received: from nat-pool-bos-t.redhat.com ([66.187.233.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 25 Apr 2014 19:06:46 +0200 Received: from ndokos by nat-pool-bos-t.redhat.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 25 Apr 2014 19:06:46 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Leu Zhe 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