2

I would like to use a LaTeX command in a markdown file. In the markdown file I add

\mycommand[options]{something}

when pandoc renders the markdown file to TeX it becomes

\mycommand{[}options{]}{something}

How can I prevent that from happening?

1 Answer 1

1

Works for me with pandoc 1.17.2:

$ echo '\mycommand[options]{something}' | pandoc -t latex

\mycommand[options]{something}
4
  • 1
    Using the latex code above I get the same results, but please try a more specific latex sequence, such as \twocolumnn[\section{test}\label{test}]{something}. The problem appears to be peculiar to \section.
    – acspike
    Mar 3, 2017 at 21:26
  • @acspike again, your input works for me with pandoc 1.19.2.1
    – mb21
    Mar 3, 2017 at 21:38
  • I can confirm this. Thierry's latex snippet works in both pandoc 1.17.2 and 1.19.2.1. My latex snippet behaves as described by Thierry in 1.17.2 but works in 1.19.2.1. Thanks @mb21!
    – acspike
    Mar 4, 2017 at 12:18
  • With pandoc 2.2.3.2, I find that this exact example works. However, echo '\Volcite{1}[25]{citekey}' | pandoc -f markdown -t latex returns \Volcite{1}{[}25{]}\{citekey\}. Is there a way to make it return \Volcite{1}[25]{citekey}? Sep 3, 2018 at 14:20

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.