Complex display rules

There are multiple options to define more complex display rules than a single number.

Array

The simplest extension is to use an array. For example

#polylux-slide[
  #uncover((1, 2, 4))[uncovered only on subslides 1, 2, and 4]
]

results in:

rule-array

The array elements can actually themselves be any kind of rule that is explained on this page.

Interval

You can also provide a (bounded or half-bounded) interval in the form of a dictionary with a beginning and/or an until key:

#polylux-slide[
  #only((beginning: 1, until: 5))[Content displayed on subslides 1, 2, 3, 4, and 5 \ ]
  #only((beginning: 2))[Content displayed on subslide 2 and every following one \ ]
  #only((until: 3))[Content displayed on subslides 1, 2, and 3 \ ]
  #only((:))[Content that is always displayed]
]

results in:

rule-interval

In the last case, you would not need to use #only anyways, obviously.

Convenient syntax as strings

In principle, you can specify every rule using numbers, arrays, and intervals. However, consider having to write

#uncover(((until: 2), 4, (beginning: 6, until: 8), (beginning: 10)))[polylux]

That's only fun the first time. Therefore, we provide a convenient alternative. You can equivalently write:

#uncover("-2, 4, 6-8, 10-")[polylux]

which results in:

rule-string

Much better, right? The spaces are optional, so just use them if you find it more readable.

Unless you are creating those function calls programmaticly, it is a good recommendation to use the single-number syntax (#only(1)[...]) if that suffices and the string syntax for any more complex use case.