跳到主要内容

touying-reducer

Extend external packages with pause and meanwhile animation support.

Wraps an external drawing/diagram function (like cetz.canvas or fletcher.diagram) so that Touying can intercept pause/meanwhile markers inside its content array and hide/cover items across subslides.

Define package-specific wrappers once at the top of your document:

// CeTZ
#let cetz-canvas = touying-reduce.with(cetz)

// Fletcher
#let fletcher-diagram = touying-reduce.with(fletcher)
Parameters

reduce : function    default: arr => arr.sum()​

The external drawing function. A body passed as one array is handed back as one array (e.g. cetz.canvas); directly passed elements are spread as positional arguments (e.g. lq.diagram).

cover : function    default: arr => none​

Called with a drawing command when that command should be hidden on the current subslide. Should produce invisible but space-preserving content (e.g. cetz.draw.hide.with(bounds: true) or fletcher.hide).

label : none | str | label    default: none​

An optional label to identify the graphic for later recall via touying-recall. A string is converted to a label automatically.

..args : arguments​

The positional and named arguments passed to the reduce function.

Returns: content