Trylks Trylks - 1 year ago 243
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?

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download