Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(enhancement) proposal for footnotes #1720

Open
ousia opened this issue Oct 25, 2014 · 14 comments
Open

(enhancement) proposal for footnotes #1720

ousia opened this issue Oct 25, 2014 · 14 comments

Comments

@ousia
Copy link
Contributor

ousia commented Oct 25, 2014

Similar to #1612, I think it would be interesting that the user were able to place footnotes in the document.

My proposal doesn’t intend to change the default way footnotes are handled. It is an improvement, optional for the user to deploy.

Right now, footnotes in HTML documents are placed at the end of the first level section, such as in:


---
title: Footnotes
...

# Chapter One

^[footnote one]

# Chapter Two

^[footnote two]

# Chapter Three

^[footnote three]

# Chapter Four

^[footnote four]

# Chapter Five

^[footnote five]

How about being able to add a first–level title that places all footnotes in the document at the given location?

A minimal sample would be:

# footnotes

Similar to the table of contents, harcoding a title for footnotes should be avoided. The ttitle for footnotes could be specified as a YAML field, such as in:


---
footnotes: Notas
....

Another way to implement it would be to use a first–level title that contains an special identifier, such as in:

# Notas {#footnotes #notas .hidden}

Two important remarks for both approaches:

  1. Other attributes than the #footnotes identifier should be allowed in the title for footnotes.
  2. If there is some text—whatever it comes before the next first–level title—in the section for footnotes, it should be placed after the title and before the footnotes themselves. Sometimes these passages are useful to explain relevant information about the footnotes.
@lierdakil
Copy link
Contributor

Relevant pandoc-discuss thread: https://groups.google.com/forum/#!topic/pandoc-discuss/HxmpFK-Ydus

@ousia
Copy link
Contributor Author

ousia commented Mar 9, 2017

@jgm, there is another issue with not being able to place #footnotes in a single place.

Using --epub-chapter-level' set to ##or###increases the number of repeated footnote numbers. I mean, if you have parts and chapters and you need to have sections as single.xhtml` files in the epub, footnote numbers would be repeated many more times than only having a place and a single series of footnotes.

I’m afraid that this feature is essential for longer documents that require only one series of footnotes.

@jgm
Copy link
Owner

jgm commented Mar 9, 2017

It's tough to see how to fix this. Currently we generate HTML for each "chapter" (that is, each split-up section, whatever level that is) as an independent document. So the numbers are going to start with 1 in each chapter. It wouldn't be enough just to move the actual notes; the numbering would still be off.

You can force everything to be in one chapter using --epub-chapter-level=1 --base-header-level=2, but if it's a long document this may have disadvantages.

@ousia
Copy link
Contributor Author

ousia commented Mar 9, 2017

Well, this is what I want to avoid: having all the document in a single chapter.

Isn’t it possible to have #footnotes the same way we have #references? This would be an alternative approach for footnotes. The best way to have endnotes as many books have.

@jgm
Copy link
Owner

jgm commented Mar 10, 2017 via email

@ousia
Copy link
Contributor Author

ousia commented May 3, 2017

The issue is not just the location, but the numbering, as mentioned above.

If numbering is problematic, wouldn’t it be possible to create a global variable that keeps track of footnote numbering between chapters?

Sorry if my proposal is stupid, but this is the simplest fix that comes to my mind to fix the issue.

@nnmrts
Copy link

nnmrts commented Dec 9, 2017

I would propose something like --epub-chapter-level=0, it seems like the most "logical" solution for me. It would shift the --epub-chapter-level=1 --base-header-level=2 "solution" one number down, the header tags won't be replaced from h1 to h2 and the whole book would be treated like one big chapter. Currently the "long document disadvantage" is the smallest problem for the developer, but probably the biggest one for readers. I hate those problems, because they always ignite a debate about whether reducing stress for users or for developers should be the top priority, but honestly, considered in total, the stress for developers in this paticular problem is way more than the stress for the users.

At the moment I have to unzip the epub file afterwards and take out every footnote section from every chapter and place it in the last chapter or, in the --epub-chapter-level=1 --base-header-level=2-case, replace every h2 by h1, every h3 by h2 and so on...

