From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Lundin Subject: Re: [dev] footnotes improvements Date: Sat, 14 May 2011 09:42:41 -0400 Message-ID: <87sjshjt4e.fsf@fastmail.fm> References: <871v05f4ca.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:57915) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QLF7G-0001He-Cy for emacs-orgmode@gnu.org; Sat, 14 May 2011 09:42:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QLF7E-00074v-Vt for emacs-orgmode@gnu.org; Sat, 14 May 2011 09:42:46 -0400 Received: from out2.smtp.messagingengine.com ([66.111.4.26]:43378) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QLF7E-00074g-TL for emacs-orgmode@gnu.org; Sat, 14 May 2011 09:42:44 -0400 Received: from compute6.internal (compute6.nyi.mail.srv.osa [10.202.2.46]) by gateway1.messagingengine.com (Postfix) with ESMTP id 29BD021332 for ; Sat, 14 May 2011 09:42:43 -0400 (EDT) Received: from archeee (67-197-62-83.rh2.dyn.cm.comporium.net [67.197.62.83]) by mail.messagingengine.com (Postfix) with ESMTPSA id D6BAE408005 for ; Sat, 14 May 2011 09:42:42 -0400 (EDT) In-Reply-To: <871v05f4ca.fsf@gmail.com> (Nicolas Goaziou's message of "Wed, 11 May 2011 21:02:29 +0200") 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: Org Mode List Hi Nicolas, Nicolas Goaziou writes: > I'd like to submit a branch for testing: > > git://github.com/ngz/org-mode-lists.git footnote-fix > > Here are the changes so far: > > - recognize and export inlined footnotes holding links in their definition, > - recognize and export two or more footnotes in a row, > - don't chock at footnotes or partial footnotes inside comments in Org buffer, > - export calls to already defined footnotes in LaTeX, > - export footnotes before first heading (LaTeX), > - export footnotes when selecting a subtree not holding their > definition (LaTeX), > - fontify more consistently footnotes in the org buffer (only labels > are "fontified" or fn in the case of an anonymous footnote). > Thanks for these changes! They are great. First, a general consideration: my vote would be for highlighting the entire footnote label, including the brackets. IMO, leaving the brackets in the default face makes it more difficult to scan the buffer. (Similarly, I think it might be nice to fontify the entire contents of inline footnotes.) Secondly, although the following issue is not explicitly addressed by your patch, I thought I'd bring it up now, as the footnotes export mechanism is fresh in your mind. Square brackets containing digits inside of footnotes cause some issues. The primary use for such brackets would be to include LaTeX cite macros inside of footnotes. I imagine this might be tricky to fix, as [25] looks exactly like a footnote label. Here is a test case: --8<---------------cut here---------------start------------->8--- * Headline This is the first footnote.[fn:5896a172] Another footnote.[fn::A footnote with a LaTeX citation.\cite[25]{bookid}] Another footnote.[fn:1e633fdb] Inline footnote with a link.[fn::[[http://www.orgmode.org][Org-mode]]] An inline footnote with square brackets [fn:: [John] Smith] [fn:5896a172] Here is my footnote. [fn:1e633fdb] Footnote with a link. [[http://www.orgmode.org][Org-mode]] --8<---------------cut here---------------end--------------->8--- v 1. The cite macro inside the inline footnote interferes with the fontification of the buffer. Only the first two footnote labels are highlighted. Everything else, including the footnote references, are not fontified. I know that your changes did not explicitly address cite macros inside a footnote, but any square brackets inside a footnote will cause fontification to fail. Are these explicitly prohibited in inline footnotes? Is there an escape character. 2. During export to LaTeX, the curly brackets are escaped within the footnote: --8<---------------cut here---------------start------------->8--- This is the first footnote.\footnote{Here is my footnote. } Another footnote.\footnote{A footnote with a LaTeX citation.\cite[25]\{bookid\} } Another footnote.\footnote{Footnote with a link. \href{http://www.orgmode.org}{Org-mode} } Inline footnote with a link.\footnote{\href{http://www.orgmode.org}{Org-mode} } An inline footnote with square brackets \footnote{[John] Smith } --8<---------------cut here---------------end--------------->8--- 3. Html export adds a superscript to the brackets containing digits (i.e., it treats them as a footnote within a footnote) --8<---------------cut here---------------start------------->8---

2 A footnote with a LaTeX citation.\cite25{bookid}

--8<---------------cut here---------------end--------------->8--- Thanks for considering these issues. Best, Matt