跳到主要内容

alternatives-cases

alternatives-cases(self: none, cases, fn, ..kwargs)(source)

You can use this function if you want to have one piece of content that changes only slightly depending of what "case" of subslides you are in.

Example:

#alternatives-cases(("1, 3", "2"), case => [
#set text(fill: teal) if case == 1
Some text
])
Parameters

cases : array

An array of strings that specify the subslides for each case.

fn : function

A function that maps the case to content. The argument case is the index of the cases array you input.

position : alignment

The alignment of alternatives within the reserved space. Default is bottom + left.

stretch : bool

Whether to stretch all alternatives to the maximum width and height. Default is false. Important: If you use a zero-length content like a context expression, you should set stretch: false.

Returns: content