Hello again,
On 09/05/2013 01:48 PM, Nicolas Goaziou wrote:
Hello,
Roger Mason <rma...@mun.ca> 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