Trylks Trylks - 2 months ago 21x
Markdown Question

Pandoc, Markdown to Doc, how to use variables?

AFAIK, variables can be defined in a YAML external file or inside the Markdown file in a header.

Then they can be used in the document. I have found examples with two different sytaxes:

  • $variable$
    will convert variable to math mode, which is great (i.e. I want to keep that behaviour).

  • #{variable}
    does nothing.


  • Is it possible to use variables in the pandoc conversion from markdown to .docx?

  • If so, how?


Pandoc variables can only be used in pandoc templates, not the document itself. For that you should check out a preprocessor like gpp or similar.