YAML metadata is not passed to pandoc as arguments, but as variables. When you call pandoc on your MWE, it does not produce this:
pandoc -o guide.pdf articheck_guide.md --toc --number-sections
as we think. rather, it calls:
pandoc -o guide.pdf articheck_guide.md -V toc:yes -V number-sections:yes
Why are you doing MWE current? Since the latex pattern uses the toc variable by default:
~$ pandoc -D latex | grep toc $if(toc)$ \setcounter{tocdepth}{$toc-depth$}
Therefore, setting toc to any value should contain a table of contents, at least at the exit from latex. There are no number-sections variables in this template, so this does not work. However, there is a numbersections variable:
~$ pandoc -D latex | grep number $if(numbersections)$
Setting numbersections to any value will result in numbering in the output latex with the default template
--- title: My Title toc: yes numbersections: yes ---
The problem with this solution is that it only works with some output format. It seemed to me that I read somewhere on the pandoc mailing list that soon we will be able to use the metadata in YAML blocks as intended (i.e. as arguments, not variables), but I can no longer find them, so maybe This will happen very soon.
scoa
source share