pandoc의 LaTeX 테이블, 캡션

pandoc의 LaTeX 테이블, 캡션

Pandoc에 간단한 LaTeX 테이블을 입력하면, 예를 들어

\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에서 해결되었습니다(참조:이 커밋, OP 티켓에 이어깃허브에서). 이전 버전에서는 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.

관련 정보