► |  | Unstable: May Change Without Warning

1 | Guidelines for Developing unstable Libraries
2 | Automata: Compiling State Machines
3 | Bytes
4 | Contracts
5 | Converting Values to Strings
6 | Contracts for Macro Subexpressions
7 | Debugging
8 | Definitions
9 | Errors
10 | Filesystem
11 | Find
12 | Flonums
13 | Futures
14 | Functions
15 | Hash Tables
16 | Interface-Oriented Programming for Classes
17 | Lazy Require
18 | Lists
19 | Logging
20 | Mark Parameters
21 | Match
22 | Open place expressions
23 | Parameter Groups
24 | Pretty-Printing
25 | Re-Contracting Identifiers
26 | Sandbox
27 | Sequences
28 | Strings
29 | Structs
30 | Struct Printing
31 | Syntax
32 | Temporal Contracts: Explicit Contract Monitors
33 | GUI Libraries

▼ | 33 | GUI Libraries

33.1 | Notify-boxes
33.2 | Preferences
33.3 | Pict Utilities
33.4 | Slideshow Presentations
33.5 | Progressive Picts and Slides
33.6 | Snip Utilities
33.7 | Scribble Utilities

► | 33.4 | Slideshow Presentations

33.4.1 | Text Formatting
33.4.2 | Tables
33.4.3 | Multiple Columns
33.4.4 | Staged Slides
33.4.5 | Revealing Slides
33.4.6 | Miscellaneous Slide Utilities

On this page:

33.4.1`` Text Formatting
with-size
with-scale
big
small
with-font
with-style
bold
italic
subscript
superscript
caps
33.4.2`` Tables
tabular
33.4.3`` Multiple Columns
two-columns
mini-slide
columns
column
column-size
33.4.4`` Staged Slides
staged
stage
stage-name
slide/ staged
33.4.5`` Revealing Slides
reveal
revealing-slide
items-slide
33.4.6`` Miscellaneous Slide Utilities
blank-line

Version: 5.3.1
top ← prev up next →

#### 33.4`` Slideshow Presentations

Carl Eastlund <cce@racket-lang.org>

This library is unstable; compatibility will not be maintained. See Unstable: May Change Without Warning for more information.

( require unstable/gui/slideshow )

This module also exports everything provided by unstable/gui/pict.

##### 33.4.1`` Text Formatting

> > syntax

> > ( with-size size expr)

Sets current-font-size to size while running expr.

> > syntax

> > ( with-scale scale expr)

Multiplies current-font-size by scale while running expr.

> > syntax

> > ( big text)

> > syntax

> > ( small text)

Scale current-font-size by 3/2 or 2/3, respectively, while running text.

> > syntax

> > ( with-font font expr)

Sets current-main-font to font while running expr.

> > syntax

> > ( with-style style expr)

Adds style to current-main-font (via cons) while running expr.

> > syntax

> > ( bold text)

> > syntax

> > ( italic text)

> > syntax

> > ( subscript text)

> > syntax

> > ( superscript text)

> > syntax

> > ( caps text)

Adds the attributes for bold, italic, superscript, subscript, or small caps text, respectively, to current-main-font while running text.

##### 33.4.2`` Tables

> > procedure

> > ( tabular |  | row |  |  |  |
> > |  | ... |  |  |  |
> > | [ | #:gap gap |  |  |  |
> > |  | #:hgap hgap |  |  |  |
> > |  | #:vgap vgap |  |  |  |
> > |  | #:align align |  |  |  |
> > |  | #:halign halign |  |  |  |
> > |  | #:valign valign]) |  | → |  | pict?

> row : ( listof ( or/c string? pict? ))
> gap : natural-number/c = gap-size
> hgap : natural-number/c = gap
> vgap : natural-number/c = gap

> | align |  | : |  | ( ->* [] [] #:rest ( listof pict? ) pict? )
> |  |  | = |  | lbl-superimpose

> halign : ( ->* [] [] #:rest ( listof pict? ) pict? ) = align
> valign : ( ->* [] [] #:rest ( listof pict? ) pict? ) = align

Constructs a table containing the given rows, all of which must be of the same length. Applies t to each string in a row to construct a pict. The hgap, vgap, halign, and valign are used to determine the horizontal and vertical gaps and alignments as in table (except that every row and column is uniform).

##### 33.4.3`` Multiple Columns

> > syntax

> > ( two-columns one two)

Constructs a two-column pict using one and two as the two columns. Sets current-para-width appropriately in each column.

> > procedure

> > ( mini-slide pict ...) → pict?

> pict : pict?

Appends each pict vertically with space between them, similarly to the slide function.

> > procedure

> > ( columns pict ...) → pict?

> pict : pict?

Combines each pict horizontally, aligned at the top, with space in between.

> > syntax

> > ( column width body ...)

Sets current-para-width to width during execution of the body expressions.

> > procedure

> > ( column-size n [r]) → real?

> n : exact-positive-integer?
> r : real? = ( / n)

Computes the width of one column out of n that takes up a ratio of r of the available space (according to current-para-width).

##### 33.4.4`` Staged Slides

> > syntax

> > ( staged [name ...] body ...)

Executes the body terms once for each stage name. The terms may include expressions and mutually recursive definitions. Within the body, each name is bound to a number from 1 to the number of stages in order. Furthermore, during execution stage is bound to the number of the current stage and stage-name is bound to a symbol representing the name of the current stage. By comparing stage to the numeric value of each name, or stage-name to quoted symbols of the form 'name, the user may compute based on the progression of the stages.

> > syntax

> > stage

> > syntax

> > stage-name

These keywords are bound during the execution of staged and should not be used otherwise.

> > syntax

> > ( slide/staged [name ...] arg ...)

Creates a staged slide. Equivalent to ( staged [name ... ] ( slide arg ... )).

Within a staged slide, the boolean arguments to hide, show, strike, and shade can be used to determine in which stages to perform a transformation. The macros pict-if, pict-cond, pict-case, and pict-match may also be used to create images which change naturally between stages.

##### 33.4.5`` Revealing Slides

> > > The subsequent bindings were added by Jon Rafkind.

> > syntax

> > ( reveal number expr ...)

Expands to either ( show expr ... ) or ( hide expr ... ) if number is greater than or equal to the current revealed slide within a revealing-slide.

> > syntax

> > ( revealing-slide expr ...)

Creates N slides where N is the maximum number given to a reveal expression as the first argument. Each slide has the current reveal number incremented by one so progressive slides can reveal picts in that appear in arbitrary places.

> ( revealing-slide
> ( hc-append ( reveal 0 ( t "I show up first"))
> ( reveal 1 ( t "I show up second")))
> ( reveal 1 ( t "I also show up second")))

> > syntax

> > ( items-slide (name ...) expr ...)

Creates N slides where N is the maximum number given to a reveal similar to revealing-slide. Each slide will show the names on the left hand side using right justification and only one reveal will be displayed on the right. The order of the names will be matched with the current reveal number so the first item will be displayed while the first reveal is displayed. Reveals that are not active will have their corresponding items displayed but in a light font so as to indicate inactivity.

> ( items-slide ("item1" "item2" "item3")
> ( reveal 0
> ( t "I will show up for item1"))
> ( reveal 1
> ( t "I will show up for item2"))
> ( reveal 2
> ( t "I will show up for item3")))

##### 33.4.6`` Miscellaneous Slide Utilities

> > > The subsequent bindings were added by Scott Owens.

> > procedure

> > ( blank-line ) → pict?

Adds a blank line of the current font size’s height.
top ← prev up next →