I'm sorry if this is a bit of a pandoc question, but I'm hoping you tex users have some familiarity with latex templates within pandoc. I'm very new at this, but am excited to get a good work flow going.

I'm trying to figure out how to use latex templates with pandoc when creating a pdf from a markdown file using

pandoc file.md -o file.pdf --template=default.latex

In the command line. I got the default latex template from

pandoc -D latex > default.latex

The pandoc documentation says a bit about using templates and from what I understood, suggested to modify the default (I may very well have understood completely wrong). pandoc template documentation

My main problem is that I can't figure out how to set variables such as title, author, etc... do I do that in the default.latex file? or in the markdown file?

Thanks in advance for any suggestions or directions to some good guides.


Okay, so looks like pandoc template variables are not controlled in the LaTex template code. For reference, however, I'll mention the following:

  • Variables are set automatically by Pandoc and can be used within the template. You cannot set variables in the template. However, you can set them in the original MD source file by means of a YAML metadata block.
  • Also, "Variables may be set at the command line using the -V/--variable option".

see http://johnmacfarlane.net/pandoc/README.html#templates for more info

I guess this question can be closed as off topic.

closed as off topic by egreg, zeroth, mafp, lockstep, diabonas Mar 25 '13 at 12:16

Questions on TeX - LaTeX Stack Exchange are expected to relate to TeX, LaTeX or related typesetting systems within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Welcome to TeX.sx! I don't think there is a LaTeX question here. This seems to me more like a pandoc configuration question. Perhaps you want to try their [site](johnmacfarlane.net/pandoc/) or the pandoc git site. – hpesoj626 Mar 17 '13 at 11:31
  • 2
    This is getting voted as off topic by some users, but without further comment, which is not so helpful. Anyway, have you had a look at the discussion of the Title Block and the pandoc_title_block extension and/or the mmd_title_block? – Andrew Swann Mar 17 '13 at 11:36
  • I'm voting this as off-topic; this has nothing to do with TeX and LaTeX, I'm afraid. – egreg Mar 25 '13 at 11:10
  • Me too. Maybe regular SO? – zeroth Mar 25 '13 at 11:29