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

Merged table head cell has wrong width with pandoc 3.1.2 #8831

Closed
zwz opened this issue May 8, 2023 · 1 comment
Closed

Merged table head cell has wrong width with pandoc 3.1.2 #8831

zwz opened this issue May 8, 2023 · 1 comment
Labels

Comments

@zwz
Copy link

zwz commented May 8, 2023

Here is an MWE:

<table><thead><tr><th colspan="2" align="center">long text in a merged table header cell</th></tr></thead><tbody><tr><td align="center">1</td><td align="center">first line</td></tr><tr><td align="center">2</td><td align="center"></td></tr></tbody></table>

the resulting latex output:

\begin{longtable}[]{@{}cc@{}}
\toprule\noalign{}
\multicolumn{2}{@{}>{\centering\arraybackslash}p{(\columnwidth - 2\tabcolsep) * \real{0.0000} + 2\tabcolsep}@{}}{%
long text in a merged table header cell} \\
\midrule\noalign{}
\endhead
\bottomrule\noalign{}
\endlastfoot
1 & first line \\
2 & \\
\end{longtable}

The width (\columnwidth - 2\tabcolsep) * \real{0.0000} + 2\tabcolsep makes the head cell very narrow.

Before updating to pandoc 3.1.2, I have pandoc 2.12. It has no such issue.

@zwz zwz added the bug label May 8, 2023
jgm added a commit that referenced this issue May 8, 2023
This should help with #8831.  I'm not sure this is the
best solution, but it's certainly better than what we had before!
@jgm jgm closed this as completed in 05ad84a May 8, 2023
@jgm
Copy link
Owner

jgm commented May 8, 2023

@tarleb you may want to have a look at my fix for this.
It seems to do the right thing in various tests, but further testing might reveal something I missed.

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

2 participants