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

Fails on LaTeX input with environments within captions #5994

Open
ning-y opened this issue Dec 17, 2019 · 4 comments
Open

Fails on LaTeX input with environments within captions #5994

ning-y opened this issue Dec 17, 2019 · 4 comments

Comments

@ning-y
Copy link

ning-y commented Dec 17, 2019

Reporting a bug?

pandoc 2.2.2.1
Compiled with pandoc-types 1.17.5.1, texmath 0.11.0.1, skylighting 0.7.2

MWE

\documentclass[a4paper]{article}
\usepackage[inline]{enumitem}

\begin{document}
\begin{figure}
  \caption[]{\begin{enumerate*}\item A caption.\end{enumerate*}}
\end{figure}
\end{document}

Command used

pandoc mwe.tex --output mwe.docx

Error message

Error at "source" (line 6, column 14):
unexpected \begin
  \caption[]{\begin{enumerate*}\item A caption.\end{enumerate*}}
@jgm
Copy link
Owner

jgm commented Dec 17, 2019

Pandoc's document model can't currently represent block-level content (e.g. lists) as figure captions. Best we could do now would be to collapse this somehow to inline text.

@ning-y
Copy link
Author

ning-y commented Dec 22, 2019

Perhaps a note for others coming across this issue: the enumerate* environment of enumitem creates an inline list, so "collapsing this somehow to inline text" is extremely reasonable.

@caniko
Copy link

caniko commented Sep 29, 2020

Pandoc's document model can't currently represent block-level content (e.g. lists) as figure captions. Best we could do now would be to collapse this somehow to inline text.

Why not place the text in a text box that has the same width as the figure?

@jgm
Copy link
Owner

jgm commented Sep 29, 2020

Why not place the text in a text box that has the same width as the figure?

The document model has no concept of text boxes with widths, either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants