Search code examples
latexmarkdownpandocbeamer

Markdown + Pandoc + Beamer: fails to insert tables


I am using pandoc on Linux to convert a Markdown file into a pdf beamer presentation.

I am trying to insert a table using the formats found here, but I get errors:

dario@dario:pandoc presentation.markdown -s -t beamer -o presentation.pdf

pandoc: Error producing PDF from TeX source.
! Undefined control sequence.
\beamer@doifinframe ...e}[c]{@{}rllc@{}} \toprule 
                                              \addlinespace Right & Left...
l.254 \end{frame}

This is the markdown that produces the error:

| Right | Left | Default | Center |
|------:|:-----|---------|:------:|
|   12  |  12  |    12   |    12  |
|  123  |  123 |   123   |   123  |
|    1  |    1 |     1   |     1  |

I have also tried with multiline and grid tables with no luck.

I am not interested in a particular table style, just one that works easily.


Solution

  • I've found the answer at this Google groups discussion

    To fix this problem, you should either update your pandoc distribution (it's mentioned that version 1.12.3.3 is OK) or fix it's default beamer template file (for ubuntu it is /usr/share/pandoc/data/templates/default.beamer).

    To fix the style file, you should replace the line \usepackage{longtable} with the line \usepackage{longtable,booktabs} Or, of course, you can use your custom template file to avoid fixing the system files