emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Footnotes and org-export, revisited
@ 2008-12-17 12:52 Scot Becker
  2008-12-17 13:28 ` Paul R
                   ` (3 more replies)
  0 siblings, 4 replies; 26+ messages in thread
From: Scot Becker @ 2008-12-17 12:52 UTC (permalink / raw)
  To: emacs-orgmode

Dear all,

I'm a new org user who recently ran across the video of Carsten's
Google talk. I have been looking for something like org for years, but
learning Emacs had always seemed too high a price, so I never really
considered Emacs-based options.  However time is a teacher, and I see
now that there are plenty of other higher prices than learning Emacs,
which has anyway proved easier than I thought.  Org-mode is really an
amazing piece of work, a highly original piece of software, and
possibly just what this vim user needs. When I think how much time I
spent other solutions, including vim's two (basically unmaintained and
functionally feeble) outline modes, I can only resign myself to the
mild shame.

The following is in response to a brief thread posted to this list in
October by Matthew Lundin.  He described the limitations of
footnotes.el, and suggested two possibilities for extending footnotes
support in org-mode. [1].

The problem with Steve L. Baur's (otherwise useful) footnotes mode is
that it cannot 'read' the contents of a loaded buffer.  So in any
given editing session, footnote numbering always starts with 1, even
if you already had 1...10 in your file from a previous editing
session.  This is simply a limitation of the mode in its current
state.  I expect the package's scope was originally confined to using
footnotes in plain text emails, which are generally finished in one
shot.

There have been some efforts to overcome this limitation by means of a
patch to  footnote.el [2] and a new function, footnote-init.el [3]
which reads the contents of a newly loaded  buffer so that the patched
footnote.el 'knows' about previously placed footnotes.  These
particular patches may not have all the kinks worked out, however,[4]
and are not part of the current CVS of Emacs 23.

But someone working in Muse did write an interesting extension to
Muse's footnote support. (The extension is explained here [5], and the
revised version of the code is here [6]). It is basically a hook
function which converts footnotes with reference names[fn:named_note]
to plain, numbered footnotes, like Muse and org-mode support. It
operates on a temporary buffer  just before export to LaTeX or HTML,
so is transparent to the user.

 I too would like to make use of org-mode to do more extensive
footnoting than the current footnote.el easily allows.  I'm not sure
of the best solution.  Here are the alternatives I can think of:

1.  Help Baur's footnotes.el get to the point where it has no trouble
with multiple editing sessions and managing the numbering of any
arbitrary quantity of footnotes.  This is possible in theory.  But I
suspect that footnotes associated with body text by simple Arabic
numerals are pretty easy to mangle in a simple text system that lets
you do arbitrary things with the text. Comments?

2.  Adapt the Muse code mentioned above for use with org-mode.  This
would keep org-mode's current footnote support unchanged, but allow
named footnotes while writing. Carsten suggested something like this
in his response to Matthew.

3.  Add named footnote support to org-mode according to Matthew's
second suggestion (similar to footnote functionality in Pandoc,
Multi-Markdown or ReST). This could optionally include a function for
the auto-generation of short (?) unique-ish IDs  to use instead of
names (in a long document, giving named references to dozens of
similar footnotes could itself be a source of confusion).

4.  Forget org-mode for anything with any quantity of footnotes.  This
is Carsten's other suggestion in response to Matthew.  It's possible
that the practicalities of footnote handling would prove too costly to
get right.  He knows this much better than I.  (though I'm not sure
that they impair org's plan-text readability as Carsten suggests.

5.  A final solution (which might also gain other advantages) could be
to begin to facilitate an org-export mode to Pandoc's native
plain-text syntax (an extension of Markdown).[7] Pandoc is a robust
Haskell engine to convert between plain text formats.  This would add
a step to org-mode export, but that one step could potentially allow
conversion into the wide range of formats that Pandoc supports
(markdown, reStructuredText, HTML, LaTeX, ConTeXt, RTF, DocBook XML,
OpenDocument XML, ODT, GNU Texinfo, MediaWiki markup, groff man pages,
and S5 HTML slide shows). Pandoc's syntax model already has a lot in
common with org's.  (Both allow LaTeX pass-through, for example).  I
don't know if such an export would meet the effort vs. value trade
off, but I suggest it might.

Comments? (by anyone who summoned the patience to read all of  that...
sorry for the length.  I couldn't manage less).

Scot B.

Footnotes:
[1] http://thread.gmane.org/gmane.emacs.orgmode/8373
[2] http://groups.google.com/group/gnu.emacs.sources/browse_thread/thread/49c826201105d1e9/7c3ea8323041f91c?lnk=gst&q=footnote#7c3ea8323041f91c
[3] http://groups.google.com/group/gnu.emacs.sources/browse_thread/thread/e809fa5d396a7aa2/1d001b35388725b4?lnk=gst&q=footnote#1d001b35388725b4
[4] http://osdir.com/ml/emacs.muse.general/2007-11/msg00012.html
[5] https://mail.gna.org/public/muse-el-discuss/2007-11/msg00027.html
[6] https://mail.gna.org/public/muse-el-discuss/2007-11/msg00033.html
[namednote] Like this.
[7] http://johnmacfarlane.net/pandoc/

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Footnotes and org-export, revisited
  2008-12-17 12:52 Footnotes and org-export, revisited Scot Becker
@ 2008-12-17 13:28 ` Paul R
  2008-12-17 13:31 ` Carsten Dominik
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 26+ messages in thread
From: Paul R @ 2008-12-17 13:28 UTC (permalink / raw)
  To: Scot Becker; +Cc: emacs-orgmode

Hi Scot,

On Wed, 17 Dec 2008 12:52:59 +0000, "Scot Becker" <scot03@streetgreek.com> said:

Scot> But someone working in Muse did write an interesting extension to
Scot> Muse's footnote support. (The extension is explained here [5], and
Scot> the revised version of the code is here [6]). It is basically
Scot> a hook function which converts footnotes with reference
Scot> names[fn:named_note] to plain, numbered footnotes, like Muse and
Scot> org-mode support. It operates on a temporary buffer just before
Scot> export to LaTeX or HTML, so is transparent to the user.

I'm the author of this little hack. I've not found any other simple way
to handle footnote, and in particular in spite of my efforts, I did
never manage to have footnote+ working reliably.

I think all the suggestions you make in your mail make sens. In any
case, I think the solution must behave like latex (and like my hack).
This means in org documents footnotes sould be either anonymous, like in
latex \footnote{footnote content ...} or named by keyword, not by
ordered numbers. That way, you can preserve the flow of your writing and
keep easy to look both at the reference and the definition. And,
obviously, you don't renumber everything each time you insert a new
footnote.

My personnal vote goes to anonymous footnotes, like in latex.

-- 
  Paul

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Footnotes and org-export, revisited
  2008-12-17 12:52 Footnotes and org-export, revisited Scot Becker
  2008-12-17 13:28 ` Paul R
@ 2008-12-17 13:31 ` Carsten Dominik
  2008-12-17 15:29   ` Paul R
  2008-12-17 14:04 ` Jörg Hagmann
  2009-01-01  9:07 ` Carsten Dominik
  3 siblings, 1 reply; 26+ messages in thread
From: Carsten Dominik @ 2008-12-17 13:31 UTC (permalink / raw)
  To: Scot Becker; +Cc: emacs-orgmode

Hi Scot,

thanks for your detailed and thoughtful post.

On second consideration,  I really like the proposal Matt
made back then, and I even like more that there is already
code to do this conversion.  A quick look at Paul's code
indicates that

    (add-hook 'org-export-preprocess-hook
    	     'muse-build-list-of-footnotes)

should be enough to get his code and footnote format
working in Org-mode.  The only inconsistency would
currently be caused by trees that are marked archive
or comment, because any footnotes defined in such
trees would currently still be published as well.  But
that could be solved by a new hook called after
these trees have been removed from the temporary buffer.

If Paul agrees, and if he has signed the papers with the FSF,
we can integrate his code into Org-mode.

- Carsten

On Dec 17, 2008, at 1:52 PM, Scot Becker wrote:

> Dear all,
>
> I'm a new org user who recently ran across the video of Carsten's
> Google talk. I have been looking for something like org for years, but
> learning Emacs had always seemed too high a price, so I never really
> considered Emacs-based options.  However time is a teacher, and I see
> now that there are plenty of other higher prices than learning Emacs,
> which has anyway proved easier than I thought.  Org-mode is really an
> amazing piece of work, a highly original piece of software, and
> possibly just what this vim user needs. When I think how much time I
> spent other solutions, including vim's two (basically unmaintained and
> functionally feeble) outline modes, I can only resign myself to the
> mild shame.
>
> The following is in response to a brief thread posted to this list in
> October by Matthew Lundin.  He described the limitations of
> footnotes.el, and suggested two possibilities for extending footnotes
> support in org-mode. [1].
>
> The problem with Steve L. Baur's (otherwise useful) footnotes mode is
> that it cannot 'read' the contents of a loaded buffer.  So in any
> given editing session, footnote numbering always starts with 1, even
> if you already had 1...10 in your file from a previous editing
> session.  This is simply a limitation of the mode in its current
> state.  I expect the package's scope was originally confined to using
> footnotes in plain text emails, which are generally finished in one
> shot.
>
> There have been some efforts to overcome this limitation by means of a
> patch to  footnote.el [2] and a new function, footnote-init.el [3]
> which reads the contents of a newly loaded  buffer so that the patched
> footnote.el 'knows' about previously placed footnotes.  These
> particular patches may not have all the kinks worked out, however,[4]
> and are not part of the current CVS of Emacs 23.
>
> But someone working in Muse did write an interesting extension to
> Muse's footnote support. (The extension is explained here [5], and the
> revised version of the code is here [6]). It is basically a hook
> function which converts footnotes with reference names[fn:named_note]
> to plain, numbered footnotes, like Muse and org-mode support. It
> operates on a temporary buffer  just before export to LaTeX or HTML,
> so is transparent to the user.
>
> I too would like to make use of org-mode to do more extensive
> footnoting than the current footnote.el easily allows.  I'm not sure
> of the best solution.  Here are the alternatives I can think of:
>
> 1.  Help Baur's footnotes.el get to the point where it has no trouble
> with multiple editing sessions and managing the numbering of any
> arbitrary quantity of footnotes.  This is possible in theory.  But I
> suspect that footnotes associated with body text by simple Arabic
> numerals are pretty easy to mangle in a simple text system that lets
> you do arbitrary things with the text. Comments?
>
> 2.  Adapt the Muse code mentioned above for use with org-mode.  This
> would keep org-mode's current footnote support unchanged, but allow
> named footnotes while writing. Carsten suggested something like this
> in his response to Matthew.
>
> 3.  Add named footnote support to org-mode according to Matthew's
> second suggestion (similar to footnote functionality in Pandoc,
> Multi-Markdown or ReST). This could optionally include a function for
> the auto-generation of short (?) unique-ish IDs  to use instead of
> names (in a long document, giving named references to dozens of
> similar footnotes could itself be a source of confusion).
>
> 4.  Forget org-mode for anything with any quantity of footnotes.  This
> is Carsten's other suggestion in response to Matthew.  It's possible
> that the practicalities of footnote handling would prove too costly to
> get right.  He knows this much better than I.  (though I'm not sure
> that they impair org's plan-text readability as Carsten suggests.
>
> 5.  A final solution (which might also gain other advantages) could be
> to begin to facilitate an org-export mode to Pandoc's native
> plain-text syntax (an extension of Markdown).[7] Pandoc is a robust
> Haskell engine to convert between plain text formats.  This would add
> a step to org-mode export, but that one step could potentially allow
> conversion into the wide range of formats that Pandoc supports
> (markdown, reStructuredText, HTML, LaTeX, ConTeXt, RTF, DocBook XML,
> OpenDocument XML, ODT, GNU Texinfo, MediaWiki markup, groff man pages,
> and S5 HTML slide shows). Pandoc's syntax model already has a lot in
> common with org's.  (Both allow LaTeX pass-through, for example).  I
> don't know if such an export would meet the effort vs. value trade
> off, but I suggest it might.
>
> Comments? (by anyone who summoned the patience to read all of  that...
> sorry for the length.  I couldn't manage less).
>
> Scot B.
>
> Footnotes:
> [1] http://thread.gmane.org/gmane.emacs.orgmode/8373
> [2] http://groups.google.com/group/gnu.emacs.sources/browse_thread/thread/49c826201105d1e9/7c3ea8323041f91c?lnk=gst&q=footnote#7c3ea8323041f91c
> [3] http://groups.google.com/group/gnu.emacs.sources/browse_thread/thread/e809fa5d396a7aa2/1d001b35388725b4?lnk=gst&q=footnote#1d001b35388725b4
> [4] http://osdir.com/ml/emacs.muse.general/2007-11/msg00012.html
> [5] https://mail.gna.org/public/muse-el-discuss/2007-11/msg00027.html
> [6] https://mail.gna.org/public/muse-el-discuss/2007-11/msg00033.html
> [namednote] Like this.
> [7] http://johnmacfarlane.net/pandoc/
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Footnotes and org-export, revisited
  2008-12-17 12:52 Footnotes and org-export, revisited Scot Becker
  2008-12-17 13:28 ` Paul R
  2008-12-17 13:31 ` Carsten Dominik
@ 2008-12-17 14:04 ` Jörg Hagmann
  2009-01-01  9:07 ` Carsten Dominik
  3 siblings, 0 replies; 26+ messages in thread
From: Jörg Hagmann @ 2008-12-17 14:04 UTC (permalink / raw)
  To: Scot Becker; +Cc: emacs-orgmode

>
> 5.  A final solution (which might also gain other advantages) could be
> to begin to facilitate an org-export mode to Pandoc's native
> plain-text syntax (an extension of Markdown).[7] Pandoc is a robust
> Haskell engine to convert between plain text formats.  This would add
> a step to org-mode export, but that one step could potentially allow
> conversion into the wide range of formats that Pandoc supports
> (markdown, reStructuredText, HTML, LaTeX, ConTeXt, RTF, DocBook XML,
> OpenDocument XML, ODT, GNU Texinfo, MediaWiki markup, groff man pages,
> and S5 HTML slide shows). Pandoc's syntax model already has a lot in
> common with org's.  (Both allow LaTeX pass-through, for example).  I
> don't know if such an export would meet the effort vs. value trade
> off, but I suggest it might.
>   
I would welcome an org-export mode to Pandoc's markdown. I'm currently 
using markdown --> Pandoc for generating pdfs via ConTeXt and editable 
documents for people using word processors. An org-export mode to 
markdown would definitely make org the dominating mode for me.

Cheers, Jörg

-- 
Prof. Jörg Hagmann-Zanolari MD
University of Basel
Department of Biomedicine
Institute of Biochemistry and Genetics
Mattenstrasse 28
CH-4058 Basel
Switzerland
Phone +41 (0)61 267 3565

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Footnotes and org-export, revisited
  2008-12-17 13:31 ` Carsten Dominik
@ 2008-12-17 15:29   ` Paul R
  2008-12-17 15:59     ` Scot Becker
                       ` (2 more replies)
  0 siblings, 3 replies; 26+ messages in thread
From: Paul R @ 2008-12-17 15:29 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode


Carsten> If Paul agrees, and if he has signed the papers with the FSF,
Carsten> we can integrate his code into Org-mode.

I do agree and I do have assigned copyrights to the FSF, but from the
technical point of view I would prefer to see plain anonymous footnotes
as explained above. I might implement it myself in case everybody agrees
on it but nobody has time for it.

Can others express their views on pros and cons of the two following
usages :

* Usage 1, anonymous footnotes

Karate or karate-do is a martial art developed in the Ryukyu Islands
from indigenous fighting methods and Chinese kenpō[fn:: Kenpo is the
name of several martial arts]. It is primarily a striking art using
punching, kicking, knee and elbow strikes and open-handed techniques
such as knife-hands and ridge-hands.

Grappling, locks, restraints, throws, and vital point strikes are taught
in some styles. A karate practitioner is called a karateka.


* Usage 2, keyword named footnotes

Karate or karate-do is a martial art developed in the Ryukyu Islands
from indigenous fighting methods and Chinese kenpō[fn:kenpo]. It is
primarily a striking art using punching, kicking, knee and elbow strikes
and open-handed techniques such as knife-hands and ridge-hands.

[fn:kenpo] Kenpo is the name of several martial arts

Grappling, locks, restraints, throws, and vital point strikes are taught
in some styles. A karate practitioner is called a karateka.

-- 
  Paul

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Footnotes and org-export, revisited
  2008-12-17 15:29   ` Paul R
@ 2008-12-17 15:59     ` Scot Becker
  2008-12-17 20:54       ` Matthew Lundin
  2008-12-17 16:08     ` Carsten Dominik
  2008-12-17 17:18     ` Sivaram Neelakantan
  2 siblings, 1 reply; 26+ messages in thread
From: Scot Becker @ 2008-12-17 15:59 UTC (permalink / raw)
  To: Paul R; +Cc: emacs-orgmode

I'm torn.

Usage 1 is harder to read.  My footnotes, for example, are very long
compared to your example.  Of course, within emacs, this could be made
much less severe with a little syntax coloring.  It has the advantage
that it never gets lost or otherwise mangled without your knowledge,
and you don't have to wonder whether you used 'kenpo' as a reference
already, and just what might be the consequences if you did.  It's
only liability is readability.

Usage 2 is easier to read, which is the trend in plain-text markup
these days.  Pandoc, Multi-Markdown and ReST all do it this way, which
isn't to say that we should.  It is a little more fragile, since I
might move the paragraph and forget its accompanying footnote, and it
leaves the user to come up with an original reference name, which
could get to be burdensome in if you try to write in an academic field
which averages 3-5  footnotes per page (1 per 75 words or so).  It's
also more typing work.

Some of the disadvantages of Usage 2 can helped. A fairly simple
footnote composition routine could automate the note entry and return
to the body text, and, for the desperate, could append a few random
characters to the reference for uniqueness.
 Its similarity to the other minimal markup languages might lend
itself towards easy export to those.  (Pandoc, for example, has
initial support for citeproc a citatation scheme still in development
which aims at being a kind of BibTeX for plain-text markup languages).

A user's preference probably depends on whether they expect to do a
lot of editing within org (where you might bias readability and
therefore the separation of note and body text) or just want a quick
write, either because you don't require a lot of reworking or because
you plan to do it elsewhere,  in LaTeX, one of the lightweight
markups, or a (gasp) GUI Word Processor.

Scot

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Footnotes and org-export, revisited
  2008-12-17 15:29   ` Paul R
  2008-12-17 15:59     ` Scot Becker
@ 2008-12-17 16:08     ` Carsten Dominik
  2008-12-17 16:32       ` Paul R
  2008-12-17 17:18     ` Sivaram Neelakantan
  2 siblings, 1 reply; 26+ messages in thread
From: Carsten Dominik @ 2008-12-17 16:08 UTC (permalink / raw)
  To: Paul R; +Cc: emacs-orgmode

Hi Paul,

I think we can easily have both,  I can do the coding based on your  
function, this is a small change.

- Carsten

On Dec 17, 2008, at 4:29 PM, Paul R wrote:

>
> Carsten> If Paul agrees, and if he has signed the papers with the FSF,
> Carsten> we can integrate his code into Org-mode.
>
> I do agree and I do have assigned copyrights to the FSF, but from the
> technical point of view I would prefer to see plain anonymous  
> footnotes
> as explained above. I might implement it myself in case everybody  
> agrees
> on it but nobody has time for it.
>
> Can others express their views on pros and cons of the two following
> usages :
>
> * Usage 1, anonymous footnotes
>
> Karate or karate-do is a martial art developed in the Ryukyu Islands
> from indigenous fighting methods and Chinese kenpō[fn:: Kenpo is the
> name of several martial arts]. It is primarily a striking art using
> punching, kicking, knee and elbow strikes and open-handed techniques
> such as knife-hands and ridge-hands.
>
> Grappling, locks, restraints, throws, and vital point strikes are  
> taught
> in some styles. A karate practitioner is called a karateka.
>
>
> * Usage 2, keyword named footnotes
>
> Karate or karate-do is a martial art developed in the Ryukyu Islands
> from indigenous fighting methods and Chinese kenpō[fn:kenpo]. It is
> primarily a striking art using punching, kicking, knee and elbow  
> strikes
> and open-handed techniques such as knife-hands and ridge-hands.
>
> [fn:kenpo] Kenpo is the name of several martial arts
>
> Grappling, locks, restraints, throws, and vital point strikes are  
> taught
> in some styles. A karate practitioner is called a karateka.
>
> -- 
>  Paul

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Footnotes and org-export, revisited
  2008-12-17 16:08     ` Carsten Dominik
@ 2008-12-17 16:32       ` Paul R
  2008-12-17 16:58         ` Carsten Dominik
  0 siblings, 1 reply; 26+ messages in thread
From: Paul R @ 2008-12-17 16:32 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode

Hi Carsten

Carsten> Hi Paul, I think we can easily have both, I can do the coding
Carsten> based on your function, this is a small change.

Ok so here is the latest version in my .emacs :

You'll need (eval-when-compile (require 'cl)) because of rx ... When
I wrote this function I wanted to try rx, but if it is annoying I can
rewrite back all the regexp as strings.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(setq muse-footnote-prefix "fn:")

