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 21:09:28 +0200 Message-ID: <871u5313x3.fsf@gmail.com> References: <5228A8DF.5010704@mun.ca> <87y57bp7gv.fsf@gmail.com> <5228B9EB.10909@mun.ca> <8761uf150h.fsf@gmail.com> <5228D5D7.60503@mun.ca> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44605) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VHevh-00060i-BN for emacs-orgmode@gnu.org; Thu, 05 Sep 2013 15:09:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VHevb-0007ba-Gr for emacs-orgmode@gnu.org; Thu, 05 Sep 2013 15:09:21 -0400 Received: from mail-wi0-x229.google.com ([2a00:1450:400c:c05::229]:35128) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VHevb-0007bW-9u for emacs-orgmode@gnu.org; Thu, 05 Sep 2013 15:09:15 -0400 Received: by mail-wi0-f169.google.com with SMTP id hj3so46624wib.0 for ; Thu, 05 Sep 2013 12:09:14 -0700 (PDT) In-Reply-To: <5228D5D7.60503@mun.ca> (Roger Mason's message of "Thu, 05 Sep 2013 16:34:55 -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 Roger Mason writes: > On 09/05/2013 04:15 PM, Nicolas Goaziou wrote: >> #+LATEX_HEADER: \usepackage[right=2in,left=0.5in]{geometry} >> #+LATEX_HEADER: \usepackage{parskip} >> >> * Setup :noexport: >> #+BEGIN_SRC emacs-lisp :exports both >> (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 (make-local-variable 'org-export-filter-link-functions) 'margin-graphics) >> #+END_SRC > That got rid of the verbatim output. Thanks. > > Unfortunately the replacement of \includegraphics... by \marginpar... > still does not work: > > #+CAPTION: Acicular > [[../images/acicular.eps]] > > produces > > \begin{figure}[htb] > \centering > \includegraphics[width=.9\linewidth]{../images/acicular.eps} > \caption{Acicular} > \end{figure} In this case, you need to remove "\\`" from your regexp. Regards, -- Nicolas Goaziou