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

[LaTeX Output] Para Image in a Table Cell #3836

Closed
ickc opened this issue Aug 6, 2017 · 1 comment
Closed

[LaTeX Output] Para Image in a Table Cell #3836

ickc opened this issue Aug 6, 2017 · 1 comment

Comments

@ickc
Copy link
Contributor

ickc commented Aug 6, 2017

MWE

source: test3.zip

which contain a markdown with a dummy image:

+-------+-----------------------+
| text  | this is a text        |
+=======+=======================+
| image | ![caption](./png.png) |
|       |                       |
|       | this force a para     |
+-------+-----------------------+

Command used: pandoc test3.md -o test3.pdf

Error:

! Misplaced \noalign.
\caption ->\noalign 
                    \bgroup \@ifnextchar [{\egroup \LT@c@ption \@firstofone ...
l.86 \caption

pandoc: Error producing PDF

Version: pandoc 1.19.1, and pandoc-nightly with commit 685788c, both on macOS platform.

Diagnosis

The problem only occur when the table cell containing the image is a "Para" cell. If the line "this force a para" is removed, it will be ok.

By comparing the TeX output with and without the "this force a para" line, the only difference is how the minipage ends:

\begin{minipage}[t]{0.48\columnwidth}\raggedright\strut
image\strut
\end{minipage} & \begin{minipage}[t]{0.48\columnwidth}\raggedright\strut
\begin{figure}
\centering
\includegraphics{./png.png}
\caption{caption}
\end{figure}

this force a para\strut
\end{minipage}

And LaTeX doesn't like the extra line between the \end{figure} and \end{minipage}.

Note: this traced from an issue in ickc/pantable#20

@jgm
Copy link
Owner

jgm commented Aug 7, 2017 via email

@jgm jgm closed this as completed in 3504915 Aug 7, 2017
K4zuki added a commit to K4zuki/pandoc_misc that referenced this issue Aug 13, 2017
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