[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Filter not working (org 8.0.3)
From: |
Nicolas Goaziou |
Subject: |
Re: [O] Filter not working (org 8.0.3) |
Date: |
Thu, 05 Sep 2013 21:09:28 +0200 |
Roger Mason <address@hidden> 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