Skip to content

Converting from latex to rst doesn't parse booktabs tables correctly #2307

Closed
camillescott opened this Issue · 0 comments

1 participant

@camillescott

When converting from latex to rst (or markdown, html, etc), some table syntax doesn't convert correctly. For example, the following latex:

\documentclass{article}
\usepackage{booktabs}

\begin{document}
\begin{table}
\caption {Proportion of Annotations Covered}
\begin{center}

\begin{tabular}{lrr}
\toprule
{} &    lamp00 &    lamp10 \\
\midrule
CDS         &  0.919196 &  0.789203 \\
UTR         &  0.957400 &  0.838308 \\
exon        &  0.896246 &  0.780100 \\
gene        &  0.051323 &  0.128880 \\
start\_codon &  0.960101 &  0.857505 \\
stop\_codon  &  0.636520 &  0.903922 \\
transcript  &  0.048511 &  0.120501 \\
\bottomrule
\end{tabular}
\end{center}
\end{table}
\end{document}

Gives the following rst:

| lrr & lamp00 & lamp10
| CDS & 0.919196 & 0.789203
| UTR & 0.957400 & 0.838308
| exon & 0.896246 & 0.780100
| gene & 0.051323 & 0.128880
| start\_codon & 0.960101 & 0.857505
| stop\_codon & 0.636520 & 0.903922
| transcript & 0.048511 & 0.120501

Removing the \*rule commands produces proper rst tables. I searched extensively, but couldn't find a similar issue; can this be fixed with a custom template, or is it a bug? The use-case here is keeping around an rst version of the file for easy viewing on github, while doing the primary writing in latex.

@jgm jgm added a commit that closed this issue
@jgm LaTeX reader: properly handle booktabs lines.
Lines aren't part of the pandoc table model, but we can just
ignore them.

Closes #2307.
f6ad9e2
@jgm jgm closed this in f6ad9e2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.