Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
tanhevg opened this issue Dec 18, 2024 · 0 comments
Closed
Labels

Comments

@tanhevg
Copy link

tanhevg commented Dec 18, 2024

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

@tanhevg tanhevg added the bug label Dec 18, 2024
@jgm jgm closed this as completed in 669c2b8 Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant