[Tex/LaTex] Pass LaTeX options with Pandoc

markdownpandoc

I use the package "answers" in a Markdown file. After compilation with Pandoc the PDF I get is ok (solutions at the right place) but the option of the following LaTeX command \Optionsolutionfile{ans}[ex1] produces the writing of [ex1]. How to avoid that?

I precise that there are two series of exercises in my document and each series is followed by the solutions.

That's why I use \Optionsolutionfile{ans}[ex1] and then \Optionsolutionfile{ans}[ex2] at another place.

Thanks in advance

Best Answer

Pandoc doesn't like the option in brackets after the latex command. In order to make it work you have to use a recent version of pandoc that supports generic raw attributes. Now you can create a raw latex block around the offending command:

```{=latex}
\Opensolutionfile{ans}[ex1] 
```

Or inline:

`\Opensolutionfile{ans}[ans1]`{=latex}
Related Question