summaryrefslogtreecommitdiff
path: root/macros/generic/lecturer/doc/LecturerDemo-BeamerCambridgeUS.tex
blob: 534b557fdc4f5df64aa7c0ac890799cfb0fc9a38 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
% This is a demonstration file distributed with the
% Lecturer package (see lecturer-doc.pdf).
%
% You can recompile the file with a basic TeX implementation,
% using pdfTeX or LuaTeX with the plain format.
% 
% The reusable part ends somewhere around line 300.
%
% Author: Paul Isambert.
% Date: July 2010. 

\input lecturer

\font\maintitlefont  = cmdunh10 at 23pt
\font\slidetitlefont = cmss12   at 20pt
\font\subtitlefont   = cmss10
\font\titlefont      = cmssi10

\newcolor{darkred}{rgb}{.6 0 0}
\newcolor{lightgrey}{grey}{.85}
\newcolor{darkgrey}{grey}{.7}

\setparameter job:
  mode           = presentation % The handout is ready, just turn it on.
  author         = "Pete Agoras"
  title          = "The square root of 2 ain't rational"
  date           = "Some centuries B.C."
  fullscreen     = true
  autofullscreen = true
  font           = \tenrm % Plain TeX's default, but must be specified
                          % to set it back after a \step with another font.
  
\setparameter slide:
  everyslide    = \everyslide
  hsize         = ".6\pdfpagewidth"
  top           = 76pt
  bottom        = 42pt
  areas*        = "title author date"
  bookmarkstyle = italic
  baselineskip  = 12pt
  topskip       = \baselineskip

\def\everyslide{%
  \position{topleft}\Title
  \position{topright}\sectiontitle
  \position{titlebar}\slidetitle
  \position{bottomleft}\Author
  \position{bottommiddle}{%
    \noindent
    \dobutton\firstslide\FirstPage
    \dobutton\prevslide\PrevPage
    \dobutton\prevstep\PrevStep\kern.3em
    \dobutton\showbookmarks\Bookmarks\kern.3em
    \dobutton\nextstep\NextStep
    \dobutton\nextslide\NextPage
    \dobutton\lastslide\LastPage\unskip}
  \position{bottomright}\Date
  \presentationonly{
    \position{math}{%
      ${a\over b}=\sqrt2$\par
      $({a\over b})^2=2$\par
      ${a^2\over b^2}=2$\par
      $a^2=2b^2$\par
      $(2k)^2=2b^2$\par
      $4k^2=2b^2$\par
      $2k^2=b^2$\par
      ${a\over b}\neq\sqrt2$}}
  }
\def\dobutton#1#2{%
  #1[push]{\rlap#2\buttonborder}\hskip1em
   }

%
% Top and bottom bars.
% 

\setarea{topleft topright bottomleft bottommiddle bottomright}
  height = 18pt

\setarea{topleft bottomleft}
  background = darkred
  foreground = white
  
\setarea{topright bottomright}
  background = darkgrey
  foreground = darkred

\setarea{topright bottomleft bottomright}
  font = \subtitlefont

\setarea{topleft topright}
  width      = ".5\pdfpagewidth"
  right left = 1em

\setarea{bottomleft bottommiddle bottomright}
  vshift* = 0pt
  width   = "\pdfpagewidth/3"
  hpos    = rr

\setarea{topleft}
  hpos       = rf
  font       = \titlefont

\setarea{topright}
  hshift* = 0pt
  hpos    = fr
    
\setarea{titlebar}
  vshift     = 18pt
  left       = 1em
  height     = 40pt
  background = lightgrey
  foreground = darkred
  topskip    = 30pt
  hpos       = fr
  font       = \slidetitlefont

% bottomleft is already fully specified.
  
\setarea{bottommiddle}
  hshift     = "\pdfpagewidth/3"
  topskip    = "\symbolheight\buttonborder+3pt"
  background = lightgrey
  foreground = white
  
\setarea{bottomright}
  hshift* = 0pt

%
% The maths on the right.
%
\setarea{math}
  width      = ".2\pdfpagewidth"
  hshift*    = 0pt
  vshift     = 58pt
  vshift*    = 18pt
  foreground = "grey .75"
  hpos       = fr
  vpos       = center
  baselineskip = 18pt


%
% The title slide.
%
\setslide{titleslide}
  areas      = "title author date topleft topright"
  bookmark   = false
  hpos       = rr
  everyslide = {}

\setarea{title}
  hshift*    = 1cm
  vshift     = 2.5cm
  height     = 45pt
  topskip    = 25pt
  background = darkred
  foreground = white
  top        = 1em
  frame      = "width=.2em, corner=round, color=darkgrey"
  hpos       = rr
  font       = \maintitlefont

\setarea{author}
  hshift*    = 5cm
  vshift     = 6cm
  height     = 28pt
  topskip    = 20pt
  background = lightgrey
  foreground = white
  frame      = "width=.5em, corner=round"
  hpos       = rr
  font       = \slidetitlefont
  
\setarea{date}
  hshift*    = 5.5cm
  vshift     = 9cm
  height     = 22pt
  topskip    = 10pt
  background = white
  foreground = black
  top        = 5pt
  frame      = "width=.5em, corner=bevel, color=lightgrey"
  hpos       = rr


%
% For the appendices.
% We remove the math area instead
% of redefining \everyslide.
%
\setslide{appslide}
  areas* = "math title author date"

%
% Default step.
%
\setparameter step:
  everyvstep = "\quitvmode\llap{\itemsymbol\kern.5em}"
  vskip = 18pt

%
% Foreground math.
%
\setstep\emptystep
  everyvstep everyhstep = {}
  vskip hskip = 0pt

\def\domath#1 #2 #3 {%
  \emptystep[on=#2,off=#3]
  \domathstep{#1}%
  }
\def\Domath#1 #2 {%
  \emptystep[off=#2,visible=true]
  \domathstep{#1}%
  }
\def\domathstep#1{%
  \presentationorhandout{\position{math}[0pt,#1\dimexpr18pt\relax]}{\position{math}}
    {\quitvmode\llap{\mathsym\kern.3em}\usecolor{black}{\typemath{#1}}}%
  }

\def\typemath#1{%
  $\ifcase#1
      {a\over b}=\sqrt2
  \or ({a\over b})^2=2
  \or {a^2\over b^2}=2
  \or a^2=2b^2
  \or (2k)^2=2b^2
  \or 4k^2=2b^2
  \or 2k^2=b^2
  \or {a\over b}\neq\sqrt2
  \fi$}
%
% Navigation symbols.
%
\newcolor{button}{grey}{.95}
\newcolor{darkbutton}{grey}{.68}
\newsymbol\buttonborder[.7pt]
  {color button,
   + 0 16, + 16 0, stroke,
   color darkbutton,
   move 0 0, + 16 0, + 0 16
   }  
\newsymbol\NextStep[.7pt]
  {move 3 3,
   + 10 5,+ -10 5,
   }
\newsymbol\PrevStep[.7pt]
  {move 3 3,
   move + 10 0, + -10 5,+ 10 5,
   }
\newsymbol\NextPage[.7pt]
  {move 3 3,
   + 10 5,+ -10 5, close,
   }
\newsymbol\PrevPage[.7pt]
  {move 3 3,
   move + 10 0, + -10 5,+ 10 5, close,
   }
\newsymbol\LastPage[.7pt]
  {move 3 3,
   + 10 5,+ -10 5, close,
   move 3 3,
   move + 10 0, + 0 10,
   }
\newsymbol\FirstPage[.7pt]
  {move 3 3,
   move + 10 0, + -10 5, + 10 5, close,
   move 3 3, + 0 10,
   }
\newsymbol\Bookmarks[.7pt]
  {move 3 3,
   move + 0 1, + 10 0,
   move 3 3,
   move + 0 5, + 10 0,
   move 3 3,
   move + 0 9, + 10 0,
  }
%
% Item symbols.
%
\newsymbol\itemsymbol[.6em,padding=0pt]
  {color darkred, + 1 0, + 0 1, + -1 0, fill,}
\newsymbol\mathsym[.5em,padding=0pt]
  {color darkred, 
  + 1 .5, + -1 .5, fill,}
\newsymbol\backsym[.5em,padding=0pt]
  {color darkred, move 1 0, + -1 .5, + 1 .5, fill,}
%
% Navigation to the appendices.
%
\def\Back#1{%
  \presentationonly{\usecolor{darkred}{\gotoB{#1}{\subtitlefont\backsym\kern.3em Back}}}%
  }
\def\To#1{%
  \presentationorhandout{\usecolor{darkred}{\gotoA{#1}{\subtitlefont\mathsym\kern.3em See why}}}
    {{\usecolor{darkred}{\subtitlefont\mathsym\kern.3em(See Appendices)}}}%
  }
%
% And some structure.
%
\def\section#1{%
  \def\sectiontitle{#1}%
  \createbookmark[nosubmenutext,open]{.5}{#1}%
  }


% \endinput
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                             %
% UNCOMMENT THE PREVIOUS LINE TO USE THIS FILE AS A TEMPLATE, %
% OR REMOVE EVERYTHING BELOW.                                 %
%                                                             %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



\titleslide

\position{title}\Title
\position{author}[0cm,-1.7cm]{\it\usecolor{black}{A Casual Talk By}}
\position{author}\Author
\position{date}\Date

\endtitleslide





\section{Demonstration}

\slide[A simple assumption]

\domath0 A B
\domath1 B C
\domath2 C D
\domath3 D {}

\step Some say the square root of 2 isn't rational.
\step Suppose it were.

\step[A] Then we could write it as this, where $a$ and $b$ are
integers without a common factor.
\To{app1}

\step[B] But then we can also write this.
\step[C] And this.
\step[D] And finally this.
\step Which means that $a^2$ is even.

\endslide



\slide[Its consequences]

\Domath3   A  
\domath4 A B
\domath5 B C
\domath6 C D

\step[visible="true"] So what?
\step So $a$ is even. Because only even numbers produce even squares.
\To{app2}

\step[A] Being even means being expressible in the form $2k$, where $k$ is
any integer.
\step[B] And $(2k)^2$ square gives $4k^2$.

\step[C] Let's simplify.
\step Thus $b^2$ is even.
\step And $b$ is too.

\endslide



\slide[The problem]

\domath7 A {}

\step[visible=true] And but so we said $a$ and $b$ have no common factor.

\step If both are even they do have a common factor: 2.
\step Which is absurd.

\step Thus, our basic assumption is false.
\step[A] There are no such $a$ and $b$.

\step The square root of 2 is irrational.
\step Too bad.

\endslide





\section{Appendices}



\appslide[All fractions are reducible]


\step[visible=true]
Suppose $c\over d$ is a rational number. If c and d have no common
factor, then $a=b$ and $b=d$. If they have a common factor,
divide both by their greatest common divisor. The result
is $a\over b$, with no common factor.

\vskip\baselineskip
\Back{app1}

\endappslide



\appslide[An even square has an even root,scale=true]

\step[visible=true]
An even number, by definition, is expressible
in the form $2k$, where $k$ is any integer.
On the other hand, an odd number is expressible
by $$2k+1$$
Thus the square of an odd number is
$$(2k+1)^2$$
i.e. $$4k^2+4k+1$$
i.e. $$2\times2(k^2+k)+1$$
which is of the form $2k+1$
with $2(k^2+k)$ as $k$.
Hence, an odd number produces an odd square,
and thus if a square is even its root is even too.

\vskip\baselineskip
\Back{app2}

\step[visible=true,font=\it] You might have noticed
that this page is slightly scaled to accommodate
its content to the slide's declared {\tt\usecolor{darkred}{vsize}}
parameter. Actually, it is scaled because I stretch this
paragraph so as to have too much content. Which is kind
of paradoxical. Or just opportunistic.

\endappslide

\bye