66

I was converting 'lecture1.md' file I made via Rstudio into 'lecture1.pdf' using Pandoc at Mac Terminal.

and I got this error message :

! Undefined control sequence.
<recently read> \tightlist 

l.213 \end{frame}

pandoc: Error producing PDF from TeX source
make: *** [lecture1.pdf] Error 43

What's strange thing is the same procedure with same files works with my colleague's computer.

Anyone's any comments would be helpful, and I'd appreciate them.

inmybrain
  • 772
  • 1
  • 5
  • 8

3 Answers3

82

The writer.latex file in Pandoc's source code currently defines \tightlist as:

\providecommand{\tightlist}{%
  \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}

This is also currently the case in the default LaTeX template, from the jgm/pandoc-templates project on Github.

For posterity, here is a link to the most up-to-date LaTeX default template:

  • 3
    The \tightlist problem seems to arise only when using - to build the list, and not when using *. (Tested with pandoc 1.17.0.3, used through R Markdown in RStudio on Mac OS X.) – Fr. Jun 17 '17 at 18:21
  • 2
    @Fr. \tightllist appears when using * too (pandoc 2.7.3). – jadelord Jul 30 '19 at 19:21
30

I hit the same problem. It seems that pandoc started using \tightlist in \begin{itemize} sections.

My workaround was simply to add an empty macro for \tightlist to my template file (I run pandoc with --template=mytemplate.tex):

\def\tightlist{}

18

Pandoc doesn't use \tightlist if you leave a blank line between each item, e.g.

- one

- two

versus

- one
- two

The same is true for enumerated lists. This is the LaTeX version of "loose" and "compact" lists documented here: http://pandoc.org/MANUAL.html#lists (h/t mb21).