Skip to content

Issues when converting "*.tex" to "*.html" #97

@Slookeur

Description

@Slookeur

Dear @tomduck ,
first of all thank you for your pandoc-xnos tools.
I am in the process of converting a tex document to html, and I am facing several issues with figures caption and numbering,
however I must confess that I am not sure that this is the most appropriate place to report them, although in that case I am
pretty sure that you could point me towards the appropriate direction ;-)
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

Then I face 2 issues:

  1. Figure ref are found and number 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>
  1. 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).

Thanks in advance for your help.
Best regards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions