jgm / pandoc

Universal markup converter
https://pandoc.org
Other
34.05k stars 3.35k forks source link

Feature Request: Footnote Section Title #3025

Open samueldodson opened 8 years ago

samueldodson commented 8 years ago

Hi, @jgm. I would like to set the footnote section title using a metadata field. This could be achieved using an approach similar to the reference-section-title metadata field in pandoc-citeproc. CSS can be used to add a footnote section title, but this approach is limited -- as you noted on the mailing list.

Thanks.

ousia commented 8 years ago

@samueldodson, I agree with you.

Pseudo-elements and pseudo-classes don’t work in Adobe Reader Mobile (what all e-ink reader devices use).

I opened an issue a while ago (#1720) to be able to title the footnote section and to place it. This would also help not to split footnotes in ePub documents (#1259).

This functionality was added for references. Unfortunately, it hasn’t been enabled for footnotes yet.

van-de-bugger commented 1 year ago

+1.

I faced this problem recently and didn't find a good solution.

I tried naive approach — adding a heading at the end of the Markdown document, e. g.:

## Footnotes

However, it generates dirty HTML code:

<section id="footnotes">
    <h2>Footnotes</h2>
</section>
<section id="footnotes" class="footnotes footnotes-end-of-document" role="doc-endnotes">
    <hr />
    <ol>
    ...
    </ol>
</section>

Note that hand-made "Footnotes" section is empty, and both sections have the same id. I can avoid id duplication by setting the id manually:

## Footnotes {#xxx}

but anyway it looks ugly in both Markdown and HTML.

I also tried to use filter with no success. In AST there is no such entity — section "Footnotes", all I have is just footnotes scattered here and there. Since there is no section "Footnote", I can't fix its heading. Section "Footnotes" appears only in HTML writer, after filter.

So, specifying Footnotes section heading in metadata would be nice.

ousia commented 1 year ago

@van-de-bugger,

I would say that duplicate identifier generation may be a bug (at least, pandoc should avoid generating the same identifier twice for the same XML document).

My guess is that pandoc doesn’t check for duplicated identifiers against elements such as footnotes (that come directly from the writer).

Some time ago, I wrote a proposal (#1720) to place footnotes (wherever desired in the document). This also included a way to avoid hardcoding the Footnotes title (such as it happens with ePub files).

Maybe it might be useful to add a comment there.

Just in case it might help.

jgm commented 1 year ago

8770 is a pull request that fixes the duplicate identifier bug. It is nearly ready to merge -- the author was going to add some tests but nothing has been done recently.