Imported Upstream version 1.22.4
[platform/upstream/groff.git] / contrib / mom / examples / slide-demo.mom
1 .\" -*- mode: text; coding: utf-8; -*-
2 .
3 .\"----------------------------------------------------------------
4 .\" Make first slide black.  Remove if printing to save ink.
5 .po 0
6 .ll 11i
7 .DBX SOLID 0 \n[.l]u \n[.p]u
8 .\"----------------------------------------------------------------
9 .
10 .\"----------------------------------------------------------------
11 .\" Macro for code blocks
12 .de CODE_BLOCK
13 . ie \\n[.$] \{\
14 .   CODE off
15 .   QUOTE off
16 .   CENTER_BLOCK off
17 . \}
18 . el \{\
19 .   CENTER_BLOCK
20 .   QUOTE
21 .   CODE
22 . \}
23 ..
24 .\"----------------------------------------------------------------
25 .
26 .TITLE "Creating slide presentations with gropdf/mom"
27 .PDF_TITLE "\*[$TITLE]"
28 .
29 .DOCTYPE SLIDES \
30   ASPECT 16:9 \
31   HEADER "Header left" "\*[$TITLE]" "Header right" \
32   FOOTER "" "" "\*S[+2]\*[SLIDE#]\*S[-2]" \
33   TRANSITION "Box 1 . O" \
34   PAUSE "Wipe 1"
35 .
36 .PARA_SPACE .75v
37 .SS +3
38 .HYPHENATION off
39 .
40 .NEWCOLOR darkred #aa0000
41 .NEWCOLOR darkred1 #900000
42 .NEWCOLOR blue1 #00007b
43 .NEWCOLOR blue2 #00006f
44 .NEWCOLOR code-grey GRAY 0.3
45 .XCOLOR cyan4
46 .XCOLOR green4
47 .
48 .HEADER_COLOR      darkred1
49 .HEADER_RULE_COLOR blue1
50 .FOOTER_RULE       off
51 .
52 .COVER_STYLE \
53   LEAD +8 \
54   COLOR white
55 .HEADING_STYLE 1 \
56   COLOR blue2
57 .CODE_STYLE \
58   FONT B \
59   SIZE 115 \
60   COLOR code-grey
61 .QUOTE_STYLE \
62   QUAD LEFT
63 .CONDENSE 90
64 .
65 .PDF_IMAGE_FRAME "" 1 blue1
66 .
67 .COVERTITLE \
68   "Creating slide presentations" \
69   "with" \
70   "gropdf and mom"
71 .
72 .COVER_START_POS 15P
73 .COVER COVERTITLE
74 .
75 .STRING hand \*[darkred]\[rh]\*[black]
76 .
77 .START
78 .
79 .ADD_SPACE 9p
80 .IB 8P
81 .
82 .HEADING 1 "PDF slides"
83 .SP .5v
84 .
85 .PP
86 PDF slides are a subset of mom's document processing macros
87 formatted for presentation mode when viewed in a PDF reader.  In
88 most respects, they behave identically to the default document type
89 described in mom's html documentation\*[HANG .]
90 .BR
91 Differences in the formatting include\*[HANG :]
92 .
93 .PAUSE
94 .LEFT
95 .LIST
96 .ITEM .2v
97 the choice between two aspect ratios, 4:3 or 16:9
98 .LIST USER \*[hand]
99 .ITEM
100 both fit on A4 or US letter paper sizes when printed
101 .
102 .PAUSE
103 .LIST BACK
104 .ITEM .2v
105 type is set centered by default
106 .LIST USER \*[hand]
107 .ITEM
108 this may be changed to left, right, or justified
109 .
110 .PAUSE
111 .LIST BACK
112 .ITEM .2v
113 headers and/or footers must be explicitly instantiated
114 .LIST USER \*[hand]
115 .ITEM
116 the left, centre, and right parts must be supplied
117 by the user
118 .
119 .PAUSE
120 .LIST BACK
121 .ITEM .2v
122 slide numbering (pagination) is disabled
123 .LIST  USER \*[hand]
124 .ITEM
125 if slide numbering is desired, it must be put in the left,
126 centre, or right part of a header or footer definition
127 .QUIT_LISTS
128 .
129 .NEWSLIDE
130 .
131 .ADD_SPACE 9p
132 .IB 2P
133 .
134 .DOC_QUAD CENTER
135 .
136 .HEADING 1 "Pauses and transitions"
137 .SP .5v
138 .
139 .PP
140 Slides made with mom take advantage of the pause and slide
141 transition features provided in presentation mode by most
142 contemporary PDF readers.
143 .PAUSE
144 .PP
145 Pauses and transitions are dynamic and engaging, holding the
146 viewer's attention while increasing the impact of the content.
147 .PAUSE
148 .PP
149 With pauses, material on a slide can be revealed progressively
150 with
151 .BR
152 a mouse click or by hitting
153 .
154 .LIST
155 .ITEM .5v
156 Next
157 .ITEM 2p
158 PgDown
159 .ITEM 2p
160 Spacebar
161 .LIST off
162 .
163 .PAUSE
164 .PP
165 The manner in which new material is revealed and new slides
166 are displayed can be tailored separately for effects like Fade,
167 Dissolve, Wipe and others, and can be changed on the fly.
168 .
169 .NEWSLIDE
170 .
171 .PP
172 Mom slides begin with the macro DOCTYPE SLIDES, where you choose
173 the aspect ratio and transition effects, and set up headers and
174 footers\*[HANG .]
175 .PAUSE
176 .PP
177 You may find it convenient to provide a title for the slide
178 presentation, as the top of the .mom file for these slides
179 demonstrates\*[HANG :]
180 .
181 .SP -1v
182 .CODE_BLOCK
183 \*[COND]\&.TITLE "Creating slide presentations with gropdf/mom"
184 \&.PDF_TITLE "\\*[$TITLE]"
185 \&.\\"
186 \&.DOCTYPE SLIDES \\
187  ASPECT 16:9 \\
188  HEADER "Header left" "\\*[$TITLE]" "Header right" \\
189  FOOTER "" "" "\\*S[+2]\\*[SLIDE#]\\*S[-2]" \\
190  TRANSITION "Box 1 . O" \\
191  PAUSE "Wipe 1"\*[CONDX]
192 .CODE_BLOCK off
193 .SP -.5v
194 .
195 .PAUSE
196 .PP
197 Afterwards, you may make any changes you like to the layout and
198 style, then enter START.  Unlike other mom documents, PRINTSTYLE is
199 not required\*[HANG .]
200 .
201 .NEWSLIDE
202 .
203 .ADD_SPACE 9p
204 .IB -1P+6p
205 .
206 .HEADING 1 \
207   "The \s[-2]PAUSE\s[0] and \s[-2]NEWSLIDE\s[0] macros"
208 .SP .5v
209 .
210 .PP
211 Whenever you want a pause before revealing the next material on a
212 slide, enter the macro PAUSE on a line by itself.  If you want a
213 reveal effect that's different from the current one, you may pass
214 PAUSE the parameters of the new effect\*[HANG :]
215 .
216 .SP -1v
217 .PAUSE
218 .
219 .CODE_BLOCK
220 \&.PAUSE "Dissolve .4"
221 .CODE_BLOCK off
222 .
223 .PAUSE "Dissolve .4"
224 Notice that this material dissolves in, whereas before, new material
225 appeared from left to right.  \*[BU6]The new effect stays in force
226 until you change it again\*[HANG .]
227 .PAUSE "Wipe 1"
228 .PP
229 New slides are introduced with NEWSLIDE. \*[bu6]Transition effects
230 and parameters may be given to NEWSLIDE\*[HANG :]
231 .SP -1v
232 .
233 .CODE_BLOCK
234 \&.NEWSLIDE "Blinds .5"
235 .CODE_BLOCK off
236 .
237 .PAUSE
238 The next slide in this presentation will appear with the Blinds
239 effect\*[HANG .]
240 .BR
241 Consult man gropdf\c
242 \*[FU2]\*[UP 1p](\*[DOWN 1p]\*[BU2]1\*[UP 1p]\*[BU1])\*[DOWN 1p]
243 for all the pause/transition effects and their
244 parameters.\*[BU6]\*[UP 2p]\s[-2]*\s[0]
245 .SP 4p
246 .FT I
247 .PT_SIZE -2
248 *Note that not all PDF \*[BU6]viewers support every effect\*[HANG .]
249 .FT R
250 .PT_SIZE +2
251 .
252 .NEWSLIDE "Blinds .5"
253 .
254 .ADD_SPACE 9p
255 .
256 .HEADING 1 "Macros and preprocessors"
257 .SP .5v
258 .
259 .PP
260 Slides can make full use of all mom's document processing and
261 typesetting macros, including preprocessors and image insertion\*[HANG .]
262 .
263 .IBX CLEAR
264 .LS -4
265 .
266 .PAD "\
267 \*[FWD 4P+6p]\*[ST1]#\*[ST1X]\
268 \*[FWD 1P]\*[ST2]#\*[ST2X]\
269 \*[FWD 3P+6p]\*[ST3]#\*[ST3X]\
270 \*[FWD 3P]\*[ST4]#\*[ST4X]\*[FWD 2P]"
271 .
272 .ST 1 L
273 .ST 2 L
274 .ST 3 L
275 .ST 4 L
276 .
277 .PAUSE "Fade .5"
278 .
279 .TAB 1
280 .PT_SIZE -1.5
281 \*[BD]\*[blue2]\*[DOWN 6p]tbl
282 .mk
283 .PT_SIZE -1
284 .COLOR blue2
285 .TS H BOXED
286 tab(^) allbox;
287 c c
288 n n.
289 \*[darkred]\s[-.5]\*[DOWN .5p]Year^Mean Temp.\s[0]\*[blue2]
290 _
291 .TH
292 \*[cyan4]\fB2015^28.3\*[blue2]
293 \*[cyan4]1998^28.3\*[blue2]
294 \*[cyan4]1997^28.3\*[blue2]
295 \*[cyan4]2010^28.1\*[blue2]
296 \*[cyan4]2002^28.1\*[blue2]
297 \*[cyan4]2005^28.0\*[blue2]
298 \*[cyan4]2014^27.9\*[blue2]
299 \*[cyan4]2009^27.9\*[blue2]
300 .TE
301 .
302 .rt
303 .PAUSE
304 .
305 .TN
306 .PT_SIZE +1
307 \*[FWD 10p]\*[DOWN 6p]pic
308 .COLOR green4
309 .SP 3p
310 .PS 2
311 A: ellipse wid 0.5 ht 0.5
312   arrow color "green4" up 0.2 from A.n
313   arrow color "green4" up 0.2 right 0.2 from A.ne
314   arrow color "green4" right 0.2 from A.e
315   arrow color "green4" down 0.2 right 0.2 from A.se
316   arrow color "green4" down 0.2 from A.s
317   arrow color "green4" down 0.2 left 0.2 from A.sw
318   arrow color "green4" left 0.2 from A.w
319   arrow color "green4" up 0.2 left 0.2 from A.nw
320 .PE
321 .
322 .rt
323 .PAUSE
324 .
325 .TN
326 .COLOR blue2
327 \*[FWD 1p]\*[DOWN 6p]eqn
328 .FAMILY T
329 .PT_SIZE +3
330 .LS
331 .COLOR code-grey
332 .SP 4P
333 .EQ
334 f sub X (x) ^=^ left {
335   rpile { 0 above 2x above 0 }
336   ~~lpile { x < 0 above 0 <= x <= 1 above x > 1 }
337 .EN
338 .
339 .rt
340 .PAUSE
341 .
342 .TN
343 .FAMILY H
344 .PT_SIZE -3
345 .COLOR blue2
346 \*[DOWN 6p]pdf image\*[black]\*[PREV]
347 .SP 2P+6p
348 .PDF_IMAGE -L penguin.pdf 81p 96p FRAME
349 .TQ
350 .
351 .NEWSLIDE "Box 1 . O"
352 .ADD_SPACE 9p
353 .IB 10P
354 .PT_SIZE +1.5
355 .
356 .HEADING 1 "Printing handouts"
357 .SP .5v
358 .
359 .CODE_STYLE \
360   COLOR BLACK \
361   SIZE 120
362 .PP
363 Because slides contain pauses, they need a little help on their
364 way to the printer or they stop printing at the first pause\*[HANG .]
365 .PAUSE "Wipe 1"
366 .PP
367 Setting GROPDF_NOSLIDE=1 before invoking 
368 \[oq]\*[FU4]\*[CODE]\*[COND]pdfmom\*[CONDX]\*[CODE off]\*[FU4]\[cq]
369 or
370 \[oq]\*[FU2]\*[CODE]\*[COND]groff\~-Tpdf\*[CONDX]\*[CODE off]\*[FU6]\[cq]
371 disables the pauses\*[HANG :]
372 .
373 .SP -1v
374 .
375 .CODE_STYLE \
376   COLOR code-grey \
377   SIZE 110
378 .CODE_BLOCK
379 \*[COND]GROPDF_NOSLIDE=1 pdfmom <options> slide-file.mom\*[CONDX]
380 .CODE_BLOCK off
381 .
382 .PAUSE
383 The output may be piped directly to a printer or saved to a file\*[HANG .]
384 .PAUSE
385 .PP
386 See mom's html documentation and the gropdf\c
387 \*[FU2]\*[UP 1p](\*[DOWN 1p]\*[BU2]1\*[UP 1p]\*[BU1])\*[DOWN 1p]
388 manpage for complete information concerning slide usage\*[HANG .]
389 .
390 .SP 9p
391 .CENTER_BLOCK
392 .nr dcl-ind -1 1
393 .while \n[dcl-ind]<4 \{\
394 . DCL SOLID \n+[dcl-ind]P 9p 9p blue2
395 .\}
396 .CENTER_BLOCK off