From mboxrd@z Thu Jan 1 00:00:00 1970 From: Roger Mason Subject: Re: Filter not working (org 8.0.3) Date: Thu, 05 Sep 2013 14:35:47 -0230 Message-ID: <5228B9EB.10909@mun.ca> References: <5228A8DF.5010704@mun.ca> <87y57bp7gv.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49023) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VHd0H-0007DC-5x for emacs-orgmode@gnu.org; Thu, 05 Sep 2013 13:06:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VHd0A-0005nJ-C2 for emacs-orgmode@gnu.org; Thu, 05 Sep 2013 13:05:57 -0400 Received: from nina.ucs.mun.ca ([134.153.232.76]:33481) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VHd0A-0005n6-5n for emacs-orgmode@gnu.org; Thu, 05 Sep 2013 13:05:50 -0400 In-Reply-To: <87y57bp7gv.fsf@gmail.com> 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: Nicolas Goaziou Cc: org-mode Hello again, On 09/05/2013 01:48 PM, Nicolas Goaziou wrote: > Hello, > > Roger Mason writes: > >> I have this at the top of an org file in order to put graphics in the >> margin: >> >> #+LATEX_HEADER: \usepackage[right=2in,left=0.5in]{geometry} >> \usepackage{parskip} >> >> #+BEGIN_SRC emacs-lisp >> (defun margin-graphics (contents backend info) >> (when (eq backend 'latex) >> (replace-regexp-in-string "\\`\\\\includegraphics.+\\({.+}\\)" >> "\\\\marginpar{\\\\includegraphics[width=0.9\\\\marginparwidth]\\1} " >> contents))) >> >> (add-to-list 'org-export-filter-link-functions 'margin-graphics) >> #+END_SRC >> >> C-e lp produces a pdf document, but the filter is not applied (org 8.0.3). >> >> Can someone show me what I'm doing wrong? > I think you need to tell Babel to actually execute the code (e.g. > with :exports both). You may also want to make > `org-export-filter-link-functions' local to the buffer, too. > > > Regards, > Thanks for the reply. Unfortunately, :exports both does not make any difference. Looking at the generated LaTeX file I see that it contains: \begin{verbatim} (defun margin-graphics (contents backend info) (when (eq backend 'latex) (replace-regexp-in-string "\\`\\\\includegraphics.+\\({.+}\\)" "\\\\marginpar{\\\\includegraphics[width=0.9\\\\marginparwidth]\\1} " contents))) (add-to-list 'org-export-filter-link-functions 'margin-graphics) \end{verbatim} which seems odd. Thanks for the help. Roger This electronic communication is governed by the terms and conditions at http://www.mun.ca/cc/policies/electronic_communications_disclaimer_2012.php