On this page:
Slide  Content
slide
slide_  pict
slide.next
slide.sync
slide.alts
slide.align
slide.horiz
slide.left
slide.center
slide.right
retract_  recent
Slide
Slide.reissue
Slide.handle
0.45+9.1.0.1

2 Creating Slides🔗ℹ

annotation

SlideContent

Satisfied by allowed arguments to slide: a Pict, slide.next, slide.sync, a value produced by slide.alts, slide.align, or slide.horiz, or a list of values that satisfy SlideContent.

function

fun slide(~title: title :: maybe(String || Pict) = #false,

          ~name: name = title,

          ~layout: layout :: SlideLayout = #'auto,

          ~aspect: aspect :: Aspect = #'widescreen,

          ~sep: sep :: Real = slide.gap,

          ~horiz: horiz_align :: HorizAlignment = #'center,

          ~lead_in: lead_in = #false,

          content :: SlideContent, ...) :: Void

Registers one or more slides. In the simple case, each content produces a pict, and the picts are combined with stack with a separation of sep and the horizontal alignment horiz_align. A slide is produced for each epoch in the resulting pict’s duration, and extra transitions slides are registered for epochs that have a non-0 extent. If lead_in is true, then slides are also registered for the transition from epoch -1.

The title, layout, and aspect arguments are used to combine content picts via the current_assembler parameter’s value.

Besides immediate picts, the content values can produce descriptions of slides to construct using lists, slide.next, slide.sync, slide.alts, slide.align, and slide.horiz (or one of its shorthands: slide.left, slide.center, or slide.right):

See Overview for an introduction to this slide staging and alignment sublanguage.

  • Nested lists are flattened and spliced.

  • A slide.next creates two picts: one with everything before the slide.next, and one with everything after. The two picts are then made sequential with sequential before combining them with stack. The sequential function is used with its default duration mode, so it sustains the first pict. The first pict is also marked as nonarchival for its pre-sustained duration. Note that slide.next might be used in the part before this use, after this use, or both, creating a multi-epoch pict wherever it’s used.

  • A slide.sync is similar to slide.next, but it combines a snapshot of the pict from after slide.sync for all but the last epoch of the pict before slide.sync, and it shifts the time box of the pict after slide.sync by one less (so that the last epoch of the pict before and the first epoch of the pict after are the same).

  • A value produced by slide.alts creates one pict for each argument to slide.alts, and the picts are sequentialized and then combined with overlay. (That’s similar to using switch, but the bounding boxes for all alternatives are preserved for the combined duration.) The overlay combination uses #'top alignment. A slide.next or slide.sync can be used in any alternative, and slide.alts can be nested; in either of those cases, the corresponding alternative will itself be a multi-epoch pict.

  • A value produced by slide.align causes all picts as arguments to slide.align to get the same width by padding on the left, right, or both. This padding applies to picts in nested slide.alts alternatives as well as nested slide.horiz constructions—but not nested slide.align constructions, which perform their own nested alignments. The ~horiz argument to slide.align determines how padding is added by default to contained elements, but nested slide.horiz constructions can change alignment.

  • A value produced by slide.horiz changes alignment and potentially vertical spacing for its arguments.

When a pict representing a slide has the #'nonarchival key mapped to a true value in its metadata for some epoch, then the slide for that epoch is skipped in condensed modeas are any slides for transitions in the epoch. See also nonarchival.

function

fun slide_pict(~title: title :: maybe(String || Pict) = #false,

               ~layout: layout :: SlideLayout = #'auto,

               ~aspect: aspect :: Aspect = #'widescreen,

               ~sep: sep :: Real = slide.gap,

               ~horiz: horiz_align :: HorizAlignment = #'center,

               ~full: full = title && #true,

               content :: SlideContent, ...) :: Pict

Like slide, except that the result is a pict (potentially with a multi-epoch duration) instead of registering a slide.

If full is a true value, then the resulting pict represents a slide including its title as combined via current_assembler. Otherwise, current_assembler is not used, and the resulting pict is just the result of combining the content values.

value

def slide.next

 

value

def slide.sync

 

function

fun slide.alts([content :: SlideContent, ...], ...)

 

function

fun slide.align(~sep: sep :: Real || matching(#'inherit) = #'inherit,

                ~horiz: horiz :: pict.HorizAlignment = #'left,

                content :: SlideContent, ...)

 

function

fun slide.horiz(~sep: sep :: Real || matching(#'inherit) = #'inherit,

                ~horiz: horiz :: pict.HorizAlignment = #'left,

                content :: SlideContent, ...)

 

function

fun slide.left(~sep: sep :: Real || matching(#'inherit) = #'inherit,

               content :: SlideContent, ...)

 

function

fun slide.center(~sep: sep :: Real || matching(#'inherit) = #'inherit,

                 content, ...)

 

function

fun slide.right(~sep: sep :: Real || matching(#'inherit) = #'inherit,

                content :: SlideContent, ...)

Constructors for slide descriptions that are recognized by slide and slide_pict. See slide for more information.

The slide.left, slide.center, and slide.right functions are shorthands for slide.horiz with a specific ~horiz argument.

function

fun retract_recent() :: Slide

 

class

class Slide():

  constructor ~none

 

method

method (s :: Slide).reissue() :: Void

 

property

property (s :: Slide).handle

The retract_recent function unregisters the most recently registered slide and returns a representation of that slide as a Slide object. The Slide.reissue method registers a copy of the slide. Together, the function and method provide limited support for post-hoc reordering of slides, but beware that each step of an animation counts as a different slide for these operations.