Anyways, I'm inexpressible grateful for pandoc, thank you for your work. 🙏

@ousia
Copy link
Contributor Author

ousia commented Dec 9, 2017

@nnmrts, I think the proposal is reasonable, given the facts:

  1. We might get footnotes inside footnotes (Footnote in footnote (markdown) #2053).

  2. We might have endnotes as different from footnotes (Differentiate between footnotes and endnotes #4041, Endnotes #4042).

  3. We might even get different types of notes: footnotes, endnotes, sidenotes... (Allow multiple note types (footnotes, endnotes, etc.) #1425).

Unless there is a way to locate #footnotes, #endnotes (and other types or notes that might come [excepting sidenotes]) in the same way that we place #references, the usefulness of these implementations would be very limided.

And if we already have #references, there shouldn’t be impossible to get #footnotes (sorry for insisting again, but the issue is more than three years old).

@reagle
Copy link

reagle commented Oct 28, 2021

I was just wondering this myself, but there doesn't seem to have been activity on this for a while.

@ousia
Copy link
Contributor Author

ousia commented Oct 29, 2021

@jgm, I reported this 6 years ago. Any news about the original report?

@jgm
Copy link
Owner

jgm commented Oct 29, 2021

If there were news, you would read it here, so no need to ask.

@ousia
Copy link
Contributor Author

ousia commented Nov 1, 2021

@jgm, I honestly thought this issue was simply forgotten.

@jgm
Copy link
Owner

jgm commented Nov 1, 2021

Mostly forgotten, yes. But it's still the case that if there were news, it would be here.

By the way, you may have missed that --reference-location now works with HTML output. That could help with your original request.

% pandoc --reference-location=section -t html
---
title: Footnotes
...

# Chapter One

^[footnote one]

# Chapter Two

^[footnote two]

# Chapter Three

^[footnote three]

# Chapter Four

^[footnote four]

# Chapter Five

^[footnote five]
<h1 id="chapter-one">Chapter One</h1>
<p><a href="#fn1" class="footnote-ref" id="fnref1" role="doc-noteref"><sup>1</sup></a></p>
<section class="footnotes footnotes-end-of-section" role="doc-endnotes">
<hr />
<ol>
<li id="fn1" role="doc-endnote"><p>footnote one<a href="#fnref1" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
</ol>
</section>
<h1 id="chapter-two">Chapter Two</h1>
<p><a href="#fn2" class="footnote-ref" id="fnref2" role="doc-noteref"><sup>2</sup></a></p>
<section class="footnotes footnotes-end-of-section" role="doc-endnotes">
<hr />
<ol start="2">
<li id="fn2" role="doc-endnote"><p>footnote two<a href="#fnref2" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
</ol>
</section>
<h1 id="chapter-three">Chapter Three</h1>
<p><a href="#fn3" class="footnote-ref" id="fnref3" role="doc-noteref"><sup>3</sup></a></p>
<section class="footnotes footnotes-end-of-section" role="doc-endnotes">
<hr />
<ol start="3">
<li id="fn3" role="doc-endnote"><p>footnote three<a href="#fnref3" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
</ol>
</section>
<h1 id="chapter-four">Chapter Four</h1>
<p><a href="#fn4" class="footnote-ref" id="fnref4" role="doc-noteref"><sup>4</sup></a></p>
<section class="footnotes footnotes-end-of-section" role="doc-endnotes">
<hr />
<ol start="4">
<li id="fn4" role="doc-endnote"><p>footnote four<a href="#fnref4" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
</ol>
</section>
<h1 id="chapter-five">Chapter Five</h1>
<p><a href="#fn5" class="footnote-ref" id="fnref5" role="doc-noteref"><sup>5</sup></a></p>
<section class="footnotes footnotes-end-of-section" role="doc-endnotes">
<hr />
<ol start="5">
<li id="fn5" role="doc-endnote"><p>footnote five<a href="#fnref5" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
</ol>
</section>

@reagle
Copy link

reagle commented Nov 1, 2021

BTW: My use case was a journal format that required notes before the bibliography, not after. I edited the resulting HTML manually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants