Slides

Generic slides

The main building block of the Slydekit framework is the slide function, which is used to create individual slides in a presentation.

#let slide(
  title,
  steps: none
  label: none,
  body
)
Argument
title
string | content

The title of the slide.

Argument
steps – default: none
int | none

The number of steps in the slide. This is used to create incremental slides, where content is revealed step by step. This is required to animate slides using CeTZ or Fletcher, but optional for other animations.

Argument
label – default: none
label | none

An optional label for the slide. This can be used to reference the slide later in the presentation.

Argument
body
content

The content of the slide.

Practically, a slide can be defined in various ways:

// Markup-based slide + label
== Title <label>

Content of the slide

// Slide function + label
#slide("Title", label: <label>)[
  Content of the slide
]

// Slide function
#slide[
  Content of the slide
]
Note
slide("Title")[...] creates a slide with the specified title. When a slide is defined as slide[...], its title is automatically inherited from the previous slide.

Custom slides

There are several ways to define custom slides, which can be used to create slides with different layouts and styles. For instance, the focus-slide function used for capturing the audience’s attention is defined as follows in the built-in themes:

// Focus slide of the simple theme
#let simple-focus-slide(body) = context {
  set page(header:none, footer: none, fill: sk-states.colors.get().focus)
  set align(center + horizon)
  text(size: 2em, fill: white)[*#body*]
}

If you want to create your own custom focus slide, that can use animations and other features, you can use the slide function to define it. For example:

#let my-focus-slide(..args) = {
  set align(center + horizon)
  set text(fill: white, size: 5em)
  set page(header: none, footer: none, fill: rgb("#5E8B65"))

  slide(..args)

  // Freeze the slide number to avoid incrementing it for focus slides
  sk-states.slide-number.update(n => n - 1)
}

Then, you can use it in your presentation like this:

#my-focus-slide[
  *Hey* #pause *ho!*
]

Section numbering

Slydekit supports automatic global numbering of sections and slides. You can customize the numbering pattern and enable or disable section numbering as needed. This behavior is driven by the section-numbering and numbering-pattern arguments of the slydekit function (see Getting Started for details).

slide-subtitle and formatted-number are two helper functions provided by SlydeKit for implementing slide title numbering. The slide-subtitle function generates a slide’s subtitle, including its section and subsection numbers, while formatted-number formats these numbers according to a specified pattern. Both functions are intended for use when creating custom slide templates, ensuring consistent numbering throughout the presentation.

Slide subtitle

The function slide-subtitle is used to generate the subtitle of a slide, which includes the section number and the subsection number.

slide-subtitle(fill-number: none)
Argument
fill-number – default: none
color | none

The color to fill the section and subsection numbers. If set to none, the numbers will be filled with the default color.

Formatted number

The formatted-number function is used to format the title of the sections and subsections numbers according to the specified pattern.

formatted-number(
  at: none,
  force: false,
  level: none,
)
Argument
at – default: none
label | selector | location | function

Retrieves the value of the state at the given selector’s unique match.

Argument
force – default: false
bool

Forces the display of the numbering, even if section numbering is disabled.

Argument
level – default: none
number

The level of the heading to format. If set to none, the default slide-level will be used.