asciidoctor / asciidoctor-pdf

:page_with_curl: Asciidoctor PDF: A native PDF converter for AsciiDoc based on Asciidoctor and Prawn, written entirely in Ruby.
https://docs.asciidoctor.org/pdf-converter/latest/
MIT License
1.14k stars 500 forks source link

Can not have more than 2 levels in PDF TOC #764

Closed r0ckarong closed 7 years ago

r0ckarong commented 7 years ago

I'm creating a large document from various includes. I use leveloffset a lot to get the TOC to format in a usable fashion.

No matter what I do I can not get more than two levels of numbered headings to be rendered in the TOC of the resulting PDF.

I get something like:

1. Somestuff
1.1 A sub chapter
1.2 Another Sub chapter
2. More Stuff

But There is at least multiple 1.2.n points that I can not get displayed.

I have :toclevels: 5 and :sectnumlevels: 5 set in the main document but it doesn't change anything. Even the Atom previewer doesn't show more than 2 levels. What am I doing wrong?

The included files begin mostly with level 0. Is that the cause here?

r0ckarong commented 7 years ago

Turns out I made the same mistake someone else made and had empty lines in my document header. This dropped the attributes.

mojavelinux commented 7 years ago

:+1:

matthieu-labas commented 9 months ago

Turns out I made the same mistake someone else made and had empty lines in my document header. This dropped the attributes.

What do you mean by "document header"? In the "main" .adoc? Or in the PDF theme .yml?

mojavelinux commented 9 months ago

See https://docs.asciidoctor.org/asciidoc/latest/document/header/#document-header-structure

matthieu-labas commented 9 months ago

See https://docs.asciidoctor.org/asciidoc/latest/document/header/#document-header-structure

Thanks Dan!

To be more specific, I had to remove the empty line between my title and headers:

ifeval::["{lang}" == "fr"]
= Manuel de configuration
endif::[]
ifeval::["{lang}" != "fr"]
= Configuration Manual
endif::[]
                      <<<--- Need to remove this empty line
:sectnums:
:sectnumlevels: 4
:toc:
:toclevels: 5
:toc-placement: macro
mojavelinux commented 9 months ago

Yep!

mojavelinux commented 9 months ago

In the future, please direct questions about usage to the project chat at https://chat.asciidoctor.org. Thanks!