You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am converting LaTeX to reStructuredText (RST) using pandoc, but am having trouble with figures (images with captions and usually citable labels).
Sample from larger LaTeX document,
Here are my attempts at UML class diagrams for the \verb|Blast| and \verb|PSIBlast| record classes. If you are good at UML and see mistakes/improvements that can be made, please let me know. The Blast class diagram is shown in Figure~\ref{fig:blastrecord}.
\begin{figure}[htbp]
\includegraphics[width=0.8\textwidth]{images/BlastRecord.png}
\caption{Class diagram for the Blast Record class representing all of the info in a BLAST report}
\label{fig:blastrecord}
\end{figure}
The PSIBlast record object is similar, but has support for the rounds that are used in the iteration steps of PSIBlast. The class diagram for PSIBlast is shown in Figure~\ref{fig:psiblastrecord}.
\begin{figure}[htbp]
\includegraphics[width=0.8\textwidth]{images/PSIBlastRecord.png}
\caption{Class diagram for the PSIBlast Record class.}
\label{fig:psiblastrecord}
\end{figure}
Save this as snippet.tex and then convert to markdown (as an example):
$ pandoc -f latex -t markdown snippet.texHere are my attempts at UML class diagrams for the `Blast` and`PSIBlast` record classes. If you are good at UML and seemistakes/improvements that can be made, please let me know. The Blastclass diagram is shown inFigure [1](#fig:blastrecord){reference-type="ref"reference="fig:blastrecord"}.![Class diagram for the Blast Record class representing all of the infoin a BLAST report](images/BlastRecord.png){#fig:blastrecord width="80%"}The PSIBlast record object is similar, but has support for the roundsthat are used in the iteration steps of PSIBlast. The class diagram forPSIBlast is shown inFigure [2](#fig:psiblastrecord){reference-type="ref"reference="fig:psiblastrecord"}.
Notice the figure labels and caption text is preserved. But not for RST output:
$ pandoc -f latex -t rst snippet.tex --verboseHere are my attempts at UML class diagrams for the ``Blast`` and``PSIBlast`` record classes. If you are good at UML and seemistakes/improvements that can be made, please let me know. The Blasthttps://docutils.sourceforge.io/docs/ref/rst/directives.html#figureclass diagram is shown in Figure `1 <#fig:blastrecord>`__... figure:: images/BlastRecord.png :alt: :width: 80.0%The PSIBlast record object is similar, but has support for the roundsthat are used in the iteration steps of PSIBlast. The class diagram forPSIBlast is shown in Figure `2 <#fig:psiblastrecord>`__... figure:: images/PSIBlastRecord.png :alt: :width: 80.0%
Notice the figures are missing their captions and name (so the references fail).
I was expecting the figure caption to be used as the caption, with the label used for :name: as per:
Note #8743 covers the :alt: field, fixed in pandoc 3.1.4.
Issue #8871 is somewhat related (mixing the alt-text and caption)
Pandoc version?
This is using the latest pandoc available via conda for Linux (so a revision behind the current release 3.1.4), run under Ubuntu on WSL under Windows 11:
$ pandoc --versionpandoc 3.1.3Features: +server +luaScripting engine: Lua 5.4User data directory: /home/pcock/.local/share/pandocCopyright (C) 2006-2023 John MacFarlane. Web: https://pandoc.orgThis is free software; see the source for copying conditions. There is nowarranty, not even for merchantability or fitness for a particular purpose.
The text was updated successfully, but these errors were encountered:
This appears to have been working better under pandoc 2.14.1 and 2.19.2, here run under macOS:
$ pandoc -f latex -t rst snippet.tex --verbose
ere are my attempts at UML class diagrams for the ``Blast`` and
``PSIBlast`` record classes. If you are good at UML and see
mistakes/improvements that can be made, please let me know. The Blast
class diagram is shown in Figure `1 <#fig:blastrecord>`__.
.. figure:: images/BlastRecord.png
:alt: Class diagram for the Blast Record class representing all of
the info in a BLAST report
:name: fig:blastrecord
:width: 80.0%
Class diagram for the Blast Record class representing all of the info
in a BLAST report
The PSIBlast record object is similar, but has support for the rounds
that are used in the iteration steps of PSIBlast. The class diagram for
PSIBlast is shown in Figure `2 <#fig:psiblastrecord>`__.
.. figure:: images/PSIBlastRecord.png
:alt: Class diagram for the PSIBlast Record class.
:name: fig:psiblastrecord
:width: 80.0%
Class diagram for the PSIBlast Record class.
It was noted in the comments on #8743 that the loss of the :alt: field was a regression too, possibly the same root cause?
Explain the problem.
I am converting LaTeX to reStructuredText (RST) using pandoc, but am having trouble with figures (images with captions and usually citable labels).
Sample from larger LaTeX document,
Save this as
snippet.tex
and then convert to markdown (as an example):Notice the figure labels and caption text is preserved. But not for RST output:
Notice the figures are missing their captions and name (so the references fail).
I was expecting the figure caption to be used as the caption, with the label used for
:name:
as per:https://docutils.sourceforge.io/docs/ref/rst/directives.html#figure
https://docutils.sourceforge.io/docs/ref/rst/directives.html#common-options
Note #8743 covers the
:alt:
field, fixed in pandoc 3.1.4.Issue #8871 is somewhat related (mixing the alt-text and caption)
Pandoc version?
This is using the latest pandoc available via conda for Linux (so a revision behind the current release 3.1.4), run under Ubuntu on WSL under Windows 11:
The text was updated successfully, but these errors were encountered: