Adjust the TOC Depth

You can adjust the depth of section levels that are displayed in the table of contents with the toclevels attribute.

Set toclevels

By default, the TOC displays level 1 (==) and level 2 (===) section titles. You can assign a different level depth with the toclevels attribute. Accepted values are the integers 1 through 5.

Example 1. Define toclevels value
= The Intrepid Chronicles
Kismet Lee; B. Steppenwolf; Pax Draeke
:toc: (1)
:toclevels: 4 (2)

== Certain Peril

Daylight trickles across the cobblestones...

=== A Recipe for Potion

We have to harvest the leaves by the light of the teal moons...

==== Searching for Ginseng

Crawling through the twisted understory...

== Dawn on the Plateau

Hanging from...
1 The toc attribute must be set in order to use toclevels.
2 toclevels is set and assigned the value 4 in the document header. The TOC will list the titles of any sections, levels 1 through 4 (i.e., == through =====), when the document is rendered.

The result of Example 1 is displayed below.

table of contents with the toclevels attribute set