From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lawrence Mitchell Subject: [PATCH] org-latex: Don't append newline to end of footnote Date: Tue, 29 Mar 2011 15:20:54 +0100 Message-ID: References: <4D91DA12.1070707@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=58773 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q4Ztq-0003hu-BM for emacs-orgmode@gnu.org; Tue, 29 Mar 2011 10:28:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q4Zto-0000E6-Kn for emacs-orgmode@gnu.org; Tue, 29 Mar 2011 10:28:01 -0400 Received: from lo.gmane.org ([80.91.229.12]:41711) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q4Zto-0000Dm-78 for emacs-orgmode@gnu.org; Tue, 29 Mar 2011 10:28:00 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Q4Ztm-0001ms-JN for emacs-orgmode@gnu.org; Tue, 29 Mar 2011 16:27:58 +0200 Received: from e4300lm.epcc.ed.ac.uk ([129.215.63.156]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 29 Mar 2011 16:27:58 +0200 Received: from wence by e4300lm.epcc.ed.ac.uk with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 29 Mar 2011 16:27:58 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org * lisp/org-latex.el (org-export-latex-preprocess): Don't add a newline character to a processed footnote. The extra newline before the closing } character in a footnote confuses the list parsing code. The } appears at the beginning of a line, so it looks like the end of the list. LaTeX gobbles the space anyway, so don't add it. --- > Hi > if I export the fiollowing snippet > * Project Participants > - Rainer M Krug :: [fn::My email] > My address The list is closed incorrectly. This appears to be a problem in the interaction between the list parsing and footnote processing code. When exporting footnotes, we add a newline at the end, so in the above example the intermediate file seen by the list processing code is: | * Project Participants | - Rainer M Krug :: \footnote{My email | } | ORG-LIST-END-MARKER | My address The } at the beginning of the line below the list entry is considered to end the list, so we get: | * Project Participants | \begin{description} | \item[Rainer M Krug] \footnote{My email | \end{description} | } | ORG-LIST-END-MARKER | My address Note how the description list is ended /inside/ the footnote command. Since LaTeX gobbles the trailing space in the footnote anyway, it makes sense not to insert it in the first place, which this patch does. Your test case now exports correctly. Cheers, Lawrence lisp/org-latex.el | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/lisp/org-latex.el b/lisp/org-latex.el index 0460a84..3eb54b2 100644 --- a/lisp/org-latex.el +++ b/lisp/org-latex.el @@ -2432,9 +2432,7 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER." (let ((end (save-excursion (if (re-search-forward "^$\\|^#.*$\\|\\[[0-9]+\\]" nil t) (match-beginning 0) (point-max))))) - (setq footnote (concat (org-trim (buffer-substring (point) end)) - ; last } won't be part of a link or list. - "\n")) + (setq footnote (org-trim (buffer-substring (point) end))) (delete-region (point) end)) (goto-char foot-beg) (delete-region foot-beg foot-end) -- 1.7.4.rc2.18.gb20e9