Thanks for you answer, it is clearer to me now.
While I prefer the possibility to set every option through YAML, I see there is the possibility to set --toc on the command line and then disable for a single file with `toc: false`, which is fine to me.
(I am currently working on a workflow for scholarly journals where editors should be able to set this kind of options at paper level, in YAML metadata; I will publish documentation and code as soon as I am ready)
Meanwhile I found a probably known discrepancy with --number-sections:
with `numbersections: false` in YAML I can override the flag set on command line, but it has effect only in PDF/LaTeX, not in HTML.
Having no option in HTML template I suppose this is something not so straightforward.
Il giorno giovedì 2 novembre 2017 20:26:59 UTC+1, John MacFarlane ha scritto:
It's not enough to set 'toc', you also need to set
'table-of-contents', since this is only set by the
writer if you specify --toc on the command line.
I suppose we could change things so that table-of-contents
is populated if the 'toc' metadata field is set.
+++ Piero Grandesso [Nov 02 17 15:38 ]:
> Hi all,
> I have some problems understanding the correct behavior of the
> variables --toc and --table-of-contents.
> As per this commit[1] I would expect that I could enable the generation
> of the table of contents by simply inserting `toc: true` in my YAML
> metadata block; the table of contents should then appear in my template
> when invoked by `$table-of-contents$`. Is it correct or did I
> misunderstood something?
> If that is the desired behavior, than I think there could be a bug:
> with `toc: true` specified in my [1]example.md, the following command
> will produce an HTML file with an empty <nav> block:
> pandoc [2]example.md -s -o example.html
> to obtain a working table of contents I have to specify --toc:
> pandoc [3]example.md --toc -s -o example.html
> I am working with pandoc on linux, pandoc -v:
> pandoc 2.0.1
> Compiled with pandoc-types 1.17.2, texmath 0.9.4.4, skylighting 0.4.2
> Thanks,
> Piero
> [1]:
> [4]https://github.com/jgm/pandoc/commit/75f4e41d7d292e011a83d06efebc356
> 060ea812b
>
>