pandoc icon indicating copy to clipboard operation
pandoc copied to clipboard

Add option not to split footnotes by sections in epub

Open microspace opened this issue 11 years ago • 5 comments

For now footnotes are splitted by section and appear at the end of section. I can manage splitting depth by --epub-chapter-level option, but there is no option do disable splitting, so that all footnotes go to end of book in separatet file. Thank you.

microspace avatar Apr 22 '14 11:04 microspace

The issue should be titled IMHO, rather, “EPUB: move footnotes to separate HTML document”.

Being able to have all footnotes to either one extra document per section or one single dedicated final document is important because of how iBooks, and potentially other ereaders that understand the semantics of EPUB 3 footnote, deal with them:

iBooks will not only display EPUB 3 footnotes inline along with their references with a popover, when tapping the reference (i.e. it will fetch the footnote from another part in the book and feed it into the popover), but it will also hide from the spine and reading order any document that is made only of footnotes (as it therefore becomes pointless).

If footnotes remain as endnotes in the same document as their references, though, iBooks will not be able to hide the footnotes.

elmimmo avatar Jul 01 '14 10:07 elmimmo

Correction:

[iBooks] will also hide from the spine and reading order any document that is made only of footnotes.

This is not true. If one wants iBooks to hide the document where all footnotes are gathered, one has to explicitely use the linear="no" attribute on such document in the spine block of the OPF document (which makes sense as it is the standard way of doing so in EPUB).

The point remains, though, that the author of the EPUB only has such option if footnotes are gathered in a dedicated document.

elmimmo avatar Jul 21 '14 09:07 elmimmo

@microspace, @elmimmo, I don’t know whether the proposal in #1720 might help to describe the issue.

ousia avatar Jan 26 '15 10:01 ousia

This could also be addressed by making --reference-location affect EPUB output as well.

If footnotes remain as endnotes in the same document as their references, though, iBooks will not be able to hide the footnotes.

In #4491 I'm switching footnotes to use <aside>, which iBooks understands and will hide the footnotes.

Porges avatar Mar 25 '18 03:03 Porges

Maybe one hackish way to do this is to first convert to html and then to epub: pandoc file.md -s -t html | pandoc -f html -o book.epub

this way the notes are first placed at the end of the document during md -> html, and then the document is splitted into chapters during html -> epub.

lewer avatar Jun 22 '22 13:06 lewer