;; todo : handle footnotes in comments
(defun muse-build-list-of-footnotes ()
  (let ((refkey "")(def "")(count 0)(deb 0)(def-deb 0)(def-fin 0)(liste nil)(found nil))
    (save-excursion
      (goto-char (point-min))
      (while (re-search-forward 
              (rx (minimal-match
                   (seq
                    (one-or-more not-newline)
                    "[" (group (and (eval muse-footnote-prefix)
                                    (one-or-more wordchar)))
                    "]")))
              nil t)
        (setq found t)
        (incf count)
        (setq refkey (match-string 1))
        (replace-match (number-to-string count) nil nil nil 1)
        (save-excursion
          (unless (re-search-forward
                   (dont-compile
                     (rx (seq bol
                              "[" (eval refkey) "]"
                              (zero-or-more blank)))) nil t)
            (setq def (list (concat "Unable to find footnote definition for "  refkey)))
            (signal 'quit def))
          (setq deb (match-beginning 0))
          (setq def-deb (match-end 0))
          (re-search-forward
           (rx (or "\n\n"
                   (seq "\n[" (eval muse-footnote-prefix))
                   (seq (zero-or-one "\n") buffer-end))))
          (setq def-fin (match-beginning 0))
          (push (buffer-substring def-deb def-fin) liste)
          (delete-region deb def-fin)
          )
        )
      (goto-char (point-max))
      (setq liste (reverse liste))
      (setq count 0)
      (setq def (dolist (elem liste def)
                  (incf count)
                  (setq def (concat def "[" (number-to-string count) "] "
                                    (muse-publish-escape-specials-in-string  elem 'document) 
                                    "\n\n"))))
      (if found (insert (concat "\n\nFootnotes:\n" def)) nil)
      )))

;;;;;;;;;;;;;;;;;;;;;;;;;;;

-- 
  Paul

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Footnotes and org-export, revisited
  2008-12-17 16:32       ` Paul R
@ 2008-12-17 16:58         ` Carsten Dominik
  2008-12-17 17:25           ` Paul R
  0 siblings, 1 reply; 26+ messages in thread
From: Carsten Dominik @ 2008-12-17 16:58 UTC (permalink / raw)
  To: Paul R; +Cc: emacs-orgmode

Hi Paul,

thanks for this latest version! No need for you to change anything  
right now, let me first play with it and seen what else I might think  
off.  I really like your idea to use [fn:label] and [fn::Full footnote  
text], nice syntactic sugar.

- Carsten

On Dec 17, 2008, at 5:32 PM, Paul R wrote:

> Hi Carsten
>
> Carsten> Hi Paul, I think we can easily have both, I can do the coding
> Carsten> based on your function, this is a small change.
>
> Ok so here is the latest version in my .emacs :
>
> You'll need (eval-when-compile (require 'cl)) because of rx ... When
> I wrote this function I wanted to try rx, but if it is annoying I can
> rewrite back all the regexp as strings.
>
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
>
> (setq muse-footnote-prefix "fn:")
>
> ;; todo : handle footnotes in comments
> (defun muse-build-list-of-footnotes ()
>  (let ((refkey "")(def "")(count 0)(deb 0)(def-deb 0)(def-fin 0) 
> (liste nil)(found nil))
>    (save-excursion
>      (goto-char (point-min))
>      (while (re-search-forward
>              (rx (minimal-match
>                   (seq
>                    (one-or-more not-newline)
>                    "[" (group (and (eval muse-footnote-prefix)
>                                    (one-or-more wordchar)))
>                    "]")))
>              nil t)
>        (setq found t)
>        (incf count)
>        (setq refkey (match-string 1))
>        (replace-match (number-to-string count) nil nil nil 1)
>        (save-excursion
>          (unless (re-search-forward
>                   (dont-compile
>                     (rx (seq bol
>                              "[" (eval refkey) "]"
>                              (zero-or-more blank)))) nil t)
>            (setq def (list (concat "Unable to find footnote  
> definition for "  refkey)))
>            (signal 'quit def))
>          (setq deb (match-beginning 0))
>          (setq def-deb (match-end 0))
>          (re-search-forward
>           (rx (or "\n\n"
>                   (seq "\n[" (eval muse-footnote-prefix))
>                   (seq (zero-or-one "\n") buffer-end))))
>          (setq def-fin (match-beginning 0))
>          (push (buffer-substring def-deb def-fin) liste)
>          (delete-region deb def-fin)
>          )
>        )
>      (goto-char (point-max))
>      (setq liste (reverse liste))
>      (setq count 0)
>      (setq def (dolist (elem liste def)
>                  (incf count)
>                  (setq def (concat def "[" (number-to-string count)  
> "] "
>                                    (muse-publish-escape-specials-in- 
> string  elem 'document)
>                                    "\n\n"))))
>      (if found (insert (concat "\n\nFootnotes:\n" def)) nil)
>      )))
>
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;
>
> -- 
>  Paul

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Footnotes and org-export, revisited
  2008-12-17 15:29   ` Paul R
  2008-12-17 15:59     ` Scot Becker
  2008-12-17 16:08     ` Carsten Dominik
@ 2008-12-17 17:18     ` Sivaram Neelakantan
  2008-12-18  8:08       ` Carsten Dominik
  2008-12-18 10:34       ` Peter Frings
  2 siblings, 2 replies; 26+ messages in thread
From: Sivaram Neelakantan @ 2008-12-17 17:18 UTC (permalink / raw)
  To: emacs-orgmode

Paul R <paul.r.ml@gmail.com> writes:


[...]

> Can others express their views on pros and cons of the two following
> usages :
>
> * Usage 1, anonymous footnotes
>
> Karate or karate-do is a martial art developed in the Ryukyu Islands
> from indigenous fighting methods and Chinese kenpō[fn:: Kenpo is the
> name of several martial arts].

[...]

And then we will have that one feature request to cross reference a
previous footnote!  :-)  In the above case, how would a person go
about asking someone to refer to an earlier footnote?

> * Usage 2, keyword named footnotes
>
> Karate or karate-do is a martial art developed in the Ryukyu Islands
> from indigenous fighting methods and Chinese kenpō[fn:kenpo]. It is
> primarily a striking art using punching, kicking, knee and elbow strikes
> and open-handed techniques such as knife-hands and ridge-hands.
>
> [fn:kenpo] Kenpo is the name of several martial arts

Unless I've got it wrong, wouldn't it be better to do something like

[fn:kenpo { Kenpo is the name of several martial arts}]
(keep the keyword and definition in one place?)

And all future references go as 'see [fn:kenpo] to understand the
meaning'.  Presumably when exported, all these keywords stuff
disappears and are replaced by standard LaTeX style footnote numbers,
right?  

[...]



 sivaram
 -- 

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Footnotes and org-export, revisited
  2008-12-17 16:58         ` Carsten Dominik
@ 2008-12-17 17:25           ` Paul R
  0 siblings, 0 replies; 26+ messages in thread
From: Paul R @ 2008-12-17 17:25 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode

Hi,

Carsten> Hi Paul, thanks for this latest version! No need for you to
Carsten> change anything right now, let me first play with it and seen
Carsten> what else I might think off. I really like your idea to use
Carsten> [fn:label] and [fn::Full footnote text], nice syntactic sugar.

Also, I'm afraid definition matching regexp won't play nicely with text
indentation, because a definition is matched when "[fn:" starts the
line. Otherwise, when this string follows a letter, it is a reference.

This will need a bit of care.

-- 
  Paul

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Re: Footnotes and org-export, revisited
  2008-12-17 15:59     ` Scot Becker
@ 2008-12-17 20:54       ` Matthew Lundin
  2008-12-17 22:23         ` Scot Becker
  0 siblings, 1 reply; 26+ messages in thread
From: Matthew Lundin @ 2008-12-17 20:54 UTC (permalink / raw)
  To: Scot Becker; +Cc: Paul R, emacs-orgmode


I was away from my computer for a few hours and was delighted to
discover this thread. This truly is an amazing mailing list.

"Scot Becker" <scot.becker@gmail.com> writes:

> I'm torn.
>
> Usage 1 is harder to read.  My footnotes, for example, are very long
> compared to your example.  Of course, within emacs, this could be made
> much less severe with a little syntax coloring.  It has the advantage
> that it never gets lost or otherwise mangled without your knowledge,
> and you don't have to wonder whether you used 'kenpo' as a reference
> already, and just what might be the consequences if you did.  It's
> only liability is readability.

I would agree that anonymous foonotes are more stable and reliable for
authors, since they're embedded in the text and are easy to move
(consisting as they do of only one part). I really like how elegant
footnote markup is in LaTeX. AUCTeX solves readability problems by
allowing the user to fold footnote macros and by indenting the text of
footnotes when filling paragraphs. I wonder whether something similar
could be implemented in in org-mode (perhaps akin to the way org-mode
already hides links).

>
> Usage 2 is easier to read, which is the trend in plain-text markup
> these days. Pandoc, Multi-Markdown and ReST all do it this way,
> which isn't to say that we should. It is a little more fragile,
> since I might move the paragraph and forget its accompanying
> footnote, and it leaves the user to come up with an original
> reference name, which could get to be burdensome in if you try to
> write in an academic field which averages 3-5 footnotes per page (1
> per 75 words or so). It's also more typing work.


I once played around with ReST, footnote export was fairly finicky.
(I'm more than willing to attribute this to my own lack of
understanding). It can be tricky to think of unique labels for each
footnote and to keep references in order. As I understand it, the
primary rationale for labelled footnotes in simple markup is to create
a source text that someone unfamiliar with the markup can read easily.
Since org-mode has ASCII export capabilities and can hide markup when
displaying text (e.g., hyperlinks, drawers), I wonder whether these
legibility issues are quite so crucial.

Best,

Matt

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Re: Footnotes and org-export, revisited
  2008-12-17 20:54       ` Matthew Lundin
@ 2008-12-17 22:23         ` Scot Becker
  0 siblings, 0 replies; 26+ messages in thread
From: Scot Becker @ 2008-12-17 22:23 UTC (permalink / raw)
  To: emacs-orgmode

>  I really like how elegant
> footnote markup is in LaTeX. AUCTeX solves readability problems by
> allowing the user to fold footnote macros and by indenting the text of
> footnotes when filling paragraphs. I wonder whether something similar
> could be implemented in in org-mode (perhaps akin to the way org-mode
> already hides links).
>
I do like this idea, if it's practical to implement, since it
preserves readability and stability.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Re: Footnotes and org-export, revisited
  2008-12-17 17:18     ` Sivaram Neelakantan
@ 2008-12-18  8:08       ` Carsten Dominik
  2008-12-18 17:13         ` Sivaram Neelakantan
  2008-12-18 10:34       ` Peter Frings
  1 sibling, 1 reply; 26+ messages in thread
From: Carsten Dominik @ 2008-12-18  8:08 UTC (permalink / raw)
  To: Sivaram Neelakantan; +Cc: emacs-orgmode


On Dec 17, 2008, at 6:18 PM, Sivaram Neelakantan wrote:

> Paul R <paul.r.ml@gmail.com> writes:
>
>
> [...]
>
>> Can others express their views on pros and cons of the two following
>> usages :
>>
>> * Usage 1, anonymous footnotes
>>
>> Karate or karate-do is a martial art developed in the Ryukyu Islands
>> from indigenous fighting methods and Chinese kenpō[fn:: Kenpo is the
>> name of several martial arts].
>
> [...]
>
> And then we will have that one feature request to cross reference a
> previous footnote!  :-)  In the above case, how would a person go
> about asking someone to refer to an earlier footnote?
>
>> * Usage 2, keyword named footnotes
>>
>> Karate or karate-do is a martial art developed in the Ryukyu Islands
>> from indigenous fighting methods and Chinese kenpō[fn:kenpo]. It is
>> primarily a striking art using punching, kicking, knee and elbow  
>> strikes
>> and open-handed techniques such as knife-hands and ridge-hands.
>>
>> [fn:kenpo] Kenpo is the name of several martial arts
>
> Unless I've got it wrong, wouldn't it be better to do something like
>
> [fn:kenpo { Kenpo is the name of several martial arts}]
> (keep the keyword and definition in one place?)
>
> And all future references go as 'see [fn:kenpo] to understand the
> meaning'.  Presumably when exported, all these keywords stuff
> disappears and are replaced by standard LaTeX style footnote numbers,
> right?
>
> [...]

Hi Sivaram,  I can see how this would be represented in
HTML (just several links to the same footnote), but how
would you represent this in LaTeX?

- Carsten

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Re: Footnotes and org-export, revisited
  2008-12-17 17:18     ` Sivaram Neelakantan
  2008-12-18  8:08       ` Carsten Dominik
@ 2008-12-18 10:34       ` Peter Frings
  2008-12-18 10:55         ` Peter Frings
  1 sibling, 1 reply; 26+ messages in thread
From: Peter Frings @ 2008-12-18 10:34 UTC (permalink / raw)
  To: emacs-orgmode Org-Mode

On Dec 17, 2008, at 6:18 PM, Sivaram Neelakantan wrote:

> Paul R <paul.r.ml@gmail.com> writes:
>
>> * Usage 1, anonymous footnotes
[snip]
>
> And then we will have that one feature request to cross reference a
> previous footnote!  :-)  In the above case, how would a person go
> about asking someone to refer to an earlier footnote?
>
>> * Usage 2, keyword named footnotes
[snip]
>>
> Unless I've got it wrong, wouldn't it be better to do something like
>
> [fn:kenpo { Kenpo is the name of several martial arts}]
> (keep the keyword and definition in one place?)
>
> And all future references go as 'see [fn:kenpo] to understand the
> meaning'.

Maybe re-use the same concepts of urls? And combine anonymous and  
labeled footnotes at once? And references?

labeled: [[fn:label][text]]
anonymous: [[fn:]][text]]
reference: [[fn:label]]

