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

[LaTeX writer] Footnotes don't work in definition list headers #8240

Open
Siphalor opened this issue Aug 22, 2022 · 0 comments
Open

[LaTeX writer] Footnotes don't work in definition list headers #8240

Siphalor opened this issue Aug 22, 2022 · 0 comments

Comments

@Siphalor
Copy link
Contributor

> pandoc --version
pandoc 2.19.1
Compiled with pandoc-types 1.22.2.1, texmath 0.12.5.2, skylighting 0.13,
citeproc 0.8.0.1, ipynb 0.2, hslua 2.2.1
Scripting engine: Lua 5.4

First off, this is about an edge case in LaTeX.
I fear that solving this edge case in Pandoc will require some serious work, so I don't expect this to be fixed soon.
This issue is therefor more of a tracking issue, maybe accumulating further workarounds in the future.
In the meantime, it may be appropriate for Pandoc to issue a warning/error message in these cases.

Go to workaround section


The LaTeX writer currently inlines all footnotes using \footnote{<footnotetext}.
This doesn't work correctly in \item[<text>] declarations though.
In these cases only, the footnote mark will be rendered, not the footnote itself.

An input Markdown document of

Header[^fn]:
:    Some other text.

[^fn]: A footnote.

produces the following LaTeX:

\begin{description}
\tightlist
\item[Header\footnote{A footnote.}:]
Some other text.
\end{description}

Which produces the following PDF output:

Header¹: Some other text.

Workarounds/Solutions

A discussion of solutions can be found on StackExchange.
The more complete fixes require additional packages and are really not trivial to solve.

A simple workaround for single footnotes that are only used once (referencing footnotes multiple times isn't supported in Pandoc anyway), is to use \footnotemark{} and \footnotetext{<text>} as in the following example:

Header\footnotemark{}:
:    \footnotetext{A footnote}
    Some other text.

which will render to the following LaTeX:

\begin{description}
\item[Header\footnotemark{}:]
\footnotetext{A footnote}

Some other text.
\end{description}

This obviously won't work for multiple footnotes in the same heading.
If this hacky solution is acceptable, I'd probably be able to create a pull request for this behavior.

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

No branches or pull requests

1 participant