[Tex/LaTex] Tables missing when I convert latex file to html or docx

pandoctables

I use the latest version of pandoc. and I want to convert a .tex file to .docx. But everything works well except that several tables are not converted. The original symbols are shown on the converted file, like "xxx & xxx & xxx''. I tried to convert it to .html instead but it has the same problem.

I am not a frequent pandoc user. Can someone help me out?

Here is part of the original file:

\begin{longtable}{ p{12cm} r }
Statement & XXX \\
\hline

line 1 & 100\% \\
line 2 & 100\% \\
line 3 & 88\% \\

\end{longtable}

It works well in typesetting. No errors shown. I then use this pandoc command:

pandoc -s teaching\ p.tex -o 2.html

It shows:

p12cm r Statement & XXX

line 1 & 100%

line 2 & 100%

line 3 & 88%

Thanks.

Best Answer

Old question, but in case someone find the same dificulties.

You are simply using the wrong pandoc command. Here is a (malformed) MWE:

\begin{longtable}{ p{12cm} r }
Statement & XXX \\
\hline

line 1 & 100\% \\
line 2 & 100\% \\
line 3 & 88\% \\

\end{longtable}

Save it in a file named document.tex and render it with pandoc document.tex -f latex -t docx -o document.docx or with pandoc document.tex -f latex -t html -o document.html. It works fine.