(In the reference form, the reference could become a clickable link.)

Example 1:
"This is the body of the text.[[fn:xyz][And this is the text of the  
footnote]] It indeed is a silly piece of text, but what would you  
expect?[[fn:abc][It's showing off references to previous footnotes, as  
well.[fn:xyz]]]"

Example 2:
"You can also use the references to put the footnote text out of the  
body text[[fn:xyzzy]].

[[fn:xyzzy][This footnote illustrates the out-of-the-body principle.]]"


Maybe too many brackets?

Cheers,
Peter.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Re: Footnotes and org-export, revisited
  2008-12-18 10:34       ` Peter Frings
@ 2008-12-18 10:55         ` Peter Frings
  0 siblings, 0 replies; 26+ messages in thread
From: Peter Frings @ 2008-12-18 10:55 UTC (permalink / raw)
  To: emacs-orgmode Org-Mode

Sorry, let a typo slip in:

On Dec 18, 2008, at 11:34 AM, peter.frings@agfa.com wrote:

[snip]
>
> labeled: [[fn:label][text]]
> anonymous: [[fn:]][text]]
> reference: [[fn:label]]

Must of course be:

anonymous: [[fn:][text]]

Cheers,
Peter.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Footnotes and org-export, revisited
  2008-12-18  8:08       ` Carsten Dominik
@ 2008-12-18 17:13         ` Sivaram Neelakantan
  0 siblings, 0 replies; 26+ messages in thread
