Sections

Another way of expressing where we are in a presentation is working with sections. Usually, this is a topic that a theme will/should handle so this page is addressed more towards theme authors.

In your theme, you can incorporate the following features from the utils module:

First, whenever a user wants to start a new section, you can call

#utils.register-section(the-section-name)

with whatever name they specify. It is up to you to decide what kind of interface you provide for the user and how/if you visualise a new section, of course.

Based on that, you can then display what section the presenter is currently in by using:

#utils.current-section

If no section has been registered so far, this is empty content ([]).

And finally, you might want to display some kind of overview over all the sections. This is achieved by:

#utils.polylux-outline()

Unfortunately, it is hard to get the Typst-builtin #outline to work properly with slides, partly again due to how page numbers are kind of meaningless. polylux-outline is a good alternative to that and will return an enum with all the registered sections (ever, not only so far, so you can safely use it at the beginning of a presentation).

polylux-outline has two optional keyword arguments: