From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Filter not working (org 8.0.3) Date: Thu, 05 Sep 2013 18:18:56 +0200 Message-ID: <87y57bp7gv.fsf@gmail.com> References: <5228A8DF.5010704@mun.ca> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37694) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VHcGf-0000dt-Tn for emacs-orgmode@gnu.org; Thu, 05 Sep 2013 12:18:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VHcGa-0007ZX-1b for emacs-orgmode@gnu.org; Thu, 05 Sep 2013 12:18:49 -0400 Received: from mail-we0-x235.google.com ([2a00:1450:400c:c03::235]:52055) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VHcGZ-0007ZR-QH for emacs-orgmode@gnu.org; Thu, 05 Sep 2013 12:18:43 -0400 Received: by mail-we0-f181.google.com with SMTP id p61so855088wes.26 for ; Thu, 05 Sep 2013 09:18:43 -0700 (PDT) In-Reply-To: <5228A8DF.5010704@mun.ca> (Roger Mason's message of "Thu, 05 Sep 2013 13:23:03 -0230") 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: Roger Mason Cc: org-mode 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, -- Nicolas Goaziou