I am in the process of converting a tex document to html using pandoc and the xnos filters, and I am facing several issues with figures/tables caption and numbering.
So I tried to convert my tex file using:
pandoc --filter pandoc-xnos --mathjax manual.tex --bibliography full-biblio.bib --wrap=none --default-image-extension=png -o manual.html
[EDIT] The results are strictly the same without the xnos filters:
pandoc --mathjax manual.tex --bibliography full-biblio.bib --wrap=none --default-image-extension=png -o manual.html
Therefore this is a pandoc related problem only [/EDIT]
Then I face 2 issues:
- Figure ref are found and numbered in the document, only and only if, the reference appears after that the figure was inserted, note in the HTML data the [my_img] in the first example and the [1.0] in the second one:
Figure \ref{my_img} presents some information.
\begin{figure}[!h]
\hypertarget{my_img}{
\begin{center}
\includegraphics*[width=23cm, keepaspectratio=true]{my-image}
\caption{My legend}\label{overview}
\end{center}}
\end{figure}
Is converted in:
<p>[Fig. <a href="#my_img" data-reference-type="ref" data-reference="my_img">my_img</a>-a] presents some information.</p>
<div id="my_img">
<div align="center">
<figure>
<img src="my-image.png" id="overview" style="width:23cm" alt="My legend" />
<figcaption aria-hidden="true">My legend</figcaption>
</figure>
</div>
</div>
Whereas:
\begin{figure}[!h]
\hypertarget{my_img}{
\begin{center}
\includegraphics*[width=23cm, keepaspectratio=true]{my-image}
\caption{My legend}\label{overview}
\end{center}}
\end{figure}
Figure \ref{my_img} presents some information.
Is converted in:
<div id="my_img">
<div align="center">
<figure>
<img src="my-image.png" id="overview" style="width:23cm" alt="My legend" />
<figcaption aria-hidden="true">My legend</figcaption>
</figure>
</div>
</div>
<p>[Fig. <a href="#my_img" data-reference-type="ref" data-reference="my_img">1.0</a>-a] presents some information.</p>
- The caption never show numbers, actually the beginning part of the caption, that should be "Figure #num:" (or something close) is always missing (just see above).
Any help to understand what I am doing wrong or missing would be really appreciated.
Best regards.