
例えば、単純なLaTeXテーブルをPandocに入力すると、
\begin{table}[h!]
\begin{tabular}{ll}
x&y\\
\end{tabular}
\caption{A caption}
\end{table}
そしてそれをHTMLに変換するには
pandoc -s table.tex -o table.html
結果の表にはキャプションが表示されません (さらに、表の配置のためだけの文字 '[h!]' も出力されます)。
<p>[h!]</p>
<table>
<tbody>
<tr class="odd">
<td align="left">x</td>
<td align="left">y</td>
</tr>
</tbody>
</table>
pandoc を別の方法で実行する必要がありますか? 私は Mac OS X 10.6.8 で pandoc バージョン 1.12.3 を使用しています。以前のバージョンの Pandoc (1.9 だったと思います) では、キャプションは HTML で正常にレンダリングされていました。
答え1
この問題は Pandoc の新しいバージョンで解決されました (cf.このコミットOPのチケットに従ってgithubで) より古いバージョンでは1.12.4
この問題は修正されるはずです。
例えば、pandoc 1.12.4.2(texmath 0.6.6.1、highlighting-kate 0.5.8.5でコンパイル)の場合、次のコード
\documentclass{article}
\begin{document}
\begin{table}[h!]
\begin{tabular}{ll}
x&y\\
\end{tabular}
\caption{A caption}
\end{table}
\end{document}
生産する
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="generator" content="pandoc" />
<title></title>
<style type="text/css">code{white-space: pre;}</style>
</head>
<body>
<table>
<caption>A caption</caption>
<tbody>
<tr class="odd">
<td align="left">x</td>
<td align="left">y</td>
</tr>
</tbody>
</table>
</body>
</html>
これは次のように表示されます
でコンパイルした場合pandoc -s table.tex -o table.html
。