On Fri, Aug 16, 2013 at 12:02:46PM -0230, Roger Mason wrote:
>
> (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.
That is a lisp gotcha, :-p. The regexp needs a backslash, however since
it is the escape character in lisp strings, it needs to be escaped
itself.
Glad things worked out for you.
Cheers,
--
Suvayu
Open source is the future. It sets us free.