summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/slidenotes/slidenotes.dtx
blob: 475ea8083e7b448ba772d6c271256f208287707d (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
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
% \CheckSum{1237}
%
%\iffalse   % this is a METACOMMENT !
%
%% File: slidenotes.dtx Copyright (C) 1993-1996 Hans van der Meer
%%
%
%    \begin{macrocode}
%<*driver>
\documentclass{ltxdoc}
\ProvidesFile{slidenotes.dtx}[1998/04/23 3.27  Slides and notes]
\GetFileInfo{slidenotes.dtx}
\title{The \textsf{slidenotes} package%
\thanks{This file has version \fileversion\space dated \filedate.}}
\author{Hans van der Meer\\hansm@wins.uva.nl}
\date{Printed \today}
\DisableCrossrefs
\CodelineNumbered
%\RecordChanges
\begin{document}
\maketitle
\DocInput{slidenotes.dtx}
\end{document}
%</driver>
%    \end{macrocode}
%
%\fi
%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \changes{3.00}{1994/03/21}{First version for LaTeX2E and docstrip}
% \changes{3.01}{1994/12/10}{Removed @vpt... macros}
% \changes{3.02}{1995/01/26}{sheets->slides, various changes}
% \changes{3.03}{1995/02/02}{small changes}
% \changes{3.04}{1995/08/11}{@currdir in folder defaults}
% \changes{3.05}{1995/08/28}{restructured documentation}
% \changes{3.06}{1995/08/29}{frame variations, LaTeX2e-isms}
% \changes{3.07}{1995/09/01}{frame variations, oval boxing problematic}
% \changes{3.08}{1995/09/04}{note (section) title -> toc error}
% \changes{3.09}{1995/09/05}{added vertical slide centering option}
% \changes{3.10}{1995/09/18}{cue macro changed}
% \changes{3.11}{1995/10/12}{everyslide, nofiles for slides added}
% \changes{3.12}{1995/10/23}{cue macro marginpar always same side}
% \changes{3.13}{1996/03/16}{changes to frame treatment}
% \changes{3.14}{1996/03/22}{check for slides that are too high}
% \changes{3.15}{1996/05/25}{nofiles removed}
% \changes{3.16}{1996/08/13}{test presence chapter, cleaning code}
% \changes{3.17}{1996/08/14}{on directory names changed pathseparator,
%                            disable tableofcontents if not notes}
% \changes{3.18}{1996/08/14}{added mixing of portrait and landscape}
% \changes{3.19}{1996/08/21}{added portrait/landscape selective code}
% \changes{3.20}{1996/08/23}{made all newcommands starred where appropiate,
%                            removed superfluous braces}
% \changes{3.21}{1997/03/08}{added better directory separator,
%                            changed slide dimensions to magnified sizes,
%                            corrected calculation of text dimensions,
%                            problem with missedslidecounter solved}
% \changes{3.22}{1997/03/14}{CurrentDirectory for @currdir added}
% \changes{3.23}{1998/02/17}{option to suppress newpage at slide}
% \changes{3.24}{1998/03/20}{ignorespaces in slide en note begin-commands}
% \changes{3.25}{1998/04/08}{stepcounter{slidecounter}->refstepcounter}
% \changes{3.26}{1998/04/15}{list in note environment zet parsep}
% \changes{3.27}{1998/04/23}{boldmath in titles on sheets}
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% \DoNotIndex{\#}
% \DoNotIndex{\@,}
% \DoNotIndex{\\}
% \DoNotIndex{\@dblarg}
% \DoNotIndex{\@empty}
% \DoNotIndex{\@firstoftwo}
% \DoNotIndex{\@height}
% \DoNotIndex{\@ifstar}
% \DoNotIndex{\@ifundefined}
% \DoNotIndex{\@m}
% \DoNotIndex{\@makeother}
% \DoNotIndex{\@namedef}
% \DoNotIndex{\@sanitize}
% \DoNotIndex{\@secondoftwo}
% \DoNotIndex{\@tempdima}
% \DoNotIndex{\@tempdimb}
% \DoNotIndex{\@title}
% \DoNotIndex{\@width}
% \DoNotIndex{\addtolength}
% \DoNotIndex{\addvspace}
% \DoNotIndex{\advance}
% \DoNotIndex{\begin}
% \DoNotIndex{\begingroup}
% \DoNotIndex{\bgroup}
% \DoNotIndex{\bigskip}
% \DoNotIndex{\bigskipamount}
% \DoNotIndex{\box}
% \DoNotIndex{\catcode}
% \DoNotIndex{\csname}
% \DoNotIndex{\def}
% \DoNotIndex{\dimen@}
% \DoNotIndex{\divide}
% \DoNotIndex{\dp}
% \DoNotIndex{\edef}
% \DoNotIndex{\egroup}
% \DoNotIndex{\end}
% \DoNotIndex{\endcsname}
% \DoNotIndex{\endgroup}
% \DoNotIndex{\endlist}
% \DoNotIndex{\enspace}
% \DoNotIndex{\expandafter}
% \DoNotIndex{\fbox}
% \DoNotIndex{\gdef}
% \DoNotIndex{\global}
% \DoNotIndex{\hbox}
% \DoNotIndex{\hfil}
% \DoNotIndex{\hfill}
% \DoNotIndex{\hrule}
% \DoNotIndex{\hspace}
% \DoNotIndex{\Huge}
% \DoNotIndex{\huge}
% \DoNotIndex{\ht}
% \DoNotIndex{\if,\else,\fi}
% \DoNotIndex{\ifcase,\or,\fi}
% \DoNotIndex{\ifdim,\fi}
% \DoNotIndex{\ifnum,\fi}
% \DoNotIndex{\ifodd,\fi}
% \DoNotIndex{\ifx,\fi}
% \DoNotIndex{\item}
% \DoNotIndex{\kern}
% \DoNotIndex{\LARGE}
% \DoNotIndex{\Large}
% \DoNotIndex{\large}
% \DoNotIndex{\let}
% \DoNotIndex{\list}
% \DoNotIndex{\m@ne}
% \DoNotIndex{\medskip}
% \DoNotIndex{\medskipamount}
% \DoNotIndex{\multiply}
% \DoNotIndex{\newcommand}
% \DoNotIndex{\newcounter}
% \DoNotIndex{\newenvironment}
% \DoNotIndex{\newif}
% \DoNotIndex{\newlength}
% \DoNotIndex{\newpage}
% \DoNotIndex{\newsavebox}
% \DoNotIndex{\newtoks}
% \DoNotIndex{\next}
% \DoNotIndex{\noexpand}
% \DoNotIndex{\noindent}
% \DoNotIndex{\null}
% \DoNotIndex{\p@}
% \DoNotIndex{\par}
% \DoNotIndex{\parbox}
% \DoNotIndex{\raggedright}
% \DoNotIndex{\relax}
% \DoNotIndex{\renewcommand}
% \DoNotIndex{\reserved@a}
% \DoNotIndex{\scriptsize}
% \DoNotIndex{\setbox}
% \DoNotIndex{\setlength}
% \DoNotIndex{\sloppy}
% \DoNotIndex{\small}
% \DoNotIndex{\smallskip}
% \DoNotIndex{\smallskipamount}
% \DoNotIndex{\space}
% \DoNotIndex{\stepcounter}
% \DoNotIndex{\string}
% \DoNotIndex{\strut}
% \DoNotIndex{\test}
% \DoNotIndex{\the}
% \DoNotIndex{\tiny}
% \DoNotIndex{\tw@}
% \DoNotIndex{\typeout}
% \DoNotIndex{\undefined}
% \DoNotIndex{\value}
% \DoNotIndex{\vbox}
% \DoNotIndex{\vfil}
% \DoNotIndex{\vfill}
% \DoNotIndex{\vskip}
% \DoNotIndex{\vspace}
% \DoNotIndex{\wd}
% \DoNotIndex{\xdef}
% \DoNotIndex{\z@}
%
% \begin{abstract}
%   This article describes the use and the implementation of the 
%   \emph{slidenotes class}.
%   Its purpose is the typesetting of slides and accompanying notes.
%   Slides can be in portrait or landscape orientation.
%   Options are the typesetting of the slides or slides plus notes,
%   or a collection of slides in small format.
% \end{abstract}
%
% \tableofcontents
%
% \section{Usage}
%
% An input file may consist of a series of slides accompanied
% by notes. Below the format of a slide in a nutshell:
%
% \DescribeEnv{slide}
% \begin{verbatim}
% \begin{slide}[SLIDE TITLE (optional)]
%    ...
%    \slidesubtitle{SUBTITLE}
%    ...
%    <more slide text>
%    ...
% \end{slide}
% \end{verbatim}
%
% or
%
% \DescribeEnv{portraitslide}
% \begin{verbatim}
% \begin{portraitslide}[SLIDE TITLE (optional)]
%    ...
% \end{portraitslide}
% \end{verbatim}
%
% \DescribeEnv{landscapeslide}
% \begin{verbatim}
% \begin{landscapeslide}[SLIDE TITLE (optional)]
%    ...
% \end{landscapeslide}
% \end{verbatim}
%
% Do not put anything text outside notes/slide, 
% because it interferes destructively with the layout.
%
% \DescribeEnv{note}
% \begin{verbatim}
% \begin{note}
%    ...
%    \cue{MARGIN TEXT}
%    ...
%    <more note text>
%    ...
% \end{note}
% \end{verbatim}
%
% Use |\chapter| for the main structure, each note will
% be converted to a |\section|.
% Several parameters and font macro's are defined for various
% style features; they can be redefined, either in the document
% or in the \emph{slidenotes.cfg} file.
% These parameters exist for the dimensions of the slide,
% the font in the various text parts, several standard texts.
%
% Options exist for:
% \begin{itemize}\setlength{\itemsep}{0pt}
% \item choosing between slides, slides + notes, a collection of slides; 
% \item landscape or portrait format;
% \item notes in a type one notch smaller than in the slides;
% \item variation in frame around slide.
% \item variation in vertical centering of the contents.
% \end{itemize}
% 
% See the implementation sections for further details.
% 
% \StopEventually{\PrintChanges}
%
% \section{Identification}
%
%    This document class can only be used with \LaTeXe, so we make
%    sure that an appropriate message is displayed when another \TeX{}
%    format is used.
%
%    \begin{macrocode}
%<cls|obox>\NeedsTeXFormat{LaTeX2e}[1995/12/01]
%    \end{macrocode}
%
%    Announce class names and versions:
%    \begin{macrocode}
%<*cls>
\ProvidesClass{slidenotes}[1998/04/23 3.27  Slides and notes]
%    \end{macrocode}
%
% \section{Declaration of Class Options}
%
%    In this part we define the options for this class that are additional
%    to those of its parent class.
%
% \subsection{Show Options to User}
%
% Show options to the user with option |help|.
%
%    \begin{macrocode}
\DeclareOption{help}{\ClassWarningNoLine{slidenotes}{%
    Options (first one is default):
      \MessageBreak
    notes,slides,minis:\space type of production;
      \MessageBreak
    portrait,landscape:\space slide orientation;
      \MessageBreak
    mixed,unmixed,anti:\space both, chosen, anti orientation;
      \MessageBreak
    center,nocenter,squeeze:\space vertical slide position;
      \MessageBreak
    rect,oval,rules,drules,noframe:\space type of slideframe;
      \MessageBreak
    newpage,nonewpage:\space yes/no start slide on new page;
      \MessageBreak
    smallnotes:\space notes one notch smaller}}
%    \end{macrocode}
%
% \subsection{Slides and/or Notes}
%
% \begin{macro}{\ifnotes}
% \begin{macro}{\ifslides}
% \begin{macro}{\ifminis}
% Flag |\ifnotes| governs the production of notes in the
% typesetting of slides and notes, 
% flag |\ifslides| signals the typesetting of slides only
% and |\ifminis| is for the production of a smallsized slide collection.
% Options |notes|, |slides| and |minis| perform the selection
% of these modes.
%
%    \begin{macrocode}
\newif\ifnotes
\newif\ifslides
\newif\ifminis
\DeclareOption{notes}{\notestrue\minisfalse\slidesfalse}
\DeclareOption{slides}{\notesfalse\minisfalse\slidestrue}
\DeclareOption{minis}{\notesfalse\ministrue\slidesfalse}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \subsection{Portrait or Landscape Orientation}
%
% \begin{macro}{\iflandscape}
% Typesetting of slides can come in portrait or landscape format;
% even mixing of these within one document is possible.
%
%    \begin{macrocode}
\newif\iflandscape
\DeclareOption{landscape}{\landscapetrue}
\DeclareOption{portrait}{\landscapefalse}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ifmixed}
% \begin{macro}{\ifanti}
% The next series of flags control the production of mixed portrait\slash
% landscape slides or runs with one orientation only.
%
% With the |mixed| option one may mix portrait and landscape
% oriented slides. If a slide has an orientation differing
% from the one currently in effect (from the landscape and
% portrait class option), it will be rotated over 90 degrees.
% This however, requires the presence of one of the graphics
% styles (\emph{graphics.sty} or \emph{graphicx.sty}) and
% a conforming printer driver.
% If one of these styles is not already present, one 
% will be loaded at the start of the document.
%
% The |unmixed| option is for the case where rotation is
% not possible (as for ex. the native OzTeX printer driver)
% or not wanted. Only slides conforming to the current
% orientation are typeset. E.g. if landscape format is chosen, 
% then all slides produced from the environments |landscapeslide|
% and the neutral |slide| are done, those of |portraitslide| are skipped.
% If there are any slides skipped,
% then a warning will be issued and the job must be rerun with
% the |anti| option; this will produce the
% missing slides in the complementary orientation.
% The |anti| option can coexist with the |unmixed| option.
%
%    \begin{macrocode}
\newif\ifmixed
\newif\ifanti
\DeclareOption{mixed}{\mixedtrue\antifalse}
\DeclareOption{unmixed}{\mixedfalse}
\DeclareOption{anti}{\mixedfalse\antitrue}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \subsection{Vertical Centering of Slide Material}
%
% \begin{macro}{\ifcenter}
% \begin{macro}{\ifsqueeze}
% Everything below the title at the head of the slide can
% be centered vertically as well as kept tightly below the
% head, the options |center| and |nocenter| accomplish this. 
% Filling will be done with |\vfil|, thereby allowing it
% to be overridden simply by the inclusion of a |\vfill|.
% Furthermore one can |squeeze| the slidebox to minimal height
% for the slides + notes combination.
%
%    \begin{macrocode}
\newif\ifcenter
\newif\ifsqueeze
\DeclareOption{center}{\squeezefalse\centertrue}
\DeclareOption{nocenter}{\squeezefalse\centerfalse}
\DeclareOption{squeeze}{\squeezetrue\centerfalse}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \subsection{Suppress Newpage with Slide}
%
% \begin{macro}{\ifnewpage}
% In typesetting notes it may be usefull to suppress the
% newpage at the beginning of a slide.
% This option has effect in note production only.
%
%    \begin{macrocode}
\newif\ifnewpage
\DeclareOption{newpage}{\newpagetrue}
\DeclareOption{nonewpage}{\newpagefalse}
%    \end{macrocode}
% \end{macro}
%
% \subsection{Notes in Smaller Type}
%
% \begin{macro}{\ifsmallnotes}
% The \texttt{smallnotes} option switches the font set
% in the notes one notch smaller than the standard
% sizes chosen in the style. The sizes in the slides
% are always those specified by the style.
%
%    \begin{macrocode}
\newif\ifsmallnotes
\smallnotesfalse
\DeclareOption{smallnotes}{\smallnotestrue}
%    \end{macrocode}
% \end{macro}
%
% \subsection{Variation in Slideframe}
%
% \begin{macro}{\framevariant}
% The frame of a slide can be rectangular, oval,
% delineated by rules or empty.
%
%    \begin{macrocode}
\newcommand*\framevariant{}
\DeclareOption{noframe}{\renewcommand*\framevariant{n}}
\DeclareOption{rules}{\renewcommand*\framevariant{r}}
\DeclareOption{drules}{\renewcommand*\framevariant{d}}
\DeclareOption{rect}{\renewcommand*\framevariant{f}}
\DeclareOption{oval}{\renewcommand*\framevariant{o}}
%    \end{macrocode}
% \end{macro}
%
% The |\obox| macro is in file \texttt{obox.sty};
% if necessary it is read when document processing starts.
%
%    \begin{macrocode}
\AtBeginDocument{\@ifundefined{obox}%
  {\IfFileExists{obox.sty}{\RequirePackage{obox}}%
    {\if\framevariant o
    \ClassWarningNoLine{slidenotes}{oval option disabled}%
    \renewcommand*\framevariant{f}\fi}}%
  {}}
%    \end{macrocode}
%
% \begin{macro}{\ovalslideframerule}
% An oval slideframe is drawn using LaTeX's picture command.
% Therefore the range of linethicknesses is restricted to
% those provided by the circle fonts. The following macro
% is defined to one of the standard linethickness commands.
%
%    \begin{macrocode}
\newcommand*\ovalslideframerule{\thicklines}
%    \end{macrocode}
% \end{macro}
%
% \subsection{Pass Options and Load Parent Class}
%
% \begin{macro}{\parentclass}
% Since the \emph{slidenotes class} is implemented as a modification
% of an existing document class, we must load the parent class.
% However in order to ease changes in parent class the
% name of this class is parametrized in macro |\parentclass|.
% An obvious candidate is \emph{report} or friends.
%
% Customize with a definition of |\parentclass| before
% calling |\documentclass|.
%
%    \begin{macrocode}
\providecommand\parentclass{report}
%    \end{macrocode}
% \end{macro}
%
% Set the class defaults.
%
%    \begin{macrocode}
\ExecuteOptions{notes,portrait,mixed,rect,center,newpage}
%    \end{macrocode}
%
% The options of the |\documentclass| call which are not specific for the
% \emph{slidenotes class} must be passed to the parent class.
% We take the opportunity to select some defaults, e.g.
% production of a titlepage in case the parent class is \emph{article}.
%
%    \begin{macrocode}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{\parentclass}}
\PassOptionsToClass{titlepage,a4paper}{\parentclass}
\ProcessOptions
%    \end{macrocode}
%
% After this we load the parent class.
% Note that the landscape option is not passed if \texttt{notes}
% is also specified.
% For the production of skipped slides we may also need
% landscaped printing.
%
%    \begin{macrocode}
\iflandscape\ifnotes\else
  \PassOptionsToClass{landscape}{\parentclass}%
