Hello once more,

On 08/16/2013 11:34 AM, Roger Mason wrote:

(defun margin-graphics (contents backend info)
  (when (eq backend 'latex)
    (replace-regexp-in-string "\\`\\\\includegraphics.+\\({.+}\\)"
       "\\\\marginpar{\\\\includegraphics\1} " contents)))

(add-to-list 'org-export-filter-link-functions 'margin-graphics)

However, the LaTeX file contains this:

\marginpar{\includegraphics^A}

rather than the expected

\marginpar{\includegraphics[]{filename}}
This line:

(replace-regexp-in-string "\\`\\\\includegraphics.+\\({.+}\\)"
       "\\\\marginpar{\\\\includegraphics\1} " contents)))

should be:

(replace-regexp-in-string "\\`\\\\includegraphics.+\\({.+}\\)"
       "\\\\marginpar{\\\\includegraphics\\1} " contents)))

Note the double backslash before the '1' in the replacement text.

Cheers,
Roger

This electronic communication is governed by the terms and conditions at
http://www.mun.ca/cc/policies/electronic_communications_disclaimer_2012.php

Reply via email to