Hi, I use to Pandoc to convert a large number of LaTeX articles into Markdown, with the original LaTeX articles all from different authors with their own idiosyncratic styles. I've been trying to narrow down some of the conversion issues that have cropped up, and I noticed that the LaTeX reader seems to be very particular about how elements in float (table, figure) environments are ordered. For LaTeX, `\label` normally has to be either inside `\caption` or after `\caption`. As far as I know, however, there is no requirement that `\label` (if appearing after and not inside) appear *immediately* after `\caption`. For example, I can get the following (with `\label` *not* immediately after `\caption`) to compile without any errors or warnings: ``` \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{graphicx} \begin{document} \section{Introduction} The model is shown in Figure \ref{fig:sensPlot}. \begin{figure} \caption{Dependence on Prior Settings} \includegraphics[width=0.7\textwidth]{figures/sensPlot-1.pdf} \label{fig:sensPlot} \end{figure} \end{document} ``` However, when I run Pandoc 2.19.2 to convert this to Markdown, the figure is not processed correctly (the cross-reference appears as [fig:sensPlot] instead of 1, and the caption disappears): ``` # Introduction The model is shown in Figure [\[fig:sensPlot\]](#fig:sensPlot){reference-type="ref" reference="fig:sensPlot"}. ![image](figures/sensPlot-1.pdf){width="70%"} []{#fig:sensPlot label="fig:sensPlot"} ``` Running `pandoc -t native`, it looks like the label is getting separated from the rest of the figure: ``` [ Header 1 ( "introduction" , [] , [] ) [ Str "Introduction" ] , Para [ Str "The" , Space , Str "model" , Space , Str "is" , Space , Str "shown" , Space , Str "in" , Space , Str "Figure" , Space , Link ( "" , [] , [ ( "reference-type" , "ref" ) , ( "reference" , "fig:sensPlot" ) ] ) [ Str "[fig:sensPlot]" ] ( "#fig:sensPlot" , "" ) , Str "." ] , Para [ Image ( "" , [] , [ ( "width" , "70%" ) ] ) [ Str "image" ] ( "figures/sensPlot-1.pdf" , "" ) , SoftBreak , Span ( "fig:sensPlot" , [] , [ ( "label" , "fig:sensPlot" ) ] ) [] ] ] ``` Note that this can be fixed by (1) moving `\label` into `\caption`, (2) switching `\includegraphics` and `\label`, or (3) switching `\caption` and `\includegraphics`. So it definitely seems like an order issue. What am I missing? Is this a bug? Thank you in advance. -- You received this message because you are subscribed to the Google Groups "pandoc-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/b31d021f-ce8b-4c2e-b2bd-ad9d65a68606n%40googlegroups.com.