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
Pandoc 1.17's TeX writer uses image attributes to introduce figure labels. Unfortunately, the TeX being written is fundamentally incorrect, and this breaks referencing -- the reason why labels exist.
Here is a basic demo file (reftest.md):
![A big dot.](dot.png){#fig-1}
This is a reference to Figure \ref{fig-1}.
Compile it as follows (you will need to provide your own dot.png):
$ pandoc reftest.md -o reftest.pdf
View reftest.pdf and notice that the Figure number is missing in the reference. A look at the generated TeX ($ pandoc reftest.md -o reftest.tex) shows why:
\begin{figure}[htbp]
\centering
\includegraphics{dot.png}
\caption{A big dot.}
\end{figure}
\label{fig-1}
This is a reference to Figure \ref{fig-1}.
The \label should be inside the figure environment, and preferably in the \caption. It does not work at all when written outside of thefigure environment.
I believe this was the patch that introduced the bug.
The text was updated successfully, but these errors were encountered:
Partially addresses #2813.
This isn't perfect, because now the hypertarget is in the
wrong place -- when you link to the figure, the screen
is positioned with the caption at the top, and most of
the figure off screen.
So this needs a bit more tweaking.
Pandoc 1.17's TeX writer uses image attributes to introduce figure labels. Unfortunately, the TeX being written is fundamentally incorrect, and this breaks referencing -- the reason why labels exist.
Here is a basic demo file (
reftest.md
):Compile it as follows (you will need to provide your own
dot.png
):View
reftest.pdf
and notice that the Figure number is missing in the reference. A look at the generated TeX ($ pandoc reftest.md -o reftest.tex
) shows why:The
\label
should be inside thefigure
environment, and preferably in the\caption
. It does not work at all when written outside of thefigure
environment.I believe this was the patch that introduced the bug.
The text was updated successfully, but these errors were encountered: