this markdown document:

author: Benoît
toc: true
papersize: a4
pagenumbering: true

# test



makes pandoc --from=markdown foo.md -o foo.pdf fail and output:

Error producing PDF.
! Undefined control sequence.
l.70 \textcolor

However, if I include at the end of the document a simple:


then pandoc is happy.

What's going on here ?

  • Which version of pandoc are you using? With pandoc there are no errors. – DG' Feb 9 at 17:19
  • pandoc 2.5 Compiled with pandoc-types, texmath, skylighting 0.7.7 – Benoît Feb 13 at 20:10

Ok, i think that xcolors is only included when some features are used, like code verbatim.

Adding this in header solves the problem:

header-includes: |
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.