0

I'm trying to convert a .md file that contains the "\cancel" control sequence, but pandoc throws error due to the package "cancel" not being included.

example:

file.md

$\cancel{X+2}-\cancel{X+2}=c$

pandoc file.md -o file.pdf output

Error producing PDF.
! Undefined control sequence.
l.52 \(\cancel
1
  • You said, ... since package cancel is missing, \cancel has not been defined. You must load that package in the latex template or include it the YALM header.
    – Fran
    Mar 12 '20 at 0:06
2

You have to include the cancel package in the preamble, see https://pandoc.org/MANUAL.html#extension-yaml_metadata_block for details.

---
header-includes:
- \usepackage{cancel}
---

$\cancel{X+2}-\cancel{X+2}=c$

Then you can convert and typeset with

pandoc -f markdown -t latex -i test.md -o test.pdf

enter image description here

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.