Debian Codegraph @

texmf-dist/doc/generic/lecturer/LecturerDemo-BeamerCambridgeUS.tex

raw
1 % This is a demonstration file distributed with the
2 % Lecturer package (see lecturer-doc.pdf).
3 %
4 % You can recompile the file with a basic TeX implementation,
5 % using pdfTeX or LuaTeX with the plain format.
6 %
7 % The reusable part ends somewhere around line 300.
8 %
9 % Author: Paul Isambert.
10 % Date: July 2010.
11
12 \input lecturer
13
14 \font\maintitlefont = cmdunh10 at 23pt
15 \font\slidetitlefont = cmss12 at 20pt
16 \font\subtitlefont = cmss10
17 \font\titlefont = cmssi10
18
19 \newcolor{darkred}{rgb}{.6 0 0}
20 \newcolor{lightgrey}{grey}{.85}
21 \newcolor{darkgrey}{grey}{.7}
22
23 \setparameter job:
24 mode = presentation % The handout is ready, just turn it on.
25 author = "Pete Agoras"
26 title = "The square root of 2 ain't rational"
27 date = "Some centuries B.C."
28 fullscreen = true
29 autofullscreen = true
30 font = \tenrm % Plain TeX's default, but must be specified
31 % to set it back after a \step with another font.
32
33 \setparameter slide:
34 everyslide = \everyslide
35 hsize = ".6\pdfpagewidth"
36 top = 76pt
37 bottom = 42pt
38 areas* = "title author date"
39 bookmarkstyle = italic
40 baselineskip = 12pt
41 topskip = \baselineskip
42
43 \def\everyslide{%
44 \position{topleft}\Title
45 \position{topright}\sectiontitle
46 \position{titlebar}\slidetitle
47 \position{bottomleft}\Author
48 \position{bottommiddle}{%
49 \noindent
50 \dobutton\firstslide\FirstPage
51 \dobutton\prevslide\PrevPage
52 \dobutton\prevstep\PrevStep\kern.3em
53 \dobutton\showbookmarks\Bookmarks\kern.3em
54 \dobutton\nextstep\NextStep
55 \dobutton\nextslide\NextPage
56 \dobutton\lastslide\LastPage\unskip}
57 \position{bottomright}\Date
58 \presentationonly{
59 \position{math}{%
60 ${a\over b}=\sqrt2$\par
61 $({a\over b})^2=2$\par
62 ${a^2\over b^2}=2$\par
63 $a^2=2b^2$\par
64 $(2k)^2=2b^2$\par
65 $4k^2=2b^2$\par
66 $2k^2=b^2$\par
67 ${a\over b}\neq\sqrt2$}}
68 }
69 \def\dobutton#1#2{%
70 #1[push]{\rlap#2\buttonborder}\hskip1em
71 }
72
73 %
74 % Top and bottom bars.
75 %
76
77 \setarea{topleft topright bottomleft bottommiddle bottomright}
78 height = 18pt
79
80 \setarea{topleft bottomleft}
81 background = darkred
82 foreground = white
83
84 \setarea{topright bottomright}
85 background = darkgrey
86 foreground = darkred
87
88 \setarea{topright bottomleft bottomright}
89 font = \subtitlefont
90
91 \setarea{topleft topright}
92 width = ".5\pdfpagewidth"
93 right left = 1em
94
95 \setarea{bottomleft bottommiddle bottomright}
96 vshift* = 0pt
97 width = "\pdfpagewidth/3"
98 hpos = rr
99
100 \setarea{topleft}
101 hpos = rf
102 font = \titlefont
103
104 \setarea{topright}
105 hshift* = 0pt
106 hpos = fr
107
108 \setarea{titlebar}
109 vshift = 18pt
110 left = 1em
111 height = 40pt
112 background = lightgrey
113 foreground = darkred
114 topskip = 30pt
115 hpos = fr
116 font = \slidetitlefont
117
118 % bottomleft is already fully specified.
119
120 \setarea{bottommiddle}
121 hshift = "\pdfpagewidth/3"
122 topskip = "\symbolheight\buttonborder+3pt"
123 background = lightgrey
124 foreground = white
125
126 \setarea{bottomright}
127 hshift* = 0pt
128
129 %
130 % The maths on the right.
131 %
132 \setarea{math}
133 width = ".2\pdfpagewidth"
134 hshift* = 0pt
135 vshift = 58pt
136 vshift* = 18pt
137 foreground = "grey .75"
138 hpos = fr
139 vpos = center
140 baselineskip = 18pt
141
142
143 %
144 % The title slide.
145 %
146 \setslide{titleslide}
147 areas = "title author date topleft topright"
148 bookmark = false
149 hpos = rr
150 everyslide = {}
151
152 \setarea{title}
153 hshift* = 1cm
154 vshift = 2.5cm
155 height = 45pt
156 topskip = 25pt
157 background = darkred
158 foreground = white
159 top = 1em
160 frame = "width=.2em, corner=round, color=darkgrey"
161 hpos = rr
162 font = \maintitlefont
163
164 \setarea{author}
165 hshift* = 5cm
166 vshift = 6cm
167 height = 28pt
168 topskip = 20pt
169 background = lightgrey
170 foreground = white
171 frame = "width=.5em, corner=round"
172 hpos = rr
173 font = \slidetitlefont
174
175 \setarea{date}
176 hshift* = 5.5cm
177 vshift = 9cm
178 height = 22pt
179 topskip = 10pt
180 background = white
181 foreground = black
182 top = 5pt
183 frame = "width=.5em, corner=bevel, color=lightgrey"
184 hpos = rr
185
186
187 %
188 % For the appendices.
189 % We remove the math area instead
190 % of redefining \everyslide.
191 %
192 \setslide{appslide}
193 areas* = "math title author date"
194
195 %
196 % Default step.
197 %
198 \setparameter step:
199 everyvstep = "\quitvmode\llap{\itemsymbol\kern.5em}"
200 vskip = 18pt
201
202 %
203 % Foreground math.
204 %
205 \setstep\emptystep
206 everyvstep everyhstep = {}
207 vskip hskip = 0pt
208
209 \def\domath#1 #2 #3 {%
210 \emptystep[on=#2,off=#3]
211 \domathstep{#1}%
212 }
213 \def\Domath#1 #2 {%
214 \emptystep[off=#2,visible=true]
215 \domathstep{#1}%
216 }
217 \def\domathstep#1{%
218 \presentationorhandout{\position{math}[0pt,#1\dimexpr18pt\relax]}{\position{math}}
219 {\quitvmode\llap{\mathsym\kern.3em}\usecolor{black}{\typemath{#1}}}%
220 }
221
222 \def\typemath#1{%
223 $\ifcase#1
224 {a\over b}=\sqrt2
225 \or ({a\over b})^2=2
226 \or {a^2\over b^2}=2
227 \or a^2=2b^2
228 \or (2k)^2=2b^2
229 \or 4k^2=2b^2
230 \or 2k^2=b^2
231 \or {a\over b}\neq\sqrt2
232 \fi$}
233 %
234 % Navigation symbols.
235 %
236 \newcolor{button}{grey}{.95}
237 \newcolor{darkbutton}{grey}{.68}
238 \newsymbol\buttonborder[.7pt]
239 {color button,
240 + 0 16, + 16 0, stroke,
241 color darkbutton,
242 move 0 0, + 16 0, + 0 16
243 }
244 \newsymbol\NextStep[.7pt]
245 {move 3 3,
246 + 10 5,+ -10 5,
247 }
248 \newsymbol\PrevStep[.7pt]
249 {move 3 3,
250 move + 10 0, + -10 5,+ 10 5,
251 }
252 \newsymbol\NextPage[.7pt]
253 {move 3 3,
254 + 10 5,+ -10 5, close,
255 }
256 \newsymbol\PrevPage[.7pt]
257 {move 3 3,
258 move + 10 0, + -10 5,+ 10 5, close,
259 }
260 \newsymbol\LastPage[.7pt]
261 {move 3 3,
262 + 10 5,+ -10 5, close,
263 move 3 3,
264 move + 10 0, + 0 10,
265 }
266 \newsymbol\FirstPage[.7pt]
267 {move 3 3,
268 move + 10 0, + -10 5, + 10 5, close,
269 move 3 3, + 0 10,
270 }
271 \newsymbol\Bookmarks[.7pt]
272 {move 3 3,
273 move + 0 1, + 10 0,
274 move 3 3,
275 move + 0 5, + 10 0,
276 move 3 3,
277 move + 0 9, + 10 0,
278 }
279 %
280 % Item symbols.
281 %
282 \newsymbol\itemsymbol[.6em,padding=0pt]
283 {color darkred, + 1 0, + 0 1, + -1 0, fill,}
284 \newsymbol\mathsym[.5em,padding=0pt]
285 {color darkred,
286 + 1 .5, + -1 .5, fill,}
287 \newsymbol\backsym[.5em,padding=0pt]
288 {color darkred, move 1 0, + -1 .5, + 1 .5, fill,}
289 %
290 % Navigation to the appendices.
291 %
292 \def\Back#1{%
293 \presentationonly{\usecolor{darkred}{\gotoB{#1}{\subtitlefont\backsym\kern.3em Back}}}%
294 }
295 \def\To#1{%
296 \presentationorhandout{\usecolor{darkred}{\gotoA{#1}{\subtitlefont\mathsym\kern.3em See why}}}
297 {{\usecolor{darkred}{\subtitlefont\mathsym\kern.3em(See Appendices)}}}%
298 }
299 %
300 % And some structure.
301 %
302 \def\section#1{%
303 \def\sectiontitle{#1}%
304 \createbookmark[nosubmenutext,open]{.5}{#1}%
305 }
306
307
308 % \endinput
309 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
310 % %
311 % UNCOMMENT THE PREVIOUS LINE TO USE THIS FILE AS A TEMPLATE, %
312 % OR REMOVE EVERYTHING BELOW. %
313 % %
314 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
315
316
317
318 \titleslide
319
320 \position{title}\Title
321 \position{author}[0cm,-1.7cm]{\it\usecolor{black}{A Casual Talk By}}
322 \position{author}\Author
323 \position{date}\Date
324
325 \endtitleslide
326
327
328
329
330
331 \section{Demonstration}
332
333 \slide[A simple assumption]
334
335 \domath0 A B
336 \domath1 B C
337 \domath2 C D
338 \domath3 D {}
339
340 \step Some say the square root of 2 isn't rational.
341 \step Suppose it were.
342
343 \step[A] Then we could write it as this, where $a$ and $b$ are
344 integers without a common factor.
345 \To{app1}
346
347 \step[B] But then we can also write this.
348 \step[C] And this.
349 \step[D] And finally this.
350 \step Which means that $a^2$ is even.
351
352 \endslide
353
354
355
356 \slide[Its consequences]
357
358 \Domath3 A
359 \domath4 A B
360 \domath5 B C
361 \domath6 C D
362
363 \step[visible="true"] So what?
364 \step So $a$ is even. Because only even numbers produce even squares.
365 \To{app2}
366
367 \step[A] Being even means being expressible in the form $2k$, where $k$ is
368 any integer.
369 \step[B] And $(2k)^2$ square gives $4k^2$.
370
371 \step[C] Let's simplify.
372 \step Thus $b^2$ is even.
373 \step And $b$ is too.
374
375 \endslide
376
377
378
379 \slide[The problem]
380
381 \domath7 A {}
382
383 \step[visible=true] And but so we said $a$ and $b$ have no common factor.
384
385 \step If both are even they do have a common factor: 2.
386 \step Which is absurd.
387
388 \step Thus, our basic assumption is false.
389 \step[A] There are no such $a$ and $b$.
390
391 \step The square root of 2 is irrational.
392 \step Too bad.
393
394 \endslide
395
396
397
398
399
400 \section{Appendices}
401
402
403
404 \appslide[All fractions are reducible]
405
406
407 \step[visible=true]
408 Suppose $c\over d$ is a rational number. If c and d have no common
409 factor, then $a=b$ and $b=d$. If they have a common factor,
410 divide both by their greatest common divisor. The result
411 is $a\over b$, with no common factor.
412
413 \vskip\baselineskip
414 \Back{app1}
415
416 \endappslide
417
418
419
420 \appslide[An even square has an even root,scale=true]
421
422 \step[visible=true]
423 An even number, by definition, is expressible
424 in the form $2k$, where $k$ is any integer.
425 On the other hand, an odd number is expressible
426 by $$2k+1$$
427 Thus the square of an odd number is
428 $$(2k+1)^2$$
429 i.e. $$4k^2+4k+1$$
430 i.e. $$2\times2(k^2+k)+1$$
431 which is of the form $2k+1$
432 with $2(k^2+k)$ as $k$.
433 Hence, an odd number produces an odd square,
434 and thus if a square is even its root is even too.
435
436 \vskip\baselineskip
437 \Back{app2}
438
439 \step[visible=true,font=\it] You might have noticed
440 that this page is slightly scaled to accommodate
441 its content to the slide's declared {\tt\usecolor{darkred}{vsize}}
442 parameter. Actually, it is scaled because I stretch this
443 paragraph so as to have too much content. Which is kind
444 of paradoxical. Or just opportunistic.
445
446 \endappslide
447
448 \bye
449
450
451