Reputation: 11
I use pandoc to convert my latex documents into word documents.
Most of my tables have multicolumns. Rows with cells across multiple columns don't appear in my final word document and I don't really understand why.
Here some LaTeX example code:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{enumerate}
\usepackage[ngerman,british]{babel}
\usepackage{amsfonts,amssymb, mathtools}
\usepackage{bm}
\usepackage{graphicx}
\usepackage{tabularx}
\usepackage{longtable}
\usepackage{booktabs}
\begin{document}
Here the table:
\begin{table}[tbp] \centering
\caption{Test table}
\begin{tabularx}{\textwidth}{XXXXX}
\toprule
& \multicolumn{2}{l}{\emph{Cat 1}} & \multicolumn{2}{l}{\emph{Cat 2}} \\
\addlinespace
Data & Estimate & Standard error & Estimate & Standard error\\
\cmidrule(){1-1} \cmidrule(l){2-3} \cmidrule(l){4-5}
Group all & -0.009 & 0.008 & -0.008 & 0.008\\
\addlinespace
Group A & -0.009 & 0.011 & -0.001 & 0.009\\
Group B & -0.010 & 0.011 & -0.016 & 0.013\\
\bottomrule
\multicolumn{5}{l}{${*}$ \emph{p} < 0.1, ${*}{*}$ \emph{p} < 0.05, ${*}{*}{*}$ \emph{p} < 0.01}
\end{tabularx}
\vspace{0.5em}
\parbox{.9\textwidth}{\raggedright \emph{%
Notes:
Some notes.
} }
\end{table}
\end{document}
The lines with \multicolumn in them are empty in the word document (also, no horizontal lines).
Is there a way to allow for multicolumn in latex tables and have pandoc include these in the resulting word document?
For completeness, my Mac terminal code to transform it from latex to word:
pandoc -o foo.docx foo.tex
Upvotes: 1
Views: 1919
Reputation: 22609
Pandoc, as of June 2020, does not support multicolumn tables in LaTeX. See this issue for details.
Upvotes: 2