次のHTMLをpandoc a.html -p a.pdf
でpdfに変換すると怒られる。
<html>
<body>
<table>
<caption><img src="a.png"></caption>
<tr><td>a</td></tr>
</table>
</body>
! Use of \LT@array doesn't match its definition.
\new@ifnextchar ...served@d = #1\def \reserved@a {
#2}\def \reserved@b {#3}\f...
l.64 \caption{\includegraphics{a.png}}
pandoc: Error producing PDF
ところが、間にlatex
ファイルを明示的に挟むと怒られない。
pandoc a.html -s -t latex | pandoc -f latex -o a.pdf
pdfファイルを開く事も出来るが、キャプションのあたりに画像と共に@l@
となにやらゴミが表示される。
中間のlatexファイルを確認すると次の様になっている。
\begin{longtable}[]{@{}l@{}}
\caption{\includegraphics{a.png}}\tabularnewline
\toprule
A\tabularnewline
\bottomrule
\end{longtable}
longtable
の周りに原因と思しき{@{}l@{}}
がある。
恐らく、表示を整えるための何かをここに展開する予定だったのだろうが、なぜかゴミが残っている。
とりあえず@{}
を全て消し去ればとりあえず正しいlatexファイルが得られる。
これが直接pdfに変換する時のエラーと関係あるのかは不明。
何やらありそうな気はするが。
環境は以下の通り。
pandoc 1.17.1
Compiled with texmath 0.8.6.4, highlighting-kate 0.6.2.1.
pdfTeX 3.14159265-2.6-1.40.16 (TeX Live 2015/Arch Linux)
kpathsea version 6.2.1