1

this markdown document:

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

# test

Hello.

\textcolor{green}{green}

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:

```sh
hello
```

then pandoc is happy.

What's going on here ?

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

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: |
        \usepackage{xcolor}
| 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.