From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Subject: Re: [PATCH] org-latex: Don't append newline to end of footnote Date: Tue, 29 Mar 2011 19:38:43 +0200 Message-ID: <87d3l9kesc.fsf@gmail.com> References: <4D91DA12.1070707@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=45530 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q4cse-00045G-U7 for emacs-orgmode@gnu.org; Tue, 29 Mar 2011 13:39:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q4csS-0002no-Qe for emacs-orgmode@gnu.org; Tue, 29 Mar 2011 13:38:50 -0400 Received: from mail-wy0-f169.google.com ([74.125.82.169]:60174) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q4csS-0002nb-MQ for emacs-orgmode@gnu.org; Tue, 29 Mar 2011 13:38:48 -0400 Received: by wyf19 with SMTP id 19so437428wyf.0 for ; Tue, 29 Mar 2011 10:38:47 -0700 (PDT) In-Reply-To: (Lawrence Mitchell's message of "Tue, 29 Mar 2011 15:20:54 +0100") 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: Lawrence Mitchell Cc: emacs-orgmode@gnu.org Hello, Lawrence Mitchell writes: > * 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. The analysis is good, but unfortunately the patch has a flaw. In fact, your patch work in that particular situation, but not if a footnote definition ends with a list, nor if it ends with a link. To solve the latter, you need to insert a white-space before the closing bracket. To solve the former, I thought adding a newline instead of the white-space was enough, but it now appears it was a bad idea. Thus, the solution lies elsewhere. Regards, -- Nicolas