Debian Codegraph @

texmf-dist/doc/generic/lecturer/LecturerDemo-SimplePresentation.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 250.
8 %
9 % Author: Paul Isambert.
10 % Date: July 2010.
11
12 \input lecturer
13
14 % Uncomment these to show the grid on which the presentation is built.
15 %\showgrid{1mm}
16 %\showgrid[-.5cm,-.5cm]{1cm}[black]
17 %\showgrid{1cm}[red][.4pt]
18
19
20 \font\maintitlefont = cmdunh10 at 23pt
21 \font\slidetitlefont = cmss12 at 20pt
22 \font\subtitlefont = cmss8
23 \font\titlefont = cmss10 at 20pt
24
25 \newcolor{darkred}{rgb}{.6 0 0}
26 \setparameter job:
27 mode = presentation
28 author = "Pete Agoras"
29 title = "The square root of 2 ain't rational"
30 date = "Some centuries B.C\rlap." % \rlap creates protrusion
31 fullscreen = true
32 autofullscreen = true
33 font = \tenrm
34
35
36 %
37 % Slides for the main matter.
38 %
39 \setparameter slide:
40 everyslide = \everyslide
41 top = 3cm
42 topskip = 1cm
43 left = 3.1cm
44 right = 5cm
45 baselineskip = .5cm
46 areas* = "title by author date"
47 bookmarkstyle = italic
48 font = \tenrm
49 vpos = top
50
51 \def\everyslide{%
52 \position{top}\slidetitle
53 \position{left}{\Author\par\Date}
54 \position{menu}{\quitvmode\showbookmarks\Bookmarks}
55 \position{menu}[0pt,0pt]{\the\numexpr\slidenumber-1\relax}
56 }
57
58 %
59 % Left and top areas.
60 %
61 \setarea{left}
62 hshift = 0pt
63 width = 3cm
64 right = .1cm
65 hpos = rf
66 bottom = .5cm
67 vpos = bottom
68 foreground = darkred
69 font = \subtitlefont
70
71 \setarea{top}
72 left = 3.1cm
73 vshift = 0pt
74 height = 2cm
75 vpos = bottom
76 font = \titlefont
77
78 \setarea{vline hline}
79 frame = "width = .15pt, color = black"
80
81 \setarea{vline}
82 hshift = 3cm
83 width = 0pt
84
85 \setarea{hline}
86 vshift = 2cm
87 height = 0pt
88
89 %
90 % The circle with the slide number.
91 %
92 \setarea{menu}
93 width height = 1cm
94 vshift* hshift* topskip = .5cm
95 vpos = bottom
96 hpos = rr
97
98 \newsymbol\Bookmarks[.35cm,padding=.1pt]
99 {pen .05,
100 move 1 -.6,
101 circle lu 1,
102 circle ur 1,
103 circle rd 1,
104 circle dl 1,
105 }
106
107 %
108 % The maths on the right.
109 %
110 \setarea{math}
111 width = 2cm
112 hshift* = 1.1cm
113 vshift* = 5.35cm
114 vshift = 5.25cm
115 topskip = .8cm
116 foreground = white
117 background = black
118 frame = width=.1cm,corner=round % No space => no need for quotes or braces. No readability either.
119 hpos = rr
120
121
122 %
123 % The title slide.
124 %
125 \setslide{titleslide}
126 areas = "title by author date"
127 bookmark = false
128 hpos = rr
129 everyslide = {}
130
131 \setarea{title}
132 hshift* = 1cm
133 hpos = rr
134 vshift = 2cm
135 height = 1.3cm
136 topskip = 1cm
137 background = darkred
138 foreground = white
139 frame = "width = .5em, corner = round, color = black"
140 font = \maintitlefont
141
142 \setarea{by}
143 hshift* = 5.8cm
144 hpos = rr
145 vshift = 4.5cm
146 height = .8cm
147 topskip = 10pt
148 top = 3pt
149 background = black
150 foreground = white
151 frame = "width = .5em, corner = round"
152 font = \it
153
154
155 \setarea{author}
156 hshift* = 5cm
157 hpos = rr
158 vshift = 6.3cm
159 height = 25pt
160 topskip = 15pt
161 top = 4pt
162 background = black
163 foreground = white
164 frame = "width = .5em, corner = round, color = darkred"
165 font = \slidetitlefont
166
167 \setarea{date}
168 hshift* = 5.5cm
169 vshift* = 1.7cm
170 height = .8cm
171 bottom = .3cm
172 topskip = 0pt
173 vpos = bottom
174 background = white
175 foreground = black
176 frame = "width = .5em, corner = bevel, color = darkred"
177 hpos = rr
178
179
180 %
181 % For the appendices.
182 % We remove the math area instead
183 % of redefining \everyslide.
184 %
185 \setslide{appslide}
186 top = 2.5cm
187 areas*= "math title by author date"
188
189 \abovedisplayshortskip = 0cm
190 \belowdisplayshortskip = 0cm
191 \abovedisplayskip = 0pt
192 \belowdisplayskip = 0pt
193
194 %
195 % Steps.
196 %
197 \setparameter step:
198 vskip = .5cm
199
200 % With this macro, the item symbol is always on the screen
201 % (since the step is "visible").
202 \def\Step{%
203 \step[visible=true]\quitvmode\llap{\stepsym\kern.2cm}%
204 \step}
205
206 %
207 % The maths.
208 %
209 \setstep\emptystep
210 everyvstep everyhstep = {}
211 vskip hskip = 0pt
212
213 \def\domath#1 #2 #3{%
214 \emptystep[on=#1,off=#2]
215 \domathstep{#3}%
216 }
217 \def\Domath#1 #2{%
218 \emptystep[off=#1,visible=true]
219 \domathstep{#2}%
220 }
221 \def\domathstep#1{%
222 \position{math}[0pt,0pt]{$#1$}%
223 }
224 %
225 % Item symbols.
226 %
227 \newsymbol\stepsym[2mm,padding=0pt]
228 {color darkred,
229 + 1 .5, + -1 .5, fill,}
230 \newsymbol\backsym[2mm,padding=0pt]
231 {color darkred, move 1 0, + -1 .5, + 1 .5, fill,}
232 %
233 % Navigation to the appendices.
234 %
235 \def\Back#1{%
236 \presentationonly{\usecolor{darkred}{\gotoB{#1}{\subtitlefont\backsym\kern.3em Back}}}%
237 }
238 \def\To#1{%
239 \usecolor{darkred}{\gotoA{#1}{\subtitlefont\stepsym\kern.3em See why}}%
240 }
241 %
242 % And some structure.
243 %
244 \def\section#1{%
245 \def\sectiontitle{#1}%
246 \createbookmark[nosubmenutext,open]{.5}{#1}%
247 }
248
249 % \endinput
250 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
251 % %
252 % UNCOMMENT THE PREVIOUS LINE TO USE THIS FILE AS A TEMPLATE, %
253 % OR REMOVE EVERYTHING BELOW. %
254 % %
255 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
256
257
258
259
260
261 \titleslide
262
263 \position{title}\Title
264 \position{by}{A Casual Talk By}
265 \position{author}\Author
266 \position{date}\Date
267
268 \endtitleslide
269
270
271
272
273
274 \section{Demonstration}
275
276
277
278 \slide[A simple assumption,font=]
279
280 \step[on=A]\position{math}[0cm,0cm]{}
281
282 \domath A B {{a\over b}=\sqrt2}
283 \domath B C {({a\over b})^2=2}
284 \domath C D {{a^2\over b^2}=2}
285 \domath D {} {a^2=2b^2}
286
287 \Step Some say the square root of 2 isn't rational.
288 \step Suppose it were.
289
290 \Step[A] Then we could write it as this, where $a$ and $b$ are
291 integers without a common factor.
292 \To{app1}
293
294 \Step[B] But then we can also write this.
295 \step[C] And this.
296 \step[D] And finally this.
297 \step Which means that $a^2$ is even.
298
299 \endslide
300
301
302
303 \slide[Its consequences]
304
305 \step[on=A]\position{math}[0cm,0cm]{}
306
307 \Domath A {a^2=2b^2}
308 \domath A B {(2k)^2=2b^2}
309 \domath B C {4k^2=2b^2}
310 \domath C D {2k^2=b^2}
311
312 \Step[visible=true] So what?
313 \step So $a$ is even. Because only even numbers produce even squares.
314 \To{app2}
315
316 \Step[A] Being even means being expressible in the form $2k$, where $k$ is
317 any integer.
318 \step[B] And $(2k)^2$ square gives $4k^2$.
319
320 \Step[C] Let's simplify.
321 \step Thus $b^2$ is even.
322 \step And $b$ is too.
323
324 \endslide
325
326
327
328 \slide[The problem]
329
330 \step[on=A]\position{math}[0cm,0cm]{}
331
332 \domath A {} {{a\over b}\neq\sqrt2}
333
334 \Step[visible=true] And but so we said $a$ and $b$ have no common factor.
335
336 \Step If both are even they do have a common factor: 2.
337 \step Which is absurd.
338
339 \Step Thus, our basic assumption is false.
340 \step[A] There are no such $a$ and $b$.
341
342 \Step The square root of 2 is irrational.
343 \step Too bad.
344
345 \endslide
346
347
348
349
350
351 \section{Appendices}
352
353
354
355 \appslide[All fractions are reducible]
356
357 \Step[visible=true]
358 Suppose $c\over d$ is a rational number. If c and d have no common
359 factor, then $a=b$ and $b=d$. If they have a common factor,
360 divide both by their greatest common divisor. The result
361 is $a\over b$, with no common factor.
362 \kern1em\Back{app1}
363
364 \endappslide
365
366
367
368 \appslide[An even square has an even root]
369
370 \Step[visible=true]
371 An even number, by definition, is expressible
372 in the form $2k$, where $k$ is any integer.
373 On the other hand, an odd number is expressible by
374 %
375 $$2k+1$$
376 %
377 Thus the square of an odd number is
378 %
379 $$(2k+1)^2$$
380 i.e. $$4k^2+4k+1$$
381 i.e. $$2\times2(k^2+k)+1$$
382 %
383 which is of the form $2k+1$
384 with $2(k^2+k)$ as $k$.
385 Hence, an odd number produces an odd square,
386 and thus if a square is even its root is even too.
387 \kern1em\Back{app2}
388
389 \endappslide
390
391
392 \bye