emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Matt Lundin <mdl@imapmail.org>
To: Org Mode List <emacs-orgmode@gnu.org>
Subject: Re: [dev] footnotes improvements
Date: Sat, 14 May 2011 09:42:41 -0400	[thread overview]
Message-ID: <87sjshjt4e.fsf@fastmail.fm> (raw)
In-Reply-To: <871v05f4ca.fsf@gmail.com> (Nicolas Goaziou's message of "Wed, 11 May 2011 21:02:29 +0200")

Hi Nicolas,

Nicolas Goaziou <n.goaziou@gmail.com> 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---
<p class="footnote"><sup><a class="footnum" name="fn.2" href="#fnr.2">2</a></sup> A
footnote with a LaTeX citation.\cite<sup><a class="footref" name="fnr.25" href="#fn.25">25</a></sup>{bookid}
</p>
--8<---------------cut here---------------end--------------->8---

Thanks for considering these issues.

Best,
Matt

  parent reply	other threads:[~2011-05-14 13:42 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-11 19:02 Nicolas Goaziou
2011-05-12  7:19 ` Christian Moe
2011-05-12  8:10   ` Aankhen
2011-05-12 10:04   ` Nicolas Goaziou
2011-05-12 10:48     ` Christian Moe
2011-05-14  8:44       ` Nicolas Goaziou
2011-05-14 18:22         ` Christian Moe
2011-05-14 13:42 ` Matt Lundin [this message]
2011-05-15 14:59   ` Nicolas Goaziou
2011-05-15 15:47     ` Matt Lundin
2011-05-26 19:49       ` Nicolas Goaziou
2011-05-26 20:56         ` Samuel Wales
2011-05-26 23:41           ` suvayu ali
2011-05-15 15:52     ` Samuel Wales
2011-06-27 18:29       ` Nicolas Goaziou
2011-06-27 20:07         ` Christian Moe
2011-06-27 20:24           ` Nicolas Goaziou
2011-06-27 22:45         ` Christian Moe
2011-06-28  9:59         ` Bastien
2011-06-30  6:14           ` Samuel Wales
2011-06-30  9:15             ` Bastien
2011-06-30 17:36             ` Nicolas Goaziou
2011-07-04 23:26               ` Samuel Wales

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sjshjt4e.fsf@fastmail.fm \
    --to=mdl@imapmail.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).