From: Sivaram Neelakantan @ 2008-12-18 17:13 UTC (permalink / raw)
  To: emacs-orgmode

Carsten Dominik <dominik@science.uva.nl> writes:

[...]

>
> Hi Sivaram,  I can see how this would be represented in
> HTML (just several links to the same footnote), but how
> would you represent this in LaTeX?
>
> - Carsten
>
>

I confess I have no idea.  A quick google search on footnote multiple
references yielded this page

"How do I refer to the same footnote more than once?"

http://anthony.liekens.net/index.php/LaTeX/MultipleFootnoteReferences

Whether that can similarly be done through the export function, I have
no idea.


[...]

 sivaram
 -- 

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Footnotes and org-export, revisited
  2008-12-17 12:52 Footnotes and org-export, revisited Scot Becker
                   ` (2 preceding siblings ...)
  2008-12-17 14:04 ` Jörg Hagmann
@ 2009-01-01  9:07 ` Carsten Dominik
  2009-01-01 16:48   ` Matthew Lundin
  3 siblings, 1 reply; 26+ messages in thread
From: Carsten Dominik @ 2009-01-01  9:07 UTC (permalink / raw)
  To: Scot Becker; +Cc: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 5946 bytes --]

Hi,

the result of this discussion about footnotes is now
in the latest git version, see

http://orgmode.org/Changes.html#sec-1.1.1

for more information.

- Carsten

On Dec 17, 2008, at 1:52 PM, Scot Becker wrote:

