【发布时间】:2020-06-24 14:32:30
【问题描述】:
我使用 pandoc 将我的 Latex 文档转换为 word 文档。
我的大多数表格都有多列。包含跨多列的单元格的行没有出现在我的最终 Word 文档中,我真的不明白为什么。
这里有一些 LaTeX 示例代码:
\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}
带有\multicolumn的行在word文档中是空的(同样,没有水平线)。
有没有办法允许乳胶表中的多列并让 pandoc 将这些包含在生成的 word 文档中?
为了完整起见,我的 Mac 终端代码将其从 Latex 转换为 word:
pandoc -o foo.docx foo.tex
【问题讨论】: