Sections and Subsections
Structureβ
Similar to Beamer, Touying also has the concept of sections and subsections.
Generally, level 1, level 2, and level 3 headings correspond to section, subsection, and title, respectively, as in the dewdrop theme.
#import "@preview/touying:0.3.1": *
#let s = themes.dewdrop.register(s)
#let (init, slides) = utils.methods(s)
#show: init
#let (slide,) = utils.slides(s)
#show: slides
= Section
== Subsection
=== Title
Hello, Touying!
However, often we don't need subsections, and we can use level 1 and level 2 headings to correspond to section and title, as in the university theme.
#import "@preview/touying:0.3.1": *
#let s = themes.university.register(s)
#let (init, slides) = utils.methods(s)
#show: init
#let (slide,) = utils.slides(s)
#show: slides
= Section
== Title
Hello, Touying!
In fact, we can control this behavior through the slide-level
parameter of the slides
function. slide-level
represents the complexity of the nested structure, starting from 0. For example, #show: slides.with(slide-level: 2)
is equivalent to the section, subsection, and title structure; while #show: slides.with(slide-level: 1)
is equivalent to the section and title structure.
Table of Contentsβ
Displaying a table of contents in Touying is straightforward:
#import "@preview/touying:0.3.1": *
#let (init, slides, alert, touying-outline) = utils.methods(s)
#show: init
#let (slide,) = utils.slides(s)
#show: slides.with(slide-level: 2)
= Section
== Subsection
=== Title
==== Table of contents
#touying-outline()
Where the definition of touying-outline()
is:
#let touying-outline(enum-args: (:), padding: 0pt) = { .. }
You can modify the parameters of the internal enum through enum-args
.
If you have complex custom requirements for the table of contents, you can use:
#states.touying-final-sections(sections => ..)
As done in the dewdrop theme.