pandoc icon indicating copy to clipboard operation
pandoc copied to clipboard

Using captions on math figures (LaTeX)

Open ErroneousBosch opened this issue 2 years ago • 2 comments

Describe the bug Using the Captions package in LaTeX, captions may be added to math figures using the folloing kinds of syntax:

\[ F9X=x\int_{t=0}^\infty g(x) dx \]
\captionof{figure}{Equation one}
\begin{figure}
  \[ F9X=x\int_{t=0}^\infty g(x) dx \]
  \caption{Equation three}
\end{figure}

PanDoc discards this information completely:

Screenshot from 2022-06-22 14-26-28

Which in other utilities is rendered below the figure in a PDF (source: OverLeaf):

Screenshot from 2022-06-22 14-24-55

Using a caption here is very useful in PDF, and could be used as alt text for MarkDown and HTML instead of just the equation in LaTeX as is seen now.

  • PanDoc 2.5 for Linux

ErroneousBosch avatar Jun 23 '22 12:06 ErroneousBosch

This might have to wait until we have native figure elements in pandoc's AST: https://github.com/jgm/pandoc/issues/3177

btw. if you're going from LaTeX to PDF, no need to use pandoc, just use pdflatex directly...

mb21 avatar Jun 24 '22 11:06 mb21

I'm actually looking at LaTeX -> ePub/HTML, but Kindle support for MathML is terrible. In any case, the loss of this caption information is not great.

ErroneousBosch avatar Jun 24 '22 17:06 ErroneousBosch