Skip to main content

item-by-item-functions

item-by-item-functions(source)

Styling presets for item-by-item-fn. Available ones are:

  • current-bold: Makes the currently revealed item bold. You may pass it an optional weight parameter. See https://typst.app/docs/reference/text/text/#parameters-weight. Default is "bold".
  • current-highlight: Highlights the currently revealed item with a yellow background. You may give it an optional style parameter (dictionary) to customize the highlight style. See https://typst.app/docs/reference/text/highlight/.
  • past-faded: Fades already revealed items by reducing their fill alpha. You may pass it an optional alpha parameter, default is 20%.
  • past-progressive-faded: Fades already revealed items with a progressive fade. You may pass it an optional alpha dict. Possible keys are linear and exponential for linear and exponential fading, respectively. The value is the fading speed. Default is (linear: 30%). See the respective functions for more details.

Usage:
#item-by-item-fn("current-highlight")[ ... ]
or if you want to customize the style:
#item-by-item-fn(item-by-item-functions.at("current-highlight").with(style: (stroke: red)))[ ... ] or
#item-by-item-fn((item-by-item-functions.current-highlight).with(style: (stroke: red)))[ ... ]