brucemiller / LaTeXML

LaTeXML: a TeX and LaTeX to XML/HTML/ePub/MathML translator.
http://dlmf.nist.gov/LaTeXML/
Other
957 stars 101 forks source link

\footnote in \caption: \label attachment and mark #2414

Open dginev opened 2 months ago

dginev commented 2 months ago

In the minimal example:

\documentclass{article}
\begin{document}
Table \ref{tab:1} contains an overview.\footnote{outer note}

\begin{table}
\caption{Caption text.\protect\footnotemark}
\label{tab:1}
Table content
\end{table}

\footnotetext{text of in-caption footnote.}
\end{document}

The \ref should fill in as 1 and point to the ltx:table element in the XML. Instead, latexml adds the label to the ltx:note and references it.

There is a second bug worth noticing - a note added to a caption will get its mark bumped up twice, once when added to ltx:caption and once more when added to ltx:toccaption. Instead, maybe notes shouldn't be added at all to a toccaption?

This was encountered when converting a published journal article, during some contract work.

Here is the current XML:

```xml

Table contains an overview. 1 1 footnote 1 outer note

Table 1 1 Table 1 1Caption text. 2 2 footnote 2

Table content

Table 1Caption text. 3 3 footnote 3 text of in-caption footnote.
```