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 writer: Longtable Undefined control sequence #8001

Closed
nylnx opened this issue Mar 30, 2022 · 4 comments
Closed

Latex writer: Longtable Undefined control sequence #8001

nylnx opened this issue Mar 30, 2022 · 4 comments
Labels

Comments

@nylnx
Copy link

nylnx commented Mar 30, 2022

There is a bug, which happens, if you start a table-cell with parentheses inside a longtable. Something like this will be produced by the Latex writer. This is a minimal failing example not directly from Pandoc, but the longtable is a product of Pandoc. Execute it with latex.

\documentclass{article}
\usepackage{longtable,booktabs}

\begin{document}
\begin{longtable}[]{@{}c@{}}
\toprule
(something in parentheses) \\
\midrule
\endhead
\bottomrule
\end{longtable}
\end{document}

This throws an error with "Undefined control sequence..." as described on Stackexchange: "Undefined control sequence" on left parenthesis after midrule in longtable.

In my opinion there is a simple fix with putting a \relax after \midrule, \toprule and maybe others, since you never have any arguments anyway. This would prevent that error from happening.

Pandoc version: 2.16.2

@nylnx nylnx added the bug label Mar 30, 2022
@jgm
Copy link
Owner

jgm commented Mar 30, 2022

I got some bad results using \relax, but just putting () after these commands seems to work.

@jgm
Copy link
Owner

jgm commented Mar 30, 2022

Test case

% pandoc -o table.pdf
| (hi) |
|------|
| oo   |
^D

@jgm jgm closed this as completed in 5f0bfd4 Mar 30, 2022
@bollenn
Copy link

bollenn commented May 2, 2022

As commented in 5f0bfd4#commitcomment-72500256 the fix for this issue breaks the workarounds in #7421 (comment), do you have any ideas on fixing this?

@Paladnix
Copy link

Paladnix commented Aug 2, 2024

I used 2.19.2 and got () at first row after the midrule, how to deal?

As commented in 5f0bfd4#commitcomment-72500256 the fix for this issue breaks the workarounds in #7421 (comment), do you have any ideas on fixing this?

I used 2.19.2 and got () at first row after the midrule, how to deal?
image

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

4 participants