Skip to content

Figure captions are not rendered for figure* (figure star) LaTeX environment #10472

@tanhevg

Description

@tanhevg

Explain the problem.
I am trying to convert a latex document to MS Word. The document has text in two columns, and a figure spanning entire page width. I am using the figure* environment, as recommended by this SO post. The two column layout is lost in the Word document, which is fine. The figure caption is also missing, which is not fine.

Here is an MWE, with markdown instead of Word.

Save the following snippet as figure_star.tex:

\begin{figure*}
\includegraphics[width=0.8\textwidth]{figure.png}
\caption{This is a figure}
\label{fig:fig1}
\end{figure*}

and run

pandoc -f latex -t markdown figure_star.tex

I get:

::: figure*
![image](figure.png){width="80%"}
:::

Note alt text=image in the output.

Compare this to saving the following snippet as figure.tex

\begin{figure}
\includegraphics[width=0.8\textwidth]{figure.png}
\caption{This is a figure}
\label{fig:fig1}
\end{figure}

and running

pandoc -f latex -t markdown figure.tex

The output now is

![This is a figure](figure.png){#fig:fig1 width="80%"}

The alt text is correct.

Pandoc version?
v3.6 on MacOS Sonoma, Apple M2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions