问题是,如果你想让单元格换行,LaTeX需要明确指定列宽,所以你需要以某种方式手动指定它们(在markdown中你会do this using multiline or grid tables)。
Pandoc的HTML阅读器支持width元素的相对col属性。
pandoc -f html -t latex << EOF
>
>
>
>
>
>
>
3476896>
My first HTML>
>
>
> EOF
\begin{longtable}[c]{@{}ll@{}}
\toprule
\begin{minipage}[t]{0.09\columnwidth}\raggedright\strut
3476896
\strut\end{minipage} &
\begin{minipage}[t]{0.85\columnwidth}\raggedright\strut
My first HTML
\strut\end{minipage}\tabularnewline
\bottomrule
\end{longtable}
注意LaTeX输出中的\columnwidth。
如果您无法控制HTML,则可以编写Pandoc filter来修改文档的AST,并设置一些任意列宽,最多可达100%。也许你也应该恢复this old thread on pandoc-discuss jgm aka fiddlosopher写道:
主要原因是表格更复杂,
我们需要有关相对列宽的信息,
这是HTML文档所缺乏的。但我想我是
我们确信我们应该猜测这些。