\fi\fi
\LoadClass{\parentclass}
%    \end{macrocode}
%
% Show some of the options chosen.
%
%    \begin{macrocode}
\ClassWarningNoLine{slidenotes}{%
  \iflandscape LANDSCAPE\else PORTRAIT\fi
  \space SLIDES\space
  \ifminis COLLECTION \fi \ifnotes + NOTES \fi
  PRODUCTION}
%    \end{macrocode}
%
% \section{Some Useful Macros}
%
% We define some helpfull macros first, as we need them later on.
% Defining is with |\providecommand| just in case the parent class
% has already loaded them.
%
% \begin{macro}{\@swapdimens}
% This macro swaps two dimens with the help of a third.
%
%    \begin{macrocode}
\providecommand*\@swapdimens[3]{#3=#1 #1=#2 #2=#3\relax}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@ifemptyarg}
% Testing for the presence or absence of a parameter.
%
%    \begin{macrocode}
\providecommand{\@ifemptyarg}[1]{% {absence}{presence}
  \ifx\@empty#1\@empty
  \expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}
%    \end{macrocode}
% \end{macro}
%
% \subsection{Postprocessing of Options}
%
% Reset the squeeze option to false when slides or minis are produced.
% This is done to prevent the slide numbering jumping up and down.
%
%    \begin{macrocode}
\ifminis\squeezefalse\fi
\ifslides\squeezefalse\fi
%    \end{macrocode}
%
% Production of notes turns |mixed| on and |anti| off.
% When typesetting notes, no rotation on the part of the
% dvi driver is required; both can be displayed.
%
%    \begin{macrocode}
\ifnotes\mixedtrue\antifalse\fi
%    \end{macrocode}
%
% When the skipped slides are in production we must effectively
% change the orientation from landscape to portrait or vice versa.
%
%    \begin{macrocode}
\ifanti
  \iflandscape\landscapefalse\else\landscapetrue\fi
  \ClassWarningNoLine{slidenotes}{ANTI OPTION => ORIENTATION CHANGED}
\fi
%    \end{macrocode}
%
% \DescribeEnv{verbatim}
% We need the \emph{verbatim.sty} for skipping portions of the text.
%
%    \begin{macrocode}
\RequirePackage{verbatim}
%    \end{macrocode}
%
% \DescribeMacro{\rotatebox}
% We need the |\rotatebox| macro in case of mixed slides or minis;
% if necessary load \emph{graphics.sty}.
% We are even prepared for the case where this file cannot be found.
%
%    \begin{macrocode}
\ifmixed\ifnotes\else
  \AtBeginDocument{%
    \@ifundefined{rotatebox}%
      {\IfFileExists{graphics.sty}%
        {\RequirePackage{graphics}}%
        {\mixedfalse}%
      }{}}
\fi\fi
%    \end{macrocode}
%
% \section{Dimensions}
%
% \begin{macro}{\slidewidth}
% \begin{macro}{\slideheight}
% We give default values for height and width in portrait format,
% |\slideheight| and |\slidewidth| respectively. 
% In the initialization section the landscape format is set
% by an exchange of height and width. Please note that
% these values are set for slides production: magnified values.
% They will be automatically diminished when slides \&\ notes are made.
% All other dimensions (frame separation, linethickness, etc.)
% must be given unmagnified values, just as one would do in
% normal typesetting.
%
%    \begin{macrocode}
\newlength\slidewidth
\newlength\slideheight
\setlength\slidewidth{176mm}
\setlength\slideheight{248mm}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\slidemagnification}
% For the production of the slides the magnification is set to
% |\slidemagnification|.
%
%    \begin{macrocode}
\newcommand*\slidemagnification{\magstep4}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\slideboxrule}
% \begin{macro}{\slideboxsep}
% \begin{macro}{\slidenotesep}
% \begin{macro}{\slidetitlesep}
% Furthermore we define special parameters for the
% separation between frame and contents of the slide,
% |\slideboxsep| and for the thickness of the frame, |\slideboxrule|.
% Length |\slidenotesep| is the distance between the slide
% and the note, |\slidetitlesep| the skip below a call of
% a (sub)title macro.
%
%    \begin{macrocode}
\newlength\slideboxrule
\newlength\slideboxsep
\newlength\slidenotesep
\newlength\slidetitlesep
\setlength\slideboxrule{.2mm}
\setlength\slideboxsep{3mm}
\setlength\slidenotesep{8mm}
\setlength\slidetitlesep{\z@}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \section{Registers}
% 
% \begin{macro}{\slidecounter}
% The slides are counted and the counter is reset whenever
% a new chapter is begun, if there is a chapter structure, of course.
%
%    \begin{macrocode}
\@ifundefined{c@chapter}%
  {\newcounter{slidecounter}}%
  {\newcounter{slidecounter}[chapter]}
%    \end{macrocode}
% \end{macro}
% 
% \begin{macro}{\missedslidecounter}
% If we have both the |mixed| and |anti| options off we must
% keep count of the number of slides passed over.
% Always define this counter, it may be present in the auxiliary
% files from a previous run.
% We cannot use the standard \LaTeX's |\newcounter| command, because the
% the value reported will be the value produced by the last
% included file; the reason being the recording of the counter
% in the auxiliary files. Therefore we use plain \TeX's |\newcount|.
%
%    \begin{macrocode}
\newcount\missedslidecounter
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\minicounter}
% Minis come just four to a page, therefore we count them.
%
%    \begin{macrocode}
\newcounter{minicounter}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\slidebox}
% Slides are typeset in a box for later placement and
% height adjustement.
%
%    \begin{macrocode}
\newsavebox\slidebox
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\slidemarker}
% Slides are marked by a text and a number. The text by
% default comes from the |\chapter| macro and is put into
% a token register named |\slidemarker|.
% In the article style, however there is no chapter structure.
% There we intialize this
% token register from the |\title|; note that we need to do this
% at |\begin{document}|, because |\maketitle| interfers
% by setting |\@title| empty.
%
%    \begin{macrocode}
\newtoks\slidemarker
\AtBeginDocument{%
  \@ifundefined{@title}{\def\@title{\Collection}}{}%
  \slidemarker={\@title}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\everyslide}
% \begin{macro}{\everynote}
% At the start of each slide a token register |\everyslide| is executed,
% where the user can place settings that should be local to each slide. 
% The same for the start of each note where |\everynote| is executed.
%
%    \begin{macrocode}
\newtoks\everyslide
\newtoks\everynote
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \section{Note Environment}
%
% \begin{environment}{note}
% In case of productions of slides the notes are simply left out;
% we effectuate this with the comment mechanism of the
% \emph{verbatim.sty}. Otherwise the material in
% the \texttt{note} environment is typeset.
% The environment for notes is started with font selections;
% the fontsize is initialized to normalsize, but all
% sizes are set one notch down for the |smallnotes| option.
% Execution starts the note with the code in token register |\everynote|.
%
%    \begin{macrocode}
\ifnotes
\newenvironment{note}[1][]{%
  \notesfont
  \ifsmallnotes\smallersizes\fi
  \normalsize
  \the\everynote
%    \end{macrocode}
%
% Separate slide and note with some whitespace.
%
%    \begin{macrocode}
  \addvspace{\slidenotesep}%
%    \end{macrocode}
%
% We use the \texttt{list} environment for offsetting
% the margin inside the notes, a variation on the
% \texttt{quote} environment. However, the leftmargin is
% reduced to zero, because we do not want extra indentation
% for the text of the notes.
%
%    \begin{macrocode}
  \list{}{\leftmargin=\z@ 
  	\rightmargin=\marginwidth
  	\parsep=\parskip}\item[]
%    \end{macrocode}
%
% Finish the \texttt{note} environment, close page with a filler
% when newpage option is in effect.
%
%    \begin{macrocode}
  \ignorespaces}{\endlist\ifnewpage\vfill\fi}
%    \end{macrocode}
%
% If notes are not wanted, |\let| the |note| environment to |comment|.
%
%    \begin{macrocode}
\else
  \let\note=\comment
  \let\endnote=\endcomment
\fi
%    \end{macrocode}
% \end{environment}
%
% \begin{macro}{\smallersizes}
% This macro switches all of \LaTeX's sizes one notch down (except
% for |\tiny|, the smallest size).
%
%    \begin{macrocode}
\newcommand*\smallersizes{%
  \let\Huge\huge
  \let\huge\LARGE
  \let\LARGE\Large
  \let\Large\large
  \let\large\normalsize
  \let\normalsize\small
  \let\small\footnootsize
  \let\footnotesize\scriptsize
  \let\scriptsize\tiny
  }
%    \end{macrocode}
% \end{macro}
%
% \section{Slide Environment}
%
% \subsection{Slide Orientation}
%
% \begin{environment}{portraitslide}
% \begin{environment}{landscapeslide}
% \begin{environment}{slide}
% Here we differentiate between the various possibilities
% for the slide orientation.
% Note that we set a flag for the current orientation
% in order to allow orientation dependent code.
%
% First the case of mixed orientations.
%
%    \begin{macrocode}
\ifmixed
\newenvironment{portraitslide}{%
  \landscapeslidefalse
  \iflandscape\@swapdimens\slideheight\slidewidth\@tempdima
  \fi
  \@slide}{\@endslide
  \iflandscape\putslide{90}\else\putslide{0}\fi}
\newenvironment{landscapeslide}{%
  \landscapeslidetrue
  \iflandscape\else\@swapdimens\slideheight\slidewidth\@tempdima
  \fi
  \@slide}{\@endslide
  \iflandscape\putslide{0}\else\putslide{90}\fi}
\newenvironment{slide}{\@slide}{\@endslide\putslide{0}}
%    \end{macrocode}
%
% Secondly the case where missed slides are produced. 
% A tricky point here is that we have already complemented the
% value of |\iflandscape|; therefore no dimensions
% have to be interchanged and the tests all seem
% to point the wrong way.
%
%    \begin{macrocode}
\else\ifanti
\newenvironment{portraitslide}{%
  \landscapeslidefalse
  \iflandscape
    \refstepcounter{slidecounter}%
    \let\@slide=\comment\let\@endslide=\endcomment
  \fi
  \@slide}{\@endslide
  \iflandscape\else\putslide{0}\fi}
\newenvironment{landscapeslide}{%
  \landscapeslidetrue
  \iflandscape\else
    \refstepcounter{slidecounter}%
    \let\@slide=\comment\let\@endslide=\endcomment
  \fi
  \@slide}{\@endslide
  \iflandscape\putslide{0}\fi}
\newenvironment{slide}{%
  \refstepcounter{slidecounter}%
  \let\@slide=\comment\let\@endslide=\endcomment
  \@slide}{\@endslide}
%    \end{macrocode}
%
% Finally the case of separate slide orientation.
% A skipped slide must be counted always in |slidecounter|
% in order to keep the numbers straight and is also recorded
% in |missedslidecounter|; the |comment| environment
% is used to get rid of a skipped slide.
%
%    \begin{macrocode}
\else
\newenvironment{portraitslide}{%
  \landscapeslidefalse
  \iflandscape
    \refstepcounter{slidecounter}%
    \global\advance\missedslidecounter\@ne
    \let\@slide=\comment\let\@endslide=\endcomment
  \fi
  \@slide}{\@endslide
  \iflandscape\else\putslide{0}\fi}
\newenvironment{landscapeslide}{%
  \landscapeslidetrue
  \iflandscape\else
    \refstepcounter{slidecounter}%
    \global\advance\missedslidecounter\@ne
    \let\@slide=\comment\let\@endslide=\endcomment
  \fi
  \@slide}{\@endslide
  \iflandscape\putslide{}\fi}
\newenvironment{slide}{\@slide}{\@endslide\putslide{0}}
\fi\fi
%    \end{macrocode}
% \end{environment}
% \end{environment}
% \end{environment}
%
% And then we have to report if there are any skipped slides.
%
%    \begin{macrocode}
\ifmixed\else\ifanti\else
\AtEndDocument{\ifnum\missedslidecounter>\z@
  \ClassWarningNoLine{slidenotes}{Rerun with `anti'
  for \the\missedslidecounter\space slide(s) skipped}%
  \fi}
\fi\fi
%    \end{macrocode}
%
% \subsection{Placing a Slide}
%
% \begin{macro}{\putslide}
% The positioning of a slide is split off from its
% production in the following macro.
% We define this positioning differently for the
% various production schemes.
%
%    \begin{macrocode}
\ifnotes
  \newcommand*\putslide[1]{\noindent\rputslide{#1}\par}
\fi
\ifslides
  \newcommand*\putslide[1]{\begin{center}\rputslide{#1}\end{center}}
\fi
\ifminis
  \newcommand*\putslide[1]{\noindent
    \rputslide{#1}%
    \stepcounter{minicounter}%
      \ifnum\value{minicounter}=2
        \par
      \else\ifnum\value{minicounter}=4
        \newpage\setcounter{minicounter}{0}%
      \else\hfil\fi\fi}
\fi
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\rputslide}
% We alse need variants in accordance with the need of slide rotation.
%
%    \begin{macrocode}
\newcommand*\rputslide[1]{\usebox{\slidebox}}
\ifmixed\ifnotes\else
  \renewcommand*\rputslide[1]{%
    \ifnum#1=\z@\usebox{\slidebox}%
    \else\rotatebox{#1}{\kern-.5\slidewidth\usebox{\slidebox}}%
    \fi}
\fi\fi
%    \end{macrocode}
% \end{macro}
%
% \subsection{Typeset Slide Contents}
%
% \begin{macro}{\@slide}
% Slides are collected between |\@slide| and |\@endslide|.
% Each slide starts a new page, except when a collection is made
% or possibly in note production.
% We program the |\newpage| here in order to get the pagenumbering
% in the table of contents right.
% The font is set to the special chosen |\slidefont|.
% The fontsize is initialized to the normal size.
% From the optional argument the title is put into the \emph{toc} file.
%
% \subsubsection{Starting a Slide}
%
%    \begin{macrocode}
\newcommand*\@slide[1][]{%
	\ifnotes
		\ifnewpage\newpage\else\addvspace{\bigskipamount}\fi
	\else
		\ifminis\else\newpage\fi
	\fi
  \refstepcounter{slidecounter}%
  \slidefont
  \normalsize
%    \end{macrocode}
%
% Write a line to the \emph{.toc} file when notes are in production.
%
%    \begin{macrocode}
\ifnotes
  \@ifemptyarg{#1}%
    {\addcontentsline{toc}{section}{\Slide\,\theslidecounter}}%
    {\addcontentsline{toc}{section}{#1}}%
\fi
%    \end{macrocode}
%
% The contents of the slide is typeset in a \texttt{minipage},
% which is captured in a box. 
% Execution starts the box with the code in token register |\everyslide|.
% When the optional argument is not empty, this
% furnishes the slide title at its top.
% The width of the \texttt{minipage}, in which the contents of
% the slide are typeset,
% is the |\slidewidth| adjusted for the thickness of the
% surrounding frame and the separation between frame and contents.
%
%    \begin{macrocode}
  \@tempdima\slidewidth
  \advance\@tempdima-\tw@\slideboxrule
  \advance\@tempdima-\tw@\slideboxsep
  \@tempdimb\slideheight
  \advance\@tempdimb-\tw@\slideboxrule
  \advance\@tempdimb-\tw@\slideboxsep
  \begin{lrbox}{\slidebox}%
    \the\everyslide
    \ifsqueeze
        \begin{minipage}{\@tempdima}%
    \else
        \begin{minipage}[][\@tempdimb][t]{\@tempdima}%
    \fi
%    \end{macrocode}
%
% We want to find out the height of the slide, therefore
% we catch the slide contents in a |\vbox|.
%
%    \begin{macrocode}
     \setbox\@tempboxa=\vbox\bgroup\leavevmode
     \@ifemptyarg{#1}{}{\slidetitle{#1}}\ifcenter\vfil\fi
     \ignorespaces}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{Finishing a Slide}
%
% \begin{macro}{\@endslide}
% In the second part of slide typesetting we construct the slide.
%
%    \begin{macrocode}
\newcommand*\@endslide{%
%    \end{macrocode} 
%
% First we do vertical centering with |\vfil| if required.
%
%    \begin{macrocode}
  \ifcenter\vfil\fi
%    \end{macrocode} 
%
% Here we close the catching box and check its height.
%
%    \begin{macrocode}
    \egroup
    \chk@slideheight\@tempboxa
    \unvbox\@tempboxa
    \end{minipage}\end{lrbox}%
%    \end{macrocode}
%
% The slide contents are enclosed in a framed box and
% then together with the marker placed into a |\parbox|.
% The height of the box is
% adjusted to slideheight minus frame.
% The complete slide is again captured in |\slidebox| because
% we may want to subject it to a rotation.
%
%    \begin{macrocode}
  \sbox\slidebox{\parbox{\slidewidth}{%
    \fboxsep\slideboxsep
    \fboxrule\slideboxrule
    \csname frame@\framevariant\endcsname
    \\*[\smallskipamount]
    \makebox[\slidewidth]{%
      \small\strut\the\slidemarker
      \hfil\Slidenumber~\theslidecounter}%
  }}}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{Framing a Slide}
%
% \begin{macro}{\frame@f}
% Rectangular box around slide contents.
%    \begin{macrocode}
\newcommand*\frame@f{%
  \fbox{\usebox\slidebox}%
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\frame@o}
% Oval box around slide contents.
%    \begin{macrocode}
\newcommand*\frame@o{%
  \@tempdimb\dp\slidebox
  \advance\@tempdimb-\fboxsep
  \advance\@tempdimb-\fboxrule
  \obox[][\ovalslideframerule]{%
    \raisebox{\@tempdimb}{\usebox\slidebox}}%
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\frame@n}
% Nothing around slide contents.
%    \begin{macrocode}
\newcommand*\frame@n{%
  \advance\fboxsep\fboxrule \fboxrule\z@
  \fbox{\usebox\slidebox}%
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\frame@r}
% Rule above and below slide contents.
%    \begin{macrocode}
\newcommand*\frame@r{%
  \rule{\slidewidth}{\fboxrule}\\*[\fboxsep]%
  \usebox{\slidebox}\\*[\fboxsep]%
  \rule{\slidewidth}{\fboxrule}%
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\frame@d}
% Double rules above and below slide contents.
%    \begin{macrocode}
\newcommand*\frame@d{%
  \rule{\slidewidth}{\fboxrule}\\*[\tw@\fboxrule]%
  \rule[\baselineskip]{\slidewidth}{\fboxrule}%
    \vspace{-\baselineskip}\\*[\fboxsep]%
  \usebox{\slidebox}\\*[\fboxsep]%
  \rule{\slidewidth}{\fboxrule}\\*[\tw@\fboxrule]%
  \rule[\baselineskip]{\slidewidth}{\fboxrule}%
    \vspace{-\baselineskip}%
  }
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{Check Slide Height}
%
% \begin{macro}{\chk@slideheight}
% Here we define the macro that checks the height of slides and
% gives a warning when overfilling occurs. 
% Keep the changes to |\dimen@| local by grouping.
%
%    \begin{macrocode}
\newcommand*\chk@slideheight[1]{{%
  \dimen@\ht#1
  \advance\dimen@\dp#1
  \ifnum\dimen@>\slideheight
    \ClassWarning{slidenotes}{slide too high by \the\dimen@}%
  \fi}}
%    \end{macrocode}
% \end{macro}
%
% \subsection{Titles on Slides}
%
% \begin{macro}{\slidetitle}
% \begin{macro}{\slidesubtitle}
% Put centered title or subtitle on the slide.
% The first (and optional) argument controls the font setting.
% These titles are followed by a |\medskip|; whitespace before
% the title is the responsibility of the slidewriter.
% These titles are suppressed if their argument somehow
% turns out to be empty.
%
%    \begin{macrocode}
\newcommand*\slidetitle{\@slidetitle{\slidetitlefont}}
\newcommand*\slidesubtitle{\@slidetitle{\slidesubtitlefont}}
\newcommand*\@slidetitle[2]{%
    \@ifemptyarg{#2}{}%
        {\begin{center}#1#2\end{center}\vspace{\slidetitlesep}}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \subsection{Slideformat Dependent Typesetting}
%
% \begin{macro}{\iflandscapeslide}
% Here we define a flag to be used for the implementation
% of format dependent code selection.
% This flag is initialized to the current default orientation.
%
%    \begin{macrocode}
\newif\iflandscapeslide
\iflandscape\landscapeslidetrue\else\landscapeslidefalse\fi
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\portraitonly}
% \begin{macro}{\landscapeonly}
% Material can be selected on the basis the slide's format,
% portrait or landscape orientation with respectively:\\
% |\landscapeonly{...}|\\
% |\portraitonly{...}|\\
% For example, where a list can be placed without any difficulty
% on a portrait slide, it may require the use of |multicols|
% in landscapeformat.
% If problems arise, e.g. with the fixing of catcodes, then use the
% basic construction
% |\iflandscapeslide .. \else ..\fi|
%
%    \begin{macrocode}
\newcommand\landscapeonly[1]{\iflandscapeslide#1\fi}
\newcommand\portraitonly[1]{\iflandscapeslide\else#1\fi}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \subsection{Cues in the Margin}
%
% \begin{macro}{\marginwidth}
% The length variable |\marginwidth| holds the margin space
% that will be reserved for short remarks.
%
%    \begin{macrocode}
\newlength\marginwidth
\setlength\marginwidth{3cm}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\cue}
% Giving short remarks in the margin of the notes text.
% To be used for finding specific text parts with a glance.
%
%    \begin{macrocode}
\newcommand*\cue[2][\cuefont]{%
  \marginpar{\hspace*{-\marginwidth}%
  \parbox{\marginparwidth}{\raggedright\sloppy#1#2}}}
%    \end{macrocode}
% \end{macro}
%
% |\cue| cannot allow marginpar switching from left to
% right margin when typesetting twosided material; therefore
% force all marginpars into the same margin.
%
%    \begin{macrocode}
\@mparswitchfalse
%    \end{macrocode}
%
% \section{Style Features}
%
% \subsection{Redefine Chapter Code}
%
% In order to process the slide marking
% two macro's in the production of chapter heads are redefined.
% Also a new chapter starts a new page and the
% pagestyle for this page is set to \texttt{empty}.
%
%    \begin{macrocode}
\@ifundefined{c@chapter}{}{%
  \let\old@makechapterhead=\@makechapterhead
  \let\old@makeschapterhead=\@makeschapterhead
  \renewcommand*\@makechapterhead[1]{%
    \global\slidemarker={#1}\old@makechapterhead{#1}%
    \thispagestyle{empty}\newpage}%
  \renewcommand*\@makeschapterhead[1]{%
    \global\slidemarker={#1}\old@makeschapterhead{#1}%
    \thispagestyle{empty}\newpage}%
  }
%    \end{macrocode}
%
% \subsection{Pagestyle}
%
% Slides and minis want the \texttt{empty} style.
%
%    \begin{macrocode}
\ifnotes\else\pagestyle{empty}\fi
%    \end{macrocode}
%
% \subsection{Fonts}
%
% \begin{macro}{\headerfont}
% \begin{macro}{\slidefont}
% \begin{macro}{\notesfont}
% \begin{macro}{\footnotefont}
% \begin{macro}{\slidetitlefont}
% \begin{macro}{\slidesubtitlefont}
% \begin{macro}{\cuefont}
% Choose fonts for the various elements of slides and notes.
% Their names speak for themselves.
%
%    \begin{macrocode}
\newcommand*\headerfont{\rmfamily}
\newcommand*\slidefont{\sffamily}
\newcommand*\notesfont{\rmfamily}
\newcommand*\footnotefont{\sffamily\mdseries\upshape}
\newcommand*\slidetitlefont{\Large\bfseries\boldmath}
\newcommand*\slidesubtitlefont{\normalsize\bfseries\boldmath}
\newcommand*\cuefont{\sffamily\bfseries\boldmath}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \section{Language Adjustments}
%
% \begin{macro}{\Collection}
% \begin{macro}{\Slidenumber}
% \begin{macro}{\Slide}
% We define some language specific verbs, such
% as |\Collection| and |\Slidenumber|.
% To be customized by redefinition in the configuration file.
%
%    \begin{macrocode}
\newcommand*\Collection{LECTURE NOTES}
\newcommand*\Slidenumber{\#}
\newcommand*\Slide{Slide}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \subsection{Example of Adjustements in Configuration File}
%
% Example of a configuration file with dutch equivalents
% for language dependent items.
%
%    \begin{macrocode}
%</cls>
%<*cfg>
\renewcommand*\Collection{COLLEGE AANTEKENINGEN}
\renewcommand*\Slidenumber{Nr.}
\renewcommand*\Slide{Transparant}
%</cfg>
%<*cls>
%    \end{macrocode}
%
% \section{Directory Localization}
%
% \begin{macro}{\CurrentDirectory}
% \begin{macro}{\DirectorySeparator}
% We can determine from |\@currdir| which
% character separates directories in a path name. 
% E.g. in UNIX this is |/| from the string |./|, but
% in the MacOS the current directory and the separator are both |:|.
% Therefore we extract from |\@currdir| the last character 
% (of two at most).\\
% Make |\CurrentDirectory| a synonyme for |\@currdir|.
%
%    \begin{macrocode}
\let\CurrentDirectory=\@currdir
\def\DirectorySeparator#1#2`\^^M{\@ifemptyarg{#2}{#1}{#2}}
\edef\DirectorySeparator{%
	\expandafter\DirectorySeparator\CurrentDirectory`\^^M}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\LastChar}
% Another macro delivers the last character of a string.
%
%    \begin{macrocode}
\providecommand*{\LastChar}[1]{%
  \@ifemptyarg{#1}{}{\expandafter\@lastchar#1`\^^M}}
\def\@lastchar#1#2`\^^M{\@ifemptyarg{#2}{#1}{\@lastchar#2`\^^M}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\DirectoryName}
% The next macro ensures that a path name ends correctly, when
% a filename is concatenated with it.
% If the directory separator character isn't the last character,
% it is added.
%
%    \begin{macrocode}
\providecommand*{\DirectoryName}[1]{\@ifemptyarg{#1}{}%
  {\if\LastChar{#1}\DirectorySeparator\relax#1\else
    #1\DirectorySeparator\fi}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\Setfolder}
% Macro |\Setfolder| can be used to install a standard
% folder (directory) name.
% E.g. a name |\figuresfolder| can be defined as the
% standard place for figures.
% Supply as first argument to |\Setfolder| the macro name
% for the folder. e.g. |\figuresfolder| and as second
% parameter its location on disk.
% Below three of these folders (here initialized 
% with empty names) are defined in the example configuration file.
%    \begin{macrocode}
\newcommand*\Setfolder[2]{\edef#1{\DirectoryName{#2}}}
%</cls>
%<*cfg>
\Setfolder{\mainfolder}{}
\Setfolder{\commonfolder}{}
\Setfolder{\figuresfolder}{}
%</cfg>
%<*cls>
%    \end{macrocode}
% \end{macro}
%
% \section{Read Configuration File}
%
% Last, but not least, see if there is a configuration
% file \texttt{slidenotes.cfg} and read it for the final adjustments.
% In this file one can change things like the
% font selection, size of various length variables, etc.
%
%    \begin{macrocode}
\InputIfFileExists{slidenotes.cfg}{}{}
%    \end{macrocode}
%
% \section{Process the Orientation Options}
%
% Final settings take place afterwards, because the variables
% involved may have been changed value in the configuration file.
%
% \subsection{Page Orientation}
%
% In case of landscape orientation the height and width of the page
% need to be exchanged for slides + notes, for slides
% in the anti orientation also.
% For notes we always use a portrait paperformat with 
% both portrait and landscape oriented slides on it.
%
%    \begin{macrocode}
\ifnotes
  \iflandscape\@swapdimens\paperheight\paperwidth\@tempdima\fi
\else
  \ifanti\@swapdimens\paperheight\paperwidth\@tempdima\fi
\fi
%    \end{macrocode}
%
% \subsection{Slide Dimensions and Orientation}
%
% At this point height and width of the slides are known
% in their final sizes. For the proces of typesetting they
% have to be reduced by the magnification applied later on.
%
%    \begin{macrocode}
\divide\slidewidth by\slidemagnification
\multiply\slidewidth by\@m
\divide\slideheight by\slidemagnification
\multiply\slideheight by\@m
%    \end{macrocode}
%
% In case of landscape format the height and width of slides
% need to be exchanged, because they are defined in portrait format.
%
%    \begin{macrocode}
\iflandscape\@swapdimens\slideheight\slidewidth\@tempdima\fi
%    \end{macrocode}
%
% \section{Shutoff Titles if Necessary}
%
% \begin{macro}{\maketitle}
% Kill the title and the chapter pages for slide production, 
% but not when a collection is prepared.
% Also allow for the fact that |\chapter| effects
% a change to pagestyle \texttt{plain}.
%
%    \begin{macrocode}
\ifslides
  \renewcommand\maketitle{}
  \@ifundefined{c@chapter}{}{%
    \renewcommand*\@makechapterhead[1]{\global\slidemarker={#1}%
      \thispagestyle{empty}}%
    \renewcommand*\@makeschapterhead[1]{\global\slidemarker={#1}%
      \thispagestyle{empty}}%
  }
\fi
%    \end{macrocode}
% \end{macro}
%
% Disable typesetting of the table of contents unless notes are
% in production.
%
%    \begin{macrocode}
\ifnotes\else\AtBeginDocument{\let\tableofcontents=\relax}\fi
%    \end{macrocode}
%
% \section{Page Dimensions}
%
% Here we do some calculations on sizes and set the variables
% to their proper values.
%
% \subsection{Fullsize Slides}
%
% First we typeset with an enlarged magnification.
%
%    \begin{macrocode}
\ifslides
  \mag\slidemagnification\relax
%    \end{macrocode}
%
% Horizontal dimensions:
%
%    \begin{macrocode}
  \setlength\hoffset{-1in}
    \divide\hoffset by\slidemagnification
    \multiply\hoffset by\@m
  \setlength\textwidth{\paperwidth}
    \divide\textwidth by\slidemagnification
    \multiply\textwidth by\@m
  \setlength\oddsidemargin{0pt}
  \setlength\evensidemargin{0pt}
%    \end{macrocode}
%
% Vertical dimensions:
%
%    \begin{macrocode}
  \setlength\voffset{-1in}
    \divide\voffset by\slidemagnification
    \multiply\voffset by\@m
  \setlength\headheight{0pt}
  \setlength\headsep{0pt}
  \setlength\textheight{\paperheight}
    \addtolength\textheight{-2\topmargin}
    \divide\textheight by\slidemagnification
    \multiply\textheight by\@m
\fi
%    \end{macrocode}
%
% \subsection{Collection of Slides}
%
%    \begin{macrocode}
\ifminis
  \setlength\headheight{0pt}
  \setlength\headsep{0pt}
  \setlength\footskip{0pt}
  \setbox\@tempboxa\vbox{\hbox{\slidefont\small\strut}\smallskip\null}
  \@tempdima=2\slidewidth
  \ifmixed
    \advance\@tempdima by 2\ht\@tempboxa
  \else
    \advance\@tempdima by 8mm
  \fi
  \ifdim\@tempdima>\textwidth \setlength\textwidth{\@tempdima}\fi
  \@tempdimb=2\slideheight
    \advance\@tempdimb by 2\ht\@tempboxa
  \ifdim\@tempdimb>\textheight
    \setlength\textheight{\@tempdimb}
    \@tempdimb\paperheight
    \advance\@tempdimb-\textheight
    \addtolength\topmargin{-\@tempdimb}
  \fi
  \setlength\oddsidemargin{0pt}
  \setlength\evensidemargin{0pt}
\fi
%    \end{macrocode}
%
% \subsection{Slides plus Notes}
%
% Change margin settings and enlarge |\marginparwidth|
% by the extra margin.
%
%    \begin{macrocode}
\ifnotes
  \setlength\marginparsep{5mm}
  \addtolength\marginparwidth{\marginwidth}
\fi
%    \end{macrocode}
%
% Initialize the font.
%
%    \begin{macrocode}
\notesfont
%</cls>
%    \end{macrocode}
%
% \section{Oval Macro's}
%
% Macro to translate dimensions\\ |#1{dimen}| or 
% |#1(number)| $\rightarrow$
% |#1{number\unitlength}|
%
%    \begin{macrocode}
%<*obox>
\ProvidesClass{obox}[1995/09/04 vs 1.2  Oval box change]
\def\@pickonedim#1{\@ifnextchar(%)
    {\@@pickonedim{#1}}{#1}}
\def\@@pickonedim#1(#2){#1{#2\unitlength}}
%    \end{macrocode}
%
% Redefinition of oval from the picture environment to\\
% |\oval[position](width,height)[optional lrtb=parts]|\\
% position parameter determis how oval will be placed:\\
% |o| midpoint (default as in LaTeX picture environment)\\
% |t| top of oval at baseline\\
% |b| bottom of oval at baseline\\
% |c| halfheight of oval at baseline\\
% |n| neutral placement
%
%    \begin{macrocode}
\gdef\oval{\@ifnextchar[%]
    {\@oval}{\@oval[o]}}
\gdef\@oval[#1](#2,#3){\@ifnextchar[%]
    {\@@oval[#1](#2,#3)}{\@@oval[#1](#2,#3)[]}}
\gdef\@@oval[#1](#2,#3)[#4]{\begingroup\boxmaxdepth \maxdimen
  \@ovttrue \@ovbtrue \@ovltrue \@ovrtrue
  \@tfor\reserved@a :=#4\do{\csname @ov\reserved@a false\endcsname}%
  \@ovxx #2\unitlength \@ovyy #3\unitlength
  \@tempdimb \ifdim\the@ovalradius=\z@
    \ifdim \@ovyy >\@ovxx \@ovxx \else \@ovyy \fi
    \else \the@ovalradius \fi
  \advance \@tempdimb -\tw@\p@
  \@getcirc \@tempdimb
  \@ovro \ht\@tempboxa \@ovri \dp\@tempboxa
  \@ovdx\@ovxx \advance\@ovdx -\@tempdima \divide\@ovdx \tw@
  \@ovdy\@ovyy \advance\@ovdy -\@tempdima \divide\@ovdy \tw@
  \@circlefnt \setbox\@tempboxa
  \hbox{\if@ovr \@ovvert32\kern -\@tempdima \fi
  \if@ovl \kern \@ovxx \@ovvert01\kern -\@tempdima \kern -\@ovxx \fi
  \if@ovt \@ovhorz \kern -\@ovxx \fi
  \if@ovb \raise \@ovyy \@ovhorz \fi}%
  \advance\@ovdx\@ovro \advance\@ovdy\@ovro 
  \if#1t\@ovdx\z@\@ovdy\tw@\@ovdy\fi
  \if#1b\@ovdx\z@\@ovdy\z@\fi
  \if#1c\@ovdx\z@\fi
  \if#1n\@ovdx\z@\@ovdy\dp\@tempboxa\fi
  \ht\@tempboxa\z@ \dp\@tempboxa\z@
  \@put{-\@ovdx}{-\@ovdy}{\box\@tempboxa}%
  \endgroup}
%    \end{macrocode}
%
% Oval analogon of |\fbox| is added:\\
% |\obox[optional ovalradius(length)][linethickness-cmd]{box-contents}|
%
%    \begin{macrocode}
\def\obox{\@ifnextchar[%]
    {\@obox}{\@@obox[][]}}
\def\@obox[#1]{\@ifnextchar[%]
    {\@@obox[#1]}{\@@obox[#1][]}}
\def\@@obox[#1][#2]#3{%
  \begingroup
    \@ifemptyarg{#1}{}{\ovalradius{#1}}%
    \setbox\z@\hbox{\advance\fboxsep\@wholewidth \fboxrule\z@ \fbox{#3}}%
    \dimen@\ht\z@ \advance\dimen@\dp\z@ #2\let\unitlength\@empty
    \leavevmode\oval[n](\wd\z@,\dimen@)\box\z@
  \endgroup}
\def\ovalradius{\@pickonedim\@ovalradius}
\def\@ovalradius#1{\@tempdima#1\relax
    \edef\the@ovalradius{\number\@tempdima sp}\ignorespaces}
\def\ovalfraction#1{%
    \edef\the@ovalradius{#1\noexpand\@tempdimb}\ignorespaces}
\ovalradius{0pt}                % initialisation
%</obox>
%    \end{macrocode}
% \Finale
%