+ All Categories
Home > Documents > Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow...

Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow...

Date post: 21-Aug-2020
Category:
Upload: others
View: 0 times
Download: 0 times
Share this document with a friend
93
Slideshow Tutorial Press the spacebar to continue 1
Transcript
Page 1: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Slideshow Tutorial

Press the spacebar to continue

1

Page 2: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

About Slideshow

Slideshow is a library for creating slide presentations

• A Slideshow presentation is a Racket program

• Instead of a WYSIWYG interface, you get the powerof Racket

2

Page 3: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

How to Control this Viewer

Alt-q, Cmd-q, or Meta-q : end show

Esc : if confirmed, end show

→, ↓, Space, f, n, or click : next slide

←, ↑, Backspace, Delete, or b : previous slide

1 / g : first/last slide

a / s : previous/next slide name

Alt-g, Cmd-g, or Meta-g : select a slide

Alt-p, Cmd-p, or Meta-p : show/hide slide number

Alt-c, Cmd-c, or Meta-c : show/hide commentary

Alt-d, Cmd-d, or Meta-d : show/hide preview

Alt-m, Cmd-m, or Meta-m : show/hide mouse cursor

Shift-→, etc. : move window 1 pixel

Alt-→, Cmd-→, or Meta-→, etc. : move window 10 pixels

3

Page 4: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Slideshow Programs

A Slideshow program has the form

#lang slideshow... code to generate slide content ...

To run a Slideshow program,

• Double-click the Slideshow executable or runslideshow on the command line

• Click the Open File... link and select the Slideshowprogram file, such as mytalk.rkt

4

Page 5: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Slideshow Programs

A Slideshow program has the form

#lang slideshow... code to generate slide content ...

Alternately, run a Slideshow program in DrRacket:

• Open mytalk.rkt in DrRacket

DrRacket’s language should change automatically toModule

• Click Run in DrRacket

Use DrRacket only if you trust the program

5

Page 6: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Slideshow Programs

A Slideshow program has the form

#lang slideshow... code to generate slide content ...

Important security information:

A slideshow program has access to the full Racket language

If you don’t know the creator of a slide program (or if you don’t trustthem), run the slides through the Slideshow executable or slideshowcommand line

When run in Slideshow instead of DrRacket, a slide program cannotwrite files or make network connections

6

Page 7: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Slideshow Programs

A Slideshow program has the form

#lang slideshow... code to generate slide content ...

When using a command line, you can specify theprogram directly:

slideshow mytalk.rkt

To print the talk:

slideshow --print mytalk.rkt

Run slideshow --help for more options

7

Page 8: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Slides and Picts

The body of a Slideshow program

1. Makes and combines picts

For example,

(t "Hello")

creates a pict like this:

Hello

2. Registers certain picts as slides

For example,

(slide (t "Hello"))

registers a slide containing only Hello

8

Page 9: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

The Rest of the Tutorial

The rest of this tutorial (starting with the next slide) ismeant to be viewed while reading the program source

The source is/Applications/Racket v6.11/share/pkgs/slideshow-exe/slideshow/tutorial-show.rkt

9

Page 10: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Part I: Basic Concepts

10

Page 11: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

This slide shows how four picts

get vertically appended by the

slide

function to create and install a slide

11

Page 12: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

See how the

t

function takes a string and

produces a pict with a normal sans-serif font, but

tt

produces a pict with a fixed-width font?

12

Page 13: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

The

#:layout 'top

option for

slide

aligns the slide to the screen top

13

Page 14: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Titles

The

#:title

option for

slide

supplies a title string

14

Page 15: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Paragraphs

Breaking up text into lines is painful, so the parafunction takes a mixture of strings and picts and putsthem into a pagaraph

It doesn’t matter how strings are broken into parts inthe code

The para function puts space between separate strings,but not before punctuation!

15

Page 16: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Paragraph Alignment

The slide function centers body picts horizontally, butpara makes a picture with left-aligned text

The frame function wraps a frame around a pict tocreate a new pict, so you can easily see this individualpict

16

Page 17: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

More Paragraph Alignment

The #:align 'center option for para generates aparagraph with centered lines of text

This line uses the #:fill? #f option

The #:fill? #f option creates a paragraph that iswrapped to fit the slide, but it allows the resulting pictto be more narrow than the slide

17

Page 18: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

More Alignment

Of course, there’s also #:align 'right

This paragraph is right-aligned using #:align 'right,and #:fill? is #f the first time and #t the second time

For comparision, the same text using the default #:fill?:

This paragraph is right-aligned using #:align 'right,and #:fill? is #f the first time and #t the second time

Unless your font happens to make the first line exactly asthe allowed width, the last box will be slightly wider withextra space to the left

18

Page 19: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Paragraph Width

The para function by default makes the paragraph take2/3 of the slide width

The para functionalso accepts an explicit#:width option,which is 300 for thisparagraph

19

Page 20: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Spacing

The slide functions insert space between each bodypict

The amount of space is 24, which is the value of(current-gap-size), which defaults togap-size

20

Page 21: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Controlling Space

If you want to control the space, simply append the pictsyourself to create one body pict

The first argument to vc-append determines thespace between pictures

If the first argument is a pict instead of a number, then 0is used

For text in one paragraph, the para function uses(current-line-sep), which returns 5

21

Page 22: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Appending Picts

This isvl-append

This isvc-append

This isvr-append

22

Page 23: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Horizontal Appending

This ishc-append

obviously

This isht-appendobviously

This ishb-append

obviously

23

Page 24: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Text Alignment

hbl-appendaligns text baselines

It’s especially useful for font mixtures

htl-appendis the same for single lines

The difference between htl-append andhbl-append shows up with multiple lines:

bottom lines alignwhen usinghbl-append

top lines alignwhen usinghtl-append

24

Page 25: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Superimposing

XO

The cc-superimpose function puts picts on top ofeach other, centered

Each of l, r, and c is matched with each of t, b, c, bl,and tl in all combinations with -superimpose

For example, cbl-superimpose:

one linetwolines

25

Page 26: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

By definition, the screen is 1024 x 768 units

If you have more or less pixels, the image is scaled

There’s a margin, so the “client” area is 984 x 728

The font size is 32

26

Page 27: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Titled Client Area

If you use a title, then titleless-page is the samesize as the area left for the body

It's useful27

Page 28: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Text and Styles

Functions exist for bold, italic, and even bold-italictext

The text function gives you more direct control over

the font, size, and even angle

28

Page 29: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Racket Code

For Racket code, the slideshow/code libraryprovides a handy code macro for typesetting literalcode

The code macro uses source-location information toindent code

(define (length l) (cond

[(null? l) 0][else (+ 1 (length (cdr l)))]))

29

Page 30: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Colors

Use the colorize function to color most things,including text

A colorize applies only to sub-picts that do notalready have a color

30

Page 31: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Part I: Basic Concepts

Part II: Practical Slides

Using make-outline and more...

Part III: Fancy Picts

Part IV: Advanced Slides

Part V: Controlling the Background

Part VI: Printing

Conclusion

31

Page 32: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Itemize

• Bulleted sequences are common in slides

• The item function makes a bulleted paragraph that isas wide as the slide

+ You can set the bullet, if you like, by using the#:bullet argment to item

Naturally, there is also subitem

32

Page 33: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Itemize

You could write item yourself:

(define (item . l) (let ([w (- client-w

(pict-width bullet)(/ gap-size 2))])

(htl-append (/ gap-size 2)bullet(para #:width w l))))

where bullet is a constant pict: •

33

Page 34: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Grouping and Space

Sometimes you want to group items on a slide

• A bullet goes with a statement

• And another does, too

Creating a zero-sized pict with (blank) effectivelydoubles the gap, making a space that often looks right

34

Page 35: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Steps

• Suppose you want to show only one item at a time

35

Page 36: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Steps

• Suppose you want to show only one item at a time

• In addition to body picts, the slide functionsrecognize certain staging symbols

• Use 'next in a sequence of slide arguments tocreate multiple slides, one containing only thepreceding content, and another with the remainder

36

Page 37: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Steps

• Suppose you want to show only one item at a time

• In addition to body picts, the slide functionsrecognize certain staging symbols

• Use 'next in a sequence of slide arguments tocreate multiple slides, one containing only thepreceding content, and another with the remainder

'next is not tied to item, though it’s often used withitems

37

Page 38: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Alternatives

Steps can break up a linear slide, but sometimes youneed to replace one thing with something else

For example, replace this...

38

Page 39: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Alternatives

Steps can break up a linear slide, but sometimes youneed to replace one thing with something else

... with something else

39

Page 40: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Alternatives

Steps can break up a linear slide, but sometimes youneed to replace one thing with something else

... with something else

• An 'alts in a sequence must be followed by a list oflists

• Each list is a sequence, a different conclusion for theslide’s sequence

• Anything after the list of lists is folded into the lastalternative

40

Page 41: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Alternatives

Steps can break up a linear slide, but sometimes youneed to replace one thing with something else

... with something else

• An 'alts in a sequence must be followed by a list oflists

• Each list is a sequence, a different conclusion for theslide’s sequence

• Anything after the list of lists is folded into the lastalternative

Of course, you can mix 'alts and 'next ininteresting ways

41

Page 42: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Part I: Basic Concepts

Part II: Practical Slides

Part III: Fancy Picts

Creating interesting graphics

Part IV: Advanced Slides

Part V: Controlling the Background

Part VI: Printing

Conclusion

42

Page 43: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Fancy Picts

In part I, we saw some basic pict constructors: t,vl-append, etc.

Slideshow provides many more...

43

Page 44: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Bitmaps

For example, the bitmap function loads a bitmap todisplay

44

Page 45: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Clickbacks

The clickback function attaches an arbitrary thunkto a pict for interactive slides

Click Me

45

Page 46: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Tables

The table function makes rows and columns

First cons

Second car

Third cdr

Fourth null?

The above also uses standard-fish,jack-o-lantern, cloud, and file-icon

46

Page 47: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Arrows

The arrow function creates an arrow of a given sizeand orientation (in radians)

Simple:

Fun:

(That’s 64 uses of arrow)

47

Page 48: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Arrows

The arrowhead function creates an arrowhead of agiven size and orientation (in radians)

Simple:

Fun:

(That’s 64 uses of arrowhead)

48

Page 49: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Faces

The pict/face library makes faces

49

Page 50: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Arbitrary Drawing

The dc function provides an escape hatch to theunderlying racket/draw library

For example, (disk 100) is the same as

(dc (lambda (dc dx dy) (send dc draw-ellipse dx dy 100 100))100 100 0 0)

50

Page 51: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Frames

• As we’ve already seen, the frame function wraps aframe around a pict

• The #:color option wraps a colored frame;compare to frame followed by colorize, like this

• One way to increase the line thickness is to uselinewidth

• It’s often useful to add space around a pict withinset before framing it

51

Page 52: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Lines and Pict Dimensions

• The hline function creates a horizontal line, given abounding width and height:

(The hline result is framed in green above)

• Naturally, there’s also vline:

• To underline a pict, get its width using pict-width,then use hline and vc-append

• If the pict is text, you can restore the baseline usingrefocus

52

Page 53: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Placing Picts

• Another underline strategy is to use pin-over,which places one pict on top of another to generate anew pict

• The new pict has the original pict’s bounding box andbaselines

(The green frame is the “bounding box” of the result)

• The pin-over function is useful withpip-arrow-line to draw an outgoing arrowwithout changing the layout

53

Page 54: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Finding Picts

Typically, an arrow needs to go from one pict to another

Functions like rc-find locate a point of a pict (such as“right center”) inside a larger pict

There’s a -find function for every combination of l, c,and r with t, c, b, bl, and tl

54

Page 55: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Connecting with Arrows

Actually, straight-arrow combinations are so commonthat Slideshow provides pin-arrow-line

55

Page 56: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Balloons

The pict/balloon library provides cartoon balloons— another reason to use -find functions

Fish File

56

Page 57: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Ghosting

The ghost function turns a picture invisible

For example, the figure on the left and the figure on theright are the same size, because the right one uses theghost of the left one

57

Page 58: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Part I: Basic Concepts

Part II: Practical Slides

Part III: Fancy Picts

Part IV: Advanced Slides

Beyond 'next and 'alts

Part V: Controlling the Background

Part VI: Printing

Conclusion

58

Page 59: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

In-Picture Sequences

Although 'next and 'alts can create simplesequences, use procedure abstraction and ghost tocreate complex sequences inside pict assemblies

59

Page 60: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

In-Picture Sequences

Although 'next and 'alts can create simplesequences, use procedure abstraction and ghost tocreate complex sequences inside pict assemblies

Fish

60

Page 61: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

In-Picture Sequences

Although 'next and 'alts can create simplesequences, use procedure abstraction and ghost tocreate complex sequences inside pict assemblies

Fish File

Larger example: run code

61

Page 62: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Named Steps

The slideshow/step library provides awith-steps form to better express complexsequences

62

Page 63: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Named Steps

The slideshow/step library provides awith-steps form to better express complexsequences

(with-steps(step-name ...)slide-expr)

A with-steps form has a sequences of step namesfollowed by an expression to evaluate once for each step

63

Page 64: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Named Steps

The slideshow/step library provides awith-steps form to better express complexsequences

(with-steps(intro detail conclusion)slide-expr)

For example, the above has three steps: intro,detail, and conclusion

64

Page 65: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Named Steps

The slideshow/step library provides awith-steps form to better express complexsequences

(with-steps(intro detail conclusion) ((vonly intro)(t "For a start...")))

In the body expression, use((vonly step-name) pict-expr) to makepict-expr visible only during step-name

The expression (vonly step-name) produceseither ghost or the identity function

65

Page 66: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Named Steps

The slideshow/step library provides awith-steps form to better express complexsequences

(with-steps(intro detail conclusion)

((vafter detail)(t "like this")) )

Use ((vafter step-name) pict-expr) tomake pict-expr visible after step-name

66

Page 67: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Named Steps

The slideshow/step library provides awith-steps form to better express complexsequences

(with-steps(intro detail conclusion)

((vafter detail)(t "like this")) )

There’s also vbefore, vbetween, and more

67

Page 68: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Animations

The #:timeout option causes a slide to auto-advance,which can be used for animations.

68

Page 69: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Animations

The #:timeout option causes a slide to auto-advance,which can be used for animations.

69

Page 70: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Animations

The #:timeout option causes a slide to auto-advance,which can be used for animations.

70

Page 71: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Animations

The #:timeout option causes a slide to auto-advance,which can be used for animations.

71

Page 72: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Animations

The #:timeout option causes a slide to auto-advance,which can be used for animations.

72

Page 73: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Animations

The #:timeout option causes a slide to auto-advance,which can be used for animations.

73

Page 74: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Animations

The #:timeout option causes a slide to auto-advance,which can be used for animations.

74

Page 75: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Animations

The #:timeout option causes a slide to auto-advance,which can be used for animations.

75

Page 76: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Animations

The #:timeout option causes a slide to auto-advance,which can be used for animations.

76

Page 77: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Animations

The #:timeout option causes a slide to auto-advance,which can be used for animations.

77

Page 78: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Animations

The #:timeout option causes a slide to auto-advance,which can be used for animations.

(The face moved from left to right)

78

Page 79: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Part I: Basic Concepts

Part II: Practical Slides

Part III: Fancy Picts

Part IV: Advanced Slides

Part V: Controlling the Background

Changing the overall look of your talk

Part VI: Printing

Conclusion

79

Page 80: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Controlling the Background

The current-slide-assembler parameter letsyou change the overall look of a slide

For this slide and the previous one, the assembler

• Colorizes the uncolored content as dark red

• Left-aligns the title

• Draws a fading box around the slide

80

Page 81: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Part I: Basic Concepts

Part II: Practical Slides

Part III: Fancy Picts

Part IV: Advanced Slides

Part V: Controlling the Background

Part VI: Printing

Exporting slides as PostScript

Conclusion

81

Page 82: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Printing

To export a set of slides as PostScript, use theslideshow command-line program:

slideshow --print mytalk.rkt

Slideshow steps through slides while producingPostScript pages

The slides will look bad on the screen — because text ismeasured for printing instead of screen display — butthe PostScript will be fine

82

Page 83: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Condensing

Often, it makes sense to eliminate 'step staging whenprinting slides:

slideshow --print --condense mytalk.rkt

83

Page 84: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Condensing

Often, it makes sense to eliminate 'step staging whenprinting slides:

slideshow --print --condense mytalk.rkt

You can also condense without printing

slideshow --condense mytalk.rkt

84

Page 85: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Condensing

Often, it makes sense to eliminate 'step staging whenprinting slides:

slideshow --print --condense mytalk.rkt

You can also condense without printing

slideshow --condense mytalk.rkt

For example, in condensed form, this slide appearswithout steps

85

Page 86: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Steps and Condensing

If you condense these slides, the previous slide’s stepswill be skipped

86

Page 87: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Steps and Condensing

If you condense these slides, the previous slide’s stepswill be skipped

Not this slide’s steps, because it uses 'next!

87

Page 88: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Condensing Alternatives

Condensing does not merge 'alts alternatives

But sometimes you want condensing to just use the lastalternative

um...

88

Page 89: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Condensing Alternatives

Condensing does not merge 'alts alternatives

But sometimes you want condensing to just use the lastalternative

'alts~ creates alternatives where only the last one isused when condensing

89

Page 90: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Condensing Steps

The slideshow/step provides with-steps~where only the last step is included when condensing

Also, a with-steps step name that ends with ~ isskipped when condensing

90

Page 91: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Printing and Condensing Your Own Abstractions

You can customize your slides using printing? andcondensing?

This particular slide is printed and not condensed

When you skip a whole slide, use skip-slides tokeep page numbers in sync

91

Page 92: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Part I: Basic Concepts

Part II: Practical Slides

Part III: Fancy Picts

Part IV: Advanced Slides

Part V: Controlling the Background

Part VI: Printing

Conclusion

This is the end

92

Page 93: Slideshow Tutorialjujuba.me/resources/slideshow-tutorial.pdf · 2018. 6. 20. · A slideshow program has access to the full Racket language If you don’t know the creator of a slide

Your Own Slides

A Slideshow presentation is a Racket program in amodule, so to make your own:

#lang slideshow... your code here ...

For further information, search for slideshow in thedocumentation

93


Recommended