Wandmalfarbe / pandoc-latex-template

A pandoc LaTeX template to convert markdown files to PDF or LaTeX.
BSD 3-Clause "New" or "Revised" License
6.09k stars 959 forks source link

table of contents, doc needed #283

Closed Keksoj closed 2 years ago

Keksoj commented 2 years ago

The README documentation provides the toc-own-page variable to be set at the beginning of the markdown document:

toc-own-page (defaults to false) begin new page after table of contents, when true

But doing this:

---
title: "my title"
author: "myself"
titlepage: true

toc-own-page: true
---

will NOT work. I had to dive into eisvogel.tex to find out about toc and toc-title. Doing this:

---
title: "my title"
author: "myself"
titlepage: true

toc: true
toc-title: "Sommaire"
toc-own-page: true
---

DOES work.

toc and toc-title should be added in the official documentation.

Wandmalfarbe commented 2 years ago

The variables toc and toc-title are already part of the pandoc manual. I only document options that are added to the default template.

By default, pandoc does not generate a table of contents. The following code

---
title: "my title"
author: "myself"
titlepage: true

toc-own-page: true
---

does not produce a new page after the toc because there is no toc. If you want your documents with a table of contents, you can use --toc on the command line or add toc: true to your YAML front matter. In this case, the option toc-own-page should work as expected. I agree that this can be mentioned in the documentation. Perhaps an example is useful.