On this page:
Slide  Content
slide
slide_  pict
slide.next
slide.sync
slide.Next
slide.Next.continued
slide.alts
slide.Alts
slide.Alts.continued
slide.align
slide.horiz
slide.left
slide.center
slide.right
slide.Sep
slide.Sep.inherit
slide.Horiz  Alignment
slide.Horiz  Alignment.inherit
slide_  transition
retract_  recent
Slide
Slide.reissue
Slide.handle
1.0.0.1+9.3.0.2

2 Creating Slides🔗ℹ

annotation

SlideContent

Satisfied by allowed arguments to slide: a Pict, slide.next, slide.sync, a value produced by slide.alts or slide.align, 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. See also slide_pict, which performs that combination without registering a slide.

Besides immediate picts, the content values can produce descriptions of slides to construct using lists, slide.next, slide.sync, and slide.alts (or one of its shorthands: slide.horiz, 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 the vertical alignment that is supplied to slide.alts, while its horizontal alignment and vertical spacing depends on an enclosing slide.align (or one of the slide.left, slide.horiz, slide.center, or slide.right aliases). Spacing and alignment default to slide.gap and #'center, respectively, if slide.align or slide.horiz is enclosing.

    A slide.next or slide.sync can be used in any alternative with slide.alts, 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 for nested slide.align constructions with local alignment (which is the case unless ~local: #false is provided), padding applies only after the nested slide.align applies it own padding.

    The ~horiz argument to slide.align determines how padding is added by default to contained elements, but nested slide.align constructions can change alignment. Supplying #'inherit for the ~sep or ~horiz argument to slide.align means that vertical spacing and alignment are determined by an enclosing slide.align or slide.horiz, defaulting to slide.gap and #'left is none is enclosing.

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.

When a pict representing a slide has the #'continued key mapped to a true value in its metadata for some epoch, then the slide for that epoch does not increment the page number that the slideshow viewer or printer displays.

Changed in version 1.1 of package rhombus-slideshow-lib: Added #'continued support.

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.

The slide.next and slide.sync descriptions are recognized by slide and slide_pict. See slide for more information.

The last epoch of the pict created for the step before slide.next or slide.sync is suppressed for condensed mode (including printing) via nonarchival. The slide.Next.continued method creates a variant of slide.next or slide.sync that also suppresses a new page number for the last epoch by using continued.

Changed in version 1.1 of package rhombus-slideshow-lib: Added slide.Next and the slide.Next.continued method.

function

fun slide.alts(~vert: vert :: pict.VertAlignment = #'top,

               [content :: SlideContent, ...], ...)

  :: slide.Alts

 

class

class slide.Alts():

  constructor ~none

 

method

method (a :: slide.Alts).continued() :: slide.Alts

The slide.alts function constructs a description that is recognized by slide and slide_pict. See slide for more information.

The slide.Alts.continued method produces an adjusted description that suppress a new page number of the last epoch of all but the last alternative pict in content by using continued.

Changed in version 1.1 of package rhombus-slideshow-lib: Added slide.Alts and the slide.Alts.continued method.

function

fun slide.align(~sep: sep :: slide.Sep = #'inherit,

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

                ~local: local :: Any.to_boolean = #true,

                content :: SlideContent, ...)

 

function

fun slide.horiz(~sep: sep :: slide.Sep = #'inherit,

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

                content :: SlideContent, ...)

 

function

fun slide.left(~sep: sep :: slide.Sep = #'inherit,

               ~local: local :: Any.to_boolean = #false,

               content :: SlideContent, ...)

 

function

fun slide.center(~sep: sep :: slide.Sep = #'inherit,

                 ~local: local :: Any.to_boolean = #false,

                 content, ...)

 

function

fun slide.right(~sep: sep :: slide.Sep = #'inherit,

                ~local: local :: Any.to_boolean = #false,

                content :: SlideContent, ...)

 

enumeration

enum slide.Sep

| ~is_a Real

| inherit

 

enumeration

enum slide.HorizAlignment

| ~is_a pict.HorizAlignment

| inherit

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

The slide.horiz functions is a shorthand for slide.align with ~local: #false.

The slide.left, slide.center, and slide.right functions are shorthands for slide.pict with a specific ~horiz argument and with the ~local argument defaulting to #false instead of #true.

function

fun slide_transition(

  transition :: (StaticPict, Pict, Map) -> (Pict, Boolean)

) :: Void

Registers transition to be invoked on the next call to slide. The transition function is called with a an assembled StaticPict for the previous slide, an assembled Pict for the new slide, and a Map describing extra properties of the old an new slide. The result is a Pict to be used in place of the given one for a new slide, plus a Boolean that is used in place of the ~lead_in argument for the new slide (see slide). A transition function is used only once per registration via slide_transition.

The StaticPict for the previous slide corresponds to a snapshot at the end of the last epoch for the previous slide. The Pict for the new slide can be animated with multiple epochs, reflecting the case that a single call to slide generates a animated or multi-epoch Pict. Both the StaticPict and Pict are assembled in the sense that they have been combined along with their titles, if any, as by slide_pict.

The Map argument to transition provides additional information through the following keys (with more potentially added in the future):

  • #'prev_name: The name (defaults to the title) for the previous slide.

  • #'name: The name (defaults to the title) that will be used for the new slide.

  • #'lead_in: The value of the ~lead_in argument for the slide call that triggered a new slide.

  • #'prev_aspect: An aspect ration as an Aspect for the previous slide.

  • #'aspect: An aspect ration as an Aspect for the new slide.

A transition function can call slide and/or slide_transition. If it calls slide, then newly created slides will appear before the result of transition. If it calls slide_transition, then the registered function is invoked on the next call to slide and not to the result of the transition function.

Added in version 1.1 of package rhombus-slideshow-lib.

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 instant 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 instant.