From mboxrd@z Thu Jan 1 00:00:00 1970 From: Roger Mason Subject: Re: LaTeX export: images in margin Date: Fri, 16 Aug 2013 12:02:46 -0230 Message-ID: <520E380E.8020601@mun.ca> References: <520E143E.3090007@mun.ca> <20130816124707.GC10615@kuru.dyndns-at-home.com> <20130816131559.GD10615@kuru.dyndns-at-home.com> <520E3159.1050300@mun.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48784) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VAL5C-0003T9-2n for emacs-orgmode@gnu.org; Fri, 16 Aug 2013 10:33:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VAL55-00054c-Ql for emacs-orgmode@gnu.org; Fri, 16 Aug 2013 10:32:54 -0400 Received: from nina.ucs.mun.ca ([134.153.232.76]:42802) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VAL55-00054W-Je for emacs-orgmode@gnu.org; Fri, 16 Aug 2013 10:32:47 -0400 Received: from [134.153.37.33] (cryptoperthite.esd.mun.ca [134.153.37.33]) (authenticated bits=0) by nina.ucs.mun.ca (8.13.1/8.13.1) with ESMTP id r7GEWkHZ001724 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 16 Aug 2013 12:02:47 -0230 In-Reply-To: <520E3159.1050300@mun.ca> 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: emacs-orgmode@gnu.org 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