> Dear all,
>
> I'm a new org user who recently ran across the video of Carsten's
> Google talk. I have been looking for something like org for years, but
> learning Emacs had always seemed too high a price, so I never really
> considered Emacs-based options.  However time is a teacher, and I see
> now that there are plenty of other higher prices than learning Emacs,
> which has anyway proved easier than I thought.  Org-mode is really an
> amazing piece of work, a highly original piece of software, and
> possibly just what this vim user needs. When I think how much time I
> spent other solutions, including vim's two (basically unmaintained and
> functionally feeble) outline modes, I can only resign myself to the
> mild shame.
>
> The following is in response to a brief thread posted to this list in
> October by Matthew Lundin.  He described the limitations of
> footnotes.el, and suggested two possibilities for extending footnotes
> support in org-mode. [1].
>
> The problem with Steve L. Baur's (otherwise useful) footnotes mode is
> that it cannot 'read' the contents of a loaded buffer.  So in any
> given editing session, footnote numbering always starts with 1, even
> if you already had 1...10 in your file from a previous editing
> session.  This is simply a limitation of the mode in its current
> state.  I expect the package's scope was originally confined to using
> footnotes in plain text emails, which are generally finished in one
> shot.
>
> There have been some efforts to overcome this limitation by means of a
> patch to  footnote.el [2] and a new function, footnote-init.el [3]
> which reads the contents of a newly loaded  buffer so that the patched
> footnote.el 'knows' about previously placed footnotes.  These
> particular patches may not have all the kinks worked out, however,[4]
> and are not part of the current CVS of Emacs 23.
>
> But someone working in Muse did write an interesting extension to
> Muse's footnote support. (The extension is explained here [5], and the
> revised version of the code is here [6]). It is basically a hook
> function which converts footnotes with reference names[fn:named_note]
> to plain, numbered footnotes, like Muse and org-mode support. It
> operates on a temporary buffer  just before export to LaTeX or HTML,
> so is transparent to the user.
>
> I too would like to make use of org-mode to do more extensive
> footnoting than the current footnote.el easily allows.  I'm not sure
> of the best solution.  Here are the alternatives I can think of:
>
> 1.  Help Baur's footnotes.el get to the point where it has no trouble
> with multiple editing sessions and managing the numbering of any
> arbitrary quantity of footnotes.  This is possible in theory.  But I
> suspect that footnotes associated with body text by simple Arabic
> numerals are pretty easy to mangle in a simple text system that lets
> you do arbitrary things with the text. Comments?
>
> 2.  Adapt the Muse code mentioned above for use with org-mode.  This
> would keep org-mode's current footnote support unchanged, but allow
> named footnotes while writing. Carsten suggested something like this
> in his response to Matthew.
>
> 3.  Add named footnote support to org-mode according to Matthew's
> second suggestion (similar to footnote functionality in Pandoc,
> Multi-Markdown or ReST). This could optionally include a function for
> the auto-generation of short (?) unique-ish IDs  to use instead of
> names (in a long document, giving named references to dozens of
> similar footnotes could itself be a source of confusion).
>
> 4.  Forget org-mode for anything with any quantity of footnotes.  This
> is Carsten's other suggestion in response to Matthew.  It's possible
> that the practicalities of footnote handling would prove too costly to
> get right.  He knows this much better than I.  (though I'm not sure
> that they impair org's plan-text readability as Carsten suggests.
>
> 5.  A final solution (which might also gain other advantages) could be
> to begin to facilitate an org-export mode to Pandoc's native
> plain-text syntax (an extension of Markdown).[7] Pandoc is a robust
> Haskell engine to convert between plain text formats.  This would add
> a step to org-mode export, but that one step could potentially allow
> conversion into the wide range of formats that Pandoc supports
> (markdown, reStructuredText, HTML, LaTeX, ConTeXt, RTF, DocBook XML,
> OpenDocument XML, ODT, GNU Texinfo, MediaWiki markup, groff man pages,
> and S5 HTML slide shows). Pandoc's syntax model already has a lot in
> common with org's.  (Both allow LaTeX pass-through, for example).  I
> don't know if such an export would meet the effort vs. value trade
> off, but I suggest it might.
>
> Comments? (by anyone who summoned the patience to read all of  that...
> sorry for the length.  I couldn't manage less).
>
> Scot B.
>
> Footnotes:
> [1] http://thread.gmane.org/gmane.emacs.orgmode/8373
> [2] http://groups.google.com/group/gnu.emacs.sources/browse_thread/thread/49c826201105d1e9/7c3ea8323041f91c?lnk=gst&q=footnote#7c3ea8323041f91c
> [3] http://groups.google.com/group/gnu.emacs.sources/browse_thread/thread/e809fa5d396a7aa2/1d001b35388725b4?lnk=gst&q=footnote#1d001b35388725b4
> [4] http://osdir.com/ml/emacs.muse.general/2007-11/msg00012.html
> [5] https://mail.gna.org/public/muse-el-discuss/2007-11/msg00027.html
> [6] https://mail.gna.org/public/muse-el-discuss/2007-11/msg00033.html
> [namednote] Like this.
> [7] http://johnmacfarlane.net/pandoc/
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[-- Attachment #1.2: Type: text/html, Size: 7405 bytes --]

[-- Attachment #2: Type: text/plain, Size: 204 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Footnotes and org-export, revisited
  2009-01-01  9:07 ` Carsten Dominik
@ 2009-01-01 16:48   ` Matthew Lundin
  2009-01-01 17:10     ` Carsten Dominik
  0 siblings, 1 reply; 26+ messages in thread
From: Matthew Lundin @ 2009-01-01 16:48 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode


Hi Carsten,

First of all, let me say thank you for this wonderful addition to
org-mode. I will certainly do more of my writing in org-mode now.
Incredible!

I've tested the new footnote feature and can get everything to work
except anonymous footnotes. When using more than one anonymous
footnote, all subsequent anonymous footnotes are exported with the
number of the first footnote and their notes are lost. (The same
happens when normalizing footnotes in org-mode.) I've included the
source and output below. At the moment, I'm using Emacs 22.2.1 (Carbon
Emacs).

Happy New Year!

- Matt

-----------

A. Here is the org source:

--begin source--

* Testing the new footnotes function
  
Here is a footnote.[fn:: The first anonymous footnote.] And here is
another footnote.[fn:: The second anonymous footnote.] And a third
anonymous footnote.[fn:: The third anonymous footnote.] Now a footnote
with a definition.[fn:label] Here is the footnote with a
definition.[fn:special: Inline definition.] Here is a reference to
that same footnote.[fn:special] And a traditional numbered
footnote.[2]

[fn:label] Named footnote.

[2] Numbered footnote.

--end source--

B. Here's what the exported html looks like (copied from w3m):

---begin exported html---

Table of Contents

  * 1 Testing the new footnotes function

1 Testing the new footnotes function

Here is a footnote.^1 And here is another footnote.^1 And a third
anonymous footnote.^1 Now a footnote with a definition.^2 Here is the
footnote with a definition.^3 Here is a reference to that same
footnote.^3 And a traditional numbered footnote.^4

Footnotes:

^1 The first anonymous footnote.

^2 Named footnote.

^3 Inline definition.

^4 Numbered footnote.

---end exported html---

C. Finally, here are the results when I normalize the footnotes in
org-mode:

* Testing the new footnotes function
  
Here is a footnote.[1] And here is another footnote.[1] And a third
anonymous footnote.[1] Now a footnote with a definition.[2] Here is
the footnote with a definition.[3] Here is a reference to that same
footnote.[3] And a traditional numbered footnote.[4]

* Footnotes

[1] The first anonymous footnote.

[2] Named footnote.

[3] Inline definition.

[4] Numbered footnote.

Carsten Dominik <dominik@science.uva.nl> writes:

> Hi,
>
> the result of this discussion about footnotes is now
> in the latest git version, see
>
> http://orgmode.org/Changes.html#sec-1.1.1
>
> for more information.
>
> - Carsten

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Footnotes and org-export, revisited
  2009-01-01 16:48   ` Matthew Lundin
@ 2009-01-01 17:10     ` Carsten Dominik
  2009-01-02 15:10       ` Matthew Lundin
  0 siblings, 1 reply; 26+ messages in thread
From: Carsten Dominik @ 2009-01-01 17:10 UTC (permalink / raw)
  To: Matthew Lundin; +Cc: emacs-orgmode

Hi Matt,

the bug is fixed now, thanks for the report.

Also, you can set org-footnote-section to nil
if you want non-inline footnotes to be defined
in the outline node where they are referenced, instead
of a special outline node "Footnotes".

- Carsten

On Jan 1, 2009, at 5:48 PM, Matthew Lundin wrote:

>
> Hi Carsten,
>
> First of all, let me say thank you for this wonderful addition to
> org-mode. I will certainly do more of my writing in org-mode now.
> Incredible!
>
> I've tested the new footnote feature and can get everything to work
> except anonymous footnotes. When using more than one anonymous
> footnote, all subsequent anonymous footnotes are exported with the
> number of the first footnote and their notes are lost. (The same
> happens when normalizing footnotes in org-mode.) I've included the
> source and output below. At the moment, I'm using Emacs 22.2.1 (Carbon
> Emacs).
>
> Happy New Year!
>
> - Matt
>
> -----------
>
> A. Here is the org source:
>
> --begin source--
>
> * Testing the new footnotes function
>
> Here is a footnote.[fn:: The first anonymous footnote.] And here is
> another footnote.[fn:: The second anonymous footnote.] And a third
> anonymous footnote.[fn:: The third anonymous footnote.] Now a footnote
> with a definition.[fn:label] Here is the footnote with a
> definition.[fn:special: Inline definition.] Here is a reference to
> that same footnote.[fn:special] And a traditional numbered
> footnote.[2]
>
> [fn:label] Named footnote.
>
> [2] Numbered footnote.
>
> --end source--
>
> B. Here's what the exported html looks like (copied from w3m):
>
> ---begin exported html---
>
> Table of Contents
>
>  * 1 Testing the new footnotes function
>
> 1 Testing the new footnotes function
>
> Here is a footnote.^1 And here is another footnote.^1 And a third
> anonymous footnote.^1 Now a footnote with a definition.^2 Here is the
> footnote with a definition.^3 Here is a reference to that same
> footnote.^3 And a traditional numbered footnote.^4
>
> Footnotes:
>
> ^1 The first anonymous footnote.
>
> ^2 Named footnote.
>
> ^3 Inline definition.
>
> ^4 Numbered footnote.
>
> ---end exported html---
>
> C. Finally, here are the results when I normalize the footnotes in
> org-mode:
>
> * Testing the new footnotes function
>
> Here is a footnote.[1] And here is another footnote.[1] And a third
> anonymous footnote.[1] Now a footnote with a definition.[2] Here is
> the footnote with a definition.[3] Here is a reference to that same
> footnote.[3] And a traditional numbered footnote.[4]
>
> * Footnotes
>
> [1] The first anonymous footnote.
>
> [2] Named footnote.
>
> [3] Inline definition.
>
> [4] Numbered footnote.
>
> Carsten Dominik <dominik@science.uva.nl> writes:
>
>> Hi,
>>
>> the result of this discussion about footnotes is now
>> in the latest git version, see
>>
>> http://orgmode.org/Changes.html#sec-1.1.1
>>
>> for more information.
>>
>> - Carsten

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Footnotes and org-export, revisited
  2009-01-01 17:10     ` Carsten Dominik
@ 2009-01-02 15:10       ` Matthew Lundin
  2009-01-03  8:17         ` Carsten Dominik
  0 siblings, 1 reply; 26+ messages in thread
From: Matthew Lundin @ 2009-01-02 15:10 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode


Hi Carsten,

Carsten Dominik <dominik@science.uva.nl> writes:

> Hi Matt,
>
> the bug is fixed now, thanks for the report.
>
> Also, you can set org-footnote-section to nil
> if you want non-inline footnotes to be defined
> in the outline node where they are referenced, instead
> of a special outline node "Footnotes".

Thanks for alerting me to this option. I'm assuming that
org-footnote-section is meant to control the initial placement of
non-inline footnotes and not their placement after sorting or
normalizing. (When I sort or normalize the footnotes, they are placed
at the end of the last section of the outline.) Would it be possible
to have this option also control the placement of sorted footnotes?
I.e., during sorting or normalizing, footnotes would be placed in the
outline section corresponding to their reference. 

A few other *wishlist* items/ideas regarding this wonderful addition
to org-mode. Please feel free to consider or disregard these ideas at
your leisure.

A. For visibility in org-mode files, it might be nice if there were a
special face for the footnote markup. One of the things I really like
about AUCTeX is its nice color highlighting of macros such as
footnotes. (And, of course, I like the same thing about hyperlinks in
org-mode!)

B. Also for visibility in org-mode files, it might nice to have the
option of making the content of inline footnotes invisible (similar to
AUCTeX macro folding). For instance, if this option were turned on...

Here is a footnote.[fn:: Footnote text.]

     would appear as...
     
Here is a footnote.[fn] 

Perhaps then a function/keybinding could allow editing the footnote
text in the minibuffer, similar to C-c C-l for links.

C. The in-buffer conversion from inline footnotes to numbered
footnotes is fantastic for creating readable documents. It might be a
nice feature to have a similar conversion in reverse: that is, from
non-inline footnotes to inline footnotes? As far as I understand it,
the pre-process hook for org-latex-export already does something
similar (line 1310). It converts regular footnotes like this:

Here is a footnote.[1]

[1] Footnote text.

    to...

Here is a footnote.\footnote{Footnote text.} 

I wonder whether something similar could be available in org-mode
buffers--i.e., conversion to the inline [fn:: Footnote text] instead
of the LaTeX macro.

The chief rationale for such a feature would be to make footnotes
portable from one org-mode file to another. Let's say I have a lot of
numbered/labeled footnotes defined under an outline heading titled
"Footnotes." Let's say, additionally, that I'd like to copy one
subtree of text from that file to a different file, but that I want to
ensure that only those footnotes referred to in the subtree are
copied. Being able to convert all footnotes in the file to inline
footnotes would ensure that the correct footnotes are
attached/included. Then, of course, it would be easy to normalize
footnotes once again in both files.

D. When normalizing inline footnotes, it would be nice if there were
an option for automatically filling the resulting paragraphs and
footnotes. Currently the following source:
 
A long inline footnote.[fn:: Here is a long inline footnote that
stretches on and on.] Another footnote appears here.[fn:: Footnote
text.] And here is another inline footnote.[fn:: Inline footnote
number 3.]

       normalizes to...

A long inline footnote.[1] Another footnote appears here.[2] And here is another inline footnote.[3]

[1] Here is a long inline footnote that
stretches on and on.

[2] Footnote
text.

[3] Inline footnote
number 3.

Sorry for this exceedingly long email. Again, these are simply
wishlist items that I respectfully submit for your consideration.

Already the footnote markup does more than I ever imagined I'd be able
to do in plain text. Thanks again!

- Matt

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Footnotes and org-export, revisited
  2009-01-02 15:10       ` Matthew Lundin
@ 2009-01-03  8:17         ` Carsten Dominik
  2009-01-03 22:53           ` Matthew Lundin
  0 siblings, 1 reply; 26+ messages in thread
From: Carsten Dominik @ 2009-01-03  8:17 UTC (permalink / raw)
  To: Matthew Lundin; +Cc: emacs-orgmode

Hi Matt, thanks for this much needed feedback.  I was already working
into the direction of some of your proposals, but certainly not all.

On Jan 2, 2009, at 4:10 PM, Matthew Lundin wrote:

>
> Hi Carsten,
>
> Carsten Dominik <dominik@science.uva.nl> writes:
>
>> Hi Matt,
>>
>> the bug is fixed now, thanks for the report.
>>
>> Also, you can set org-footnote-section to nil
>> if you want non-inline footnotes to be defined
>> in the outline node where they are referenced, instead
>> of a special outline node "Footnotes".
>
> Thanks for alerting me to this option. I'm assuming that
> org-footnote-section is meant to control the initial placement of
> non-inline footnotes and not their placement after sorting or
> normalizing. (When I sort or normalize the footnotes, they are placed
> at the end of the last section of the outline.) Would it be possible
> to have this option also control the placement of sorted footnotes?
> I.e., during sorting or normalizing, footnotes would be placed in the
> outline section corresponding to their reference.

Yes, this would be much more consistent.  Now it does this,
sorting will move each definition to the entry of the first
reference, if org-footnote-section is nil.

>
>
> A few other *wishlist* items/ideas regarding this wonderful addition
> to org-mode. Please feel free to consider or disregard these ideas at
> your leisure.
>
> A. For visibility in org-mode files, it might be nice if there were a
> special face for the footnote markup. One of the things I really like
> about AUCTeX is its nice color highlighting of macros such as
> footnotes. (And, of course, I like the same thing about hyperlinks in
> org-mode!)

Done.

>
>
> B. Also for visibility in org-mode files, it might nice to have the
> option of making the content of inline footnotes invisible (similar to
> AUCTeX macro folding). For instance, if this option were turned on...
>
> Here is a footnote.[fn:: Footnote text.]
>
>     would appear as...
>
> Here is a footnote.[fn]
>
> Perhaps then a function/keybinding could allow editing the footnote
> text in the minibuffer, similar to C-c C-l for links.

I agree that this would be nice, but multiline font-lock (which
would be needed to do this) is relatively fragile.  I believe John & CO
have a better font-lock scheme in muse wich does handle this stuff  
better,
but I would need time to study how tis exactly works.

So no for now.

> C. The in-buffer conversion from inline footnotes to numbered
> footnotes is fantastic for creating readable documents. It might be a
> nice feature to have a similar conversion in reverse: that is, from
> non-inline footnotes to inline footnotes? As far as I understand it,
> the pre-process hook for org-latex-export already does something
> similar (line 1310).

Yes.  Footnote export to LaTeX is actually silly.  It first extracts
all notes to the end of te buffer during preprocessing, and then
moves them back during export :-)

> It converts regular footnotes like this:
>
> Here is a footnote.[1]
>
> [1] Footnote text.
>
>    to...
>
> Here is a footnote.\footnote{Footnote text.}
>
> I wonder whether something similar could be available in org-mode
> buffers--i.e., conversion to the inline [fn:: Footnote text] instead
> of the LaTeX macro.
>
> The chief rationale for such a feature would be to make footnotes
> portable from one org-mode file to another.

Isn't the new sorting good enough for this?  I am uncomfortable with
letting a program doing so much complex editing.  I think it will
break too often.

> Let's say I have a lot of
> numbered/labeled footnotes defined under an outline heading titled
> "Footnotes." Let's say, additionally, that I'd like to copy one
> subtree of text from that file to a different file, but that I want to
> ensure that only those footnotes referred to in the subtree are
> copied. Being able to convert all footnotes in the file to inline
> footnotes would ensure that the correct footnotes are
> attached/included. Then, of course, it would be easy to normalize
> footnotes once again in both files.
>
> D. When normalizing inline footnotes, it would be nice if there were
> an option for automatically filling the resulting paragraphs and
> footnotes. Currently the following source:

This option does now exist:

org-footnote-fill-after-inline-note-extraction

The only problem s that while Org-s fill-paragraph does the right
thing under most circumstances, there are cases where it is imperfect
or even breaks things.  Try it, mostly it should work.
In fact, this is relevant only for normalizing in the buffer, and for  
the
ASCII backend.  The other backends do not care.

Thanks, please keep testing and the feedback coming.

- Carsten

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Footnotes and org-export, revisited
  2009-01-03  8:17         ` Carsten Dominik
@ 2009-01-03 22:53           ` Matthew Lundin
  2009-01-04  7:39             ` Carsten Dominik
  0 siblings, 1 reply; 26+ messages in thread
From: Matthew Lundin @ 2009-01-03 22:53 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode


Hi Carsten,

Thanks for the quick response. I've written a couple of additional
comments below.

Carsten Dominik <dominik@science.uva.nl> writes:

> Hi Matt, thanks for this much needed feedback.  I was already working
> into the direction of some of your proposals, but certainly not all.
>
> On Jan 2, 2009, at 4:10 PM, Matthew Lundin wrote:
>>
>> Thanks for alerting me to this option. I'm assuming that
>> org-footnote-section is meant to control the initial placement of
>> non-inline footnotes and not their placement after sorting or
>> normalizing. (When I sort or normalize the footnotes, they are placed
>> at the end of the last section of the outline.) Would it be possible
>> to have this option also control the placement of sorted footnotes?
>> I.e., during sorting or normalizing, footnotes would be placed in the
>> outline section corresponding to their reference.
>
> Yes, this would be much more consistent.  Now it does this,
> sorting will move each definition to the entry of the first
> reference, if org-footnote-section is nil.
>

This is great! I did notice a couple of quirks when
org-footnote-section is set to nil.

A. If there is no empty line at the end of a section or the end of the
buffer, org-footnote-action inserts the footnote above the reference.
As in the following example:

----begin org file-----
* Headline one

[fn:1] Org-footnote-action inserts footnote above the reference.

A footnote inserted with no space the bottom of a section.[fn:1]
* Headline two
   One empty line at the bottom of this section.[fn:2]

[fn:2] 

* Headline three

[fn:3] Again, same behavior as first footnote.

No space at the bottom of buffer.[fn:3]
----end org file-----

B. If one of the footnotes is directly above a headline (i.e., no
intervening empty line), it does not get sorted with C-u C-c C-x f s.

-----begin original org file-----

* Headline one

Here is a footnote.[fn:1] And here is another footnote.[fn:2] And here
is a third footnote.[fn:3] 

[fn:3] Footnote three

[fn:1] Footnote one.

[fn:2] Footnote two.
* Headline two

-----end original org file-------

And after sorting:

-----begin sorted footnotes file------

* Headline one

Here is a footnote.[fn:1] And here is another footnote.[fn:2] And here
is a third footnote.[fn:3]

[fn:1] Footnote one.

[fn:3] Footnote three

[fn:2] Footnote two.
* Headline two 

-----end sorted footnotes file------


>> C. The in-buffer conversion from inline footnotes to numbered
>> footnotes is fantastic for creating readable documents. It might be a
>> nice feature to have a similar conversion in reverse: that is, from
>> non-inline footnotes to inline footnotes? 
>>
>> The chief rationale for such a feature would be to make footnotes
>> portable from one org-mode file to another.
>
> Isn't the new sorting good enough for this?  I am uncomfortable with
> letting a program doing so much complex editing.  I think it will
> break too often.

Yes, I see how this could be a very dangerous feature, since if it
breaks, it might have ruinous effects. And I see that this would be
redundant, as the sorting option already accomplishes this quite
nicely.

> Thanks, please keep testing and the feedback coming.

I most certainly will! 

At the risk of sounding like a broken record, thanks again for all
your work on org-mode!

Matt

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Footnotes and org-export, revisited
  2009-01-03 22:53           ` Matthew Lundin
@ 2009-01-04  7:39             ` Carsten Dominik
  2009-01-12 11:29               ` Scot Becker
  0 siblings, 1 reply; 26+ messages in thread
From: Carsten Dominik @ 2009-01-04  7:39 UTC (permalink / raw)
  To: Matthew Lundin; +Cc: emacs-orgmode

Fixed, thanks.

- Carsten

On Jan 3, 2009, at 11:53 PM, Matthew Lundin wrote:

>
> Hi Carsten,
>
> Thanks for the quick response. I've written a couple of additional
> comments below.
>
> Carsten Dominik <dominik@science.uva.nl> writes:
>
>> Hi Matt, thanks for this much needed feedback.  I was already working
>> into the direction of some of your proposals, but certainly not all.
>>
>> On Jan 2, 2009, at 4:10 PM, Matthew Lundin wrote:
>>>
>>> Thanks for alerting me to this option. I'm assuming that
>>> org-footnote-section is meant to control the initial placement of
>>> non-inline footnotes and not their placement after sorting or
>>> normalizing. (When I sort or normalize the footnotes, they are  
>>> placed
>>> at the end of the last section of the outline.) Would it be possible
>>> to have this option also control the placement of sorted footnotes?
>>> I.e., during sorting or normalizing, footnotes would be placed in  
>>> the
>>> outline section corresponding to their reference.
>>
>> Yes, this would be much more consistent.  Now it does this,
>> sorting will move each definition to the entry of the first
>> reference, if org-footnote-section is nil.
>>
>
> This is great! I did notice a couple of quirks when
> org-footnote-section is set to nil.
>
> A. If there is no empty line at the end of a section or the end of the
> buffer, org-footnote-action inserts the footnote above the reference.
> As in the following example:
>
> ----begin org file-----
> * Headline one
>
> [fn:1] Org-footnote-action inserts footnote above the reference.
>
> A footnote inserted with no space the bottom of a section.[fn:1]
> * Headline two
>   One empty line at the bottom of this section.[fn:2]
>
> [fn:2]
>
> * Headline three
>
> [fn:3] Again, same behavior as first footnote.
>
> No space at the bottom of buffer.[fn:3]
> ----end org file-----
>
> B. If one of the footnotes is directly above a headline (i.e., no
> intervening empty line), it does not get sorted with C-u C-c C-x f s.
>
> -----begin original org file-----
>
> * Headline one
>
> Here is a footnote.[fn:1] And here is another footnote.[fn:2] And here
> is a third footnote.[fn:3]
>
> [fn:3] Footnote three
>
> [fn:1] Footnote one.
>
> [fn:2] Footnote two.
> * Headline two
>
> -----end original org file-------
>
> And after sorting:
>
> -----begin sorted footnotes file------
>
> * Headline one
>
> Here is a footnote.[fn:1] And here is another footnote.[fn:2] And here
> is a third footnote.[fn:3]
>
> [fn:1] Footnote one.
>
> [fn:3] Footnote three
>
> [fn:2] Footnote two.
> * Headline two
>
> -----end sorted footnotes file------
>
>
>>> C. The in-buffer conversion from inline footnotes to numbered
>>> footnotes is fantastic for creating readable documents. It might  
>>> be a
>>> nice feature to have a similar conversion in reverse: that is, from
>>> non-inline footnotes to inline footnotes?
>>>
>>> The chief rationale for such a feature would be to make footnotes
>>> portable from one org-mode file to another.
>>
>> Isn't the new sorting good enough for this?  I am uncomfortable with
>> letting a program doing so much complex editing.  I think it will
>> break too often.
>
> Yes, I see how this could be a very dangerous feature, since if it
> breaks, it might have ruinous effects. And I see that this would be
> redundant, as the sorting option already accomplishes this quite
> nicely.
>
>> Thanks, please keep testing and the feedback coming.
>
> I most certainly will!
>
> At the risk of sounding like a broken record, thanks again for all
> your work on org-mode!
>
> Matt

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Footnotes and org-export, revisited
  2009-01-04  7:39             ` Carsten Dominik
@ 2009-01-12 11:29               ` Scot Becker
  2009-01-12 14:21                 ` Paul R
  0 siblings, 1 reply; 26+ messages in thread
From: Scot Becker @ 2009-01-12 11:29 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 900 bytes --]

I'm impressed at how the new footnote support has managed to put together
readability, stability, ease of use and export-ability (including the
ability to refer to a footnote multiple times!) .  I have seen no problems
in my initial tests, and will do more extensive (can I break anything?)
tests as soon as I have the chance.

I think that 'org' is now the only plain-text minimal markup engine to
support both inline and out-of-line footnotes, and I'm quite sure that none
of the others have numbered, labeled, and inline footnotes.  And as for ease
of use, well any comparison is unfair.  The rest are just language
specifications and processing engines, they offer no help in the writing.

I'm shocked and pleased at how Carsten (with input from the contributors to
this thread) managed to make a somewhat ragged and even contradictory
wishlist into something this elegant and easy to use.

Scot

[-- Attachment #1.2: Type: text/html, Size: 1002 bytes --]

[-- Attachment #2: Type: text/plain, Size: 204 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Footnotes and org-export, revisited
  2009-01-12 11:29               ` Scot Becker
@ 2009-01-12 14:21                 ` Paul R
  0 siblings, 0 replies; 26+ messages in thread
From: Paul R @ 2009-01-12 14:21 UTC (permalink / raw)
  To: Scot Becker; +Cc: emacs-orgmode

Hi,

Scot> I'm impressed at how the new footnote support has managed to put
Scot> together readability, stability, ease of use and export-ability

yes, I also had a chance to use it and it just worked as expected (I
love software that just works). Great job, thanks !

-- 
  Paul

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2009-01-12 14:25 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-17 12:52 Footnotes and org-export, revisited Scot Becker
2008-12-17 13:28 ` Paul R
2008-12-17 13:31 ` Carsten Dominik
2008-12-17 15:29   ` Paul R
2008-12-17 15:59     ` Scot Becker
2008-12-17 20:54       ` Matthew Lundin
2008-12-17 22:23         ` Scot Becker
2008-12-17 16:08     ` Carsten Dominik
2008-12-17 16:32       ` Paul R
2008-12-17 16:58         ` Carsten Dominik
2008-12-17 17:25           ` Paul R
2008-12-17 17:18     ` Sivaram Neelakantan
2008-12-18  8:08       ` Carsten Dominik
2008-12-18 17:13         ` Sivaram Neelakantan
2008-12-18 10:34       ` Peter Frings
2008-12-18 10:55         ` Peter Frings
2008-12-17 14:04 ` Jörg Hagmann
2009-01-01  9:07 ` Carsten Dominik
2009-01-01 16:48   ` Matthew Lundin
2009-01-01 17:10     ` Carsten Dominik
2009-01-02 15:10       ` Matthew Lundin
2009-01-03  8:17         ` Carsten Dominik
2009-01-03 22:53           ` Matthew Lundin
2009-01-04  7:39             ` Carsten Dominik
2009-01-12 11:29               ` Scot Becker
2009-01-12 14:21                 ` Paul R

Code repositories for project(s) associated with this 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).