jgm / pandoc

Universal markup converter
https://pandoc.org
Other
34.66k stars 3.38k forks source link

Numbering/Labelling of footnotes #2583

Open jevo opened 8 years ago

jevo commented 8 years ago

Hi,

We are using Markdown for the transcription of documents which contain footnotes. We realized that Pandoc would number the footnotes from 1 onwards instead of using our provided labels. While that might be handy in most cases, we do have cases where the original author used i.e. an asterisk (*) as a footnote marker and later on started numbering footnotes from 1 onwards. With subsequent numbering we loose the (scientific) citeability of the documents.

For instance:

The first footnote [^*] and now the second one [^1]

[^*]: Footnote \*
[^1]: Footnote 1

One possibility would be to start number of footnotes from the first number (like it is done for ordered lists).

However there are also authors using footnotes with letters and numbers in mixture. The only way to handle this would be literal footnote labels. I.e.

Text[^a] and more text[^b]

[^a]: some citation
[^b]: some other source

Here is a picture of the HTML view.

It should look like this:

<p>Text<sup><a href="#fna" class="footnoteRef" id="fnrefa">a</a></sup> and more
text <sup><a href="#fnb" class="footnoteRef" id="fnrefb">b</a></sup></p>
...
<li id="fna">Footnote a<a href="#fnrefa">↩</a></li>
<li id="fnb">some other source<a href="#fnrefb">↩</a></li>
...

We would like to request a command line switch or a syntax extension to allow footnote subscripts as they are entered in MarkDown.

Thanks

jgm commented 8 years ago

+++ Jevo [Dec 08 15 01:28 ]:

We would like to request a command line switch or a syntax extension to allow footnote subscripts as they are entered in MarkDown.

This would require more extensive changes than just adding an extension. It would require that the Pandoc data structure be changed so that footnote references are included. Currently we just have Note [Block], and the numbering is handled by the writer, so there is no way to pass information about the marker.

Well, I suppose a hacky way to do it would be to put the contents of the note in a special Div:

Note [Div ("",[],[("data-marker","*")]) [...contents...]]

Note also that addressing #1603 would require changing the AST so that instead of an inline element Note, we had separate NoteRef (Inline) and Note (Block) elements. This would allow the marker to be stored.

humenda commented 8 years ago

Hi,

Note also that addressing #1603 would require changing the AST so that instead of an inline element Note, we had separate NoteRef (Inline) and Note (Block) elements. This would allow the marker to be stored. Yes, that sounds good. Do you have any plans for implementing that?

Thanks