summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/HA-prosper/HA-prosper.dtx
blob: 61ffb880fc53cd8cf01ccc7e0b37e8d17b9d3fd4 (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
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
% \iffalse meta-comment
%
% HA-prosper package by Hendri Adriaens.
%
% Extract package files and create documentation:
%   `latex HA-prosper.dtx'
%   `latex HA-prosper.dtx'
%   `makeindex -s gind.ist HA-prosper.idx'
%   `latex HA-prosper.dtx'
%   `latex HA-prosper.dtx'
%
% To generate source code documentation as well,
% first comment line 57 of this file.
%
% To finish the installation you have to move the following
% files into a directory searched by TeX:
%    HA-prosper.sty
%    HA-prosper.cfg
%
%% ------------------------------------------
%% Copyright (C) 2003-2005 by Hendri Adriaens
%% ------------------------------------------
%%
%% This file may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.2
%% of this license or (at your option) any later version.
%% The latest version of this license is in:
%%
%%    http://www.latex-project.org/lppl.txt
%%
%% and version 1.2 or later is part of all distributions of LaTeX
%% version 1999/12/01 or later.
%%
% \fi
%
% \iffalse
%<*batchfile>
\begingroup
\input docstrip.tex
\keepsilent
\preamble
\endpreamble
\askforoverwritefalse
\IfFileExists{.///HA-prosper.sty}{}{
\generate{
\file{HA-prosper.sty}{\from{HA-prosper.dtx}{program}}
\file{HA-prosper.cfg}{\from{HA-prosper.dtx}{config}}
}}
\endgroup
%</batchfile>
%<*driver>
\documentclass[a4paper]{ltxdoc}
\input{HA-prosper.def}
\EnableCrossrefs
\CodelineIndex
% Comment the next line to generate source code documentation.
\OnlyDescription
\begin{document}
\DocInput{HA-prosper.dtx}
\end{document}
%</driver>
% \fi
%
% \CheckSum{2292}
%
% \DoNotIndex{\def,\xdef,\edef,\global,\gdef,\let,\if,\fi,\else}
% \DoNotIndex{\newcommand,\newenvironment,\renewcommand,\renewenvironment}
% \DoNotIndex{\begin,\end,\ifx,\ifnum}
%
% \CharacterTable
%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%   Digits        \0\1\2\3\4\5\6\7\8\9
%   Exclamation   \!     Double quote  \"     Hash (number) \#
%   Dollar        \$     Percent       \%     Ampersand     \&
%   Acute accent  \'     Left paren    \(     Right paren   \)
%   Asterisk      \*     Plus          \+     Comma         \,
%   Minus         \-     Point         \.     Solidus       \/
%   Colon         \:     Semicolon     \;     Less than     \<
%   Equals        \=     Greater than  \>     Question mark \?
%   Commercial at \@     Left bracket  \[     Backslash     \\
%   Right bracket \]     Circumflex    \^     Underscore    \_
%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%   Right brace   \}     Tilde         \~}
%
%\title{\vspace{-2em}\pf{HA-prosper} package\\\normalsize\emph{Documentation}\\
%\vspace{.5em}Version 4.21}
%\author{Hendri Adriaens\\
%\url{http://stuwww.uvt.nl/~hendri/downloads/haprosper.html}\\Center
%for Economic Research\\Tilburg University, the Netherlands}
%\maketitle\tableofcontents\listoftables\listoffigures
%
%\clearpage\section{General information} This manual provides
%information about working with the \pf{HA-prosper} package. This
%package is a patch for the \pf{prosper} class. Be sure to also study
%the documentation of the \pf{prosper} class and the \pf{hyperref}
%package. You can find this documentation for instance at the CTAN
%site for prosper \cite{prosperCTAN}, at the \pf{prosper} website
%\cite{prosper} or in your local \LaTeX\ distribution (for the MiKTeX
%distribution \cite{MiKTeX}, the documentation can be found in the
%|doc| directory in the MiKTeX root). Information about \pf{prosper}
%can also be found at the WikiProsper site \cite{WikiProsper}.
%
%If you want to start working with \pf{HA-prosper} immediately, have
%a look at the examples (see section~\ref{sec:examples}). If you are
%interested in how \pf{HA-prosper} actually works, have a look at the
%first lines of the source code available in the |Source| directory
%of the package or the |source| tree of your \LaTeX\ distribution
%which explains how to generate the source code documentation.
%
%Note that from version 4.1, \pf{HA-prosper} uses the \pf{xkeyval}
%package, which is available from CTAN \cite{xkeyvalCTAN} and is
%included in the MiKTeX distribution. Do not forget to install this
%package. See also section~\ref{sec:req}.
%
%Do not forget to check the \pf{HA-prosper} website
%\cite{HA-prosper} from time to time to see if there are updates
%for this package or new styles available. If, \emph{after reading
%this manual}, you have questions or comments about
%\pf{HA-prosper}, see section~\ref{sec:questions}.
%
%\subsection{The \pf{powerdot} class}\label{sec:newclass}
%This is the last release of the \pf{HA-prosper} package. We
%(Christopher Ellison and I) have created a new class called
%\pf{powerdot} \cite{powerdot} which has significant improvements
%over \pf{prosper} and \pf{HA-prosper} while keeping changes to
%presentation sources to a minimum. Over time, the support for
%\pf{HA-prosper} via the mailinglist will be minimized and users are
%advised to use \pf{powerdot} for new presentations.
%
%Further, information in this documentation was up to date in 2004,
%but might be outdated by now. The reason of not updating this is
%that since then all efforts have concentrated on the \pf{powerdot}
%class.
%
%\subsection{Compatibility}
%This section discusses compatibility issues between \pf{HA-prosper}
%and some other packages. The \pf{HA-prosper} package has been
%created and tested in an environment of MiKTeX 2.3 \cite{MiKTeX} and
%GhostScript 8.00 \cite{GhostScript} and newer versions of that
%software.
%
%\subsubsection{prosper}
%Since \pf{HA-prosper} is a patch for \pf{prosper}, it is important
%that you have the right version of \pf{prosper} which is 1.5
%(|prosper.cls| version 1.24)\footnote{This package is also
%compatible to the CVS version 1.25 of \pf{prosper}, but that
%version is still in beta stage and it is advisory not to use it.
%If you still want to use version 1.25 because of v\TeX\ support,
%delete or comment line 88 of |prosper.cls| then, namely were the
%\pf{pstcol} package is loaded, since that causes colors not to be
%defined properly.}. This is the CTAN version \cite{prosperCTAN}.
%
%\subsubsection{ppr-prv}
%A very nice package in combination with \pf{HA-prosper} is the
%`Prosper Preview' class, \pf{ppr-prv} \cite{ppr-prv}, created by
%Mathieu Goutelle \cite{Mathieu}. The aim of this class is to produce
%a printable version of the slides written with \pf{prosper} or
%\pf{HA-prosper} with two slides (or more at will) per page and a
%table of contents on the first page in case you are using
%\pf{HA-prosper}. Table~\ref{tab:pprpprvcompat} shows which versions
%of \pf{ppr-prv} and \pf{HA-prosper} are compatible. Each row of the
%table lists the compatible versions.
%\begin{table}[ht]
%\centering\caption{Compatible versions of \pf{HA-prosper} and
%\pf{ppr-prv}.}\label{tab:pprpprvcompat}
%\begin{tabular}{f}
%\pf{HA-prosper}&\pf{ppr-prv}&\pf{HA-prosper}&\pf{ppr-prv}\\\hline\hline
%3.7x&0.09&3.8&0.10\\\hline
%3.9&0.11&4.0&0.12\\\hline
%4.11&0.13&4.2&0.13\\\hline\hline
%\end{tabular}
%\end{table}
%
%\subsubsection{semcolor/pstcol/pstricks/color/xcolor}
%Recently, the incompatibilities of these packages have been solved
%and through a modification of \pf{semcolor}, the improved
%compatibility is also available to \pf{HA-prosper} users. Check the
%documentation of these packages to see whether or not your \LaTeX\
%distribution already includes the compatible versions. If so, then
%you can use both \pf{pstricks} color commands in your presentation
%or style as well as \pf{xcolor} commands.
%
%\subsubsection{babel}
%\pf{HA-prosper} redefines the |itemize| and the |enumerate|
%environments at the beginning of the document. This solves a bug
%that would otherwise occur when using the \pf{babel} package with
%the |french| option. The \pf{prosper} macro
%|\NoFrenchBabelItemize| is obsolete in \pf{HA-prosper} and has
%no function anymore. The order of loading the packages is
%important since \pf{HA-prosper} attempts to redefine some
%\pf{babel} macros. In case you want to use \pf{babel}, load
%\pf{babel} first and afterwards \pf{HA-prosper}.
%
%\subsubsection{Miscellaneous}
%Older versions of GhostScript might produce ugly display text and
%logo's. However, prints are fine in general. Furthermore, it has
%been shown that Acrobat Reader 4 \cite{AcroRead} generally does not
%display pictures properly.
%
%Since the |overlays| macro is not recognized by Scientific
%WorkPlace \cite{SWP}, this program is not supported. The advice is
%to use an editor for creating the slides, for example WinEdt
%\cite{WinEdt} or TexNicCenter \cite{TexNicCenter} (free).
%
%\subsection{Installation}\label{sec:inst}
%This package is included in the MiKTeX distribution \cite{MiKTeX}
%and in TeXLive \cite{TeXLive} and can be installed for you by
%these programs. However, if you downloaded this package from the
%\pf{HA-prosper} website \cite{HA-prosper} or from the
%\pf{HA-prosper} CTAN directory \cite{HA-prosperCTAN}), then here
%are some hints for installing the package into your \LaTeX\
%distribution.
%
%The package includes pre-generated run and doc files, but you can
%reproduce them from the source if necessary. See the first lines
%of |HA-prosper.dtx| for information how to do this. The files
%in |Doc| should go into the |doc| tree of your distribution,
%the files in |Run| into the |tex| run tree and the files in
%|Source| into the |source| tree. See the documentation of
%your \LaTeX\ distribution for information on installing
%\pf{HA-prosper} into your \LaTeX\ distribution or the TeX
%Frequently Asked Questions \cite{TeXFAQInst}.
%
%If you choose not to install the package into your \LaTeX\
%distribution, you can copy the necessary files (that is, the run
%files of \pf{HA-prosper} in the |Run| directory and the
%necessary files of the particular style, which can all be found in
%the relevant subdirectory of the |Run| directory) into your
%working directory.
%
%\subsection{Document set up}\label{sec:setup}
%The structure of a presentation created with \pf{HA-prosper} is
%comparable to that of a \pf{prosper} presentation. See the
%\pf{prosper} documentation for an overview.
%
%Do not forget to include
%\begin{verbatim}
%\usepackage[style,options]{HA-prosper}
%\end{verbatim}
%directly after the \pf{prosper} document class command to be able
%to use the new definitions provided in |HA-prosper.sty|. Here
%|style| is the style you want to use, for instance |HA|, and
%|options| are any package options which will be described in
%section~\ref{sec:new}. A summary of these options can be found in
%section~\ref{sec:packageoptions}.
%
%\DescribeMacro{\HAPsetup}
%You can set up certain features like footers and types of stepping
%environments globally (holding for the entire presentation, unless
%specified otherwise locally) using |\HAPsetup|, for instance
%\begin{verbatim}
%\HAPsetup{rf={My presentation},trans=Dissolve}
%\end{verbatim}
%This command can set up the features that you will be discussed in
%section~\ref{sec:new}. You can find a summary in
%section~\ref{sec:globals}.
%
%\subsection{Summary of package options}\label{sec:packageoptions}
%Table~\ref{tab:packageoptions} contains a summary of all package
%options of \pf{HA-prosper}. The numbers in between brackets are
%the sections where you can find more information about a specific
%option. See section~\ref{sec:setup} how to use these options.
%\begin{table}[ht]
%\caption{\pf{HA-prosper} package
%options.}\label{tab:packageoptions}\makebox[\textwidth][r]{
%\begin{tabular}{d}
%\hline\hline
%|sounds|& Turns on the |sound| key for slide environments (\ref{sec:slide}).\\\hline
%|toc|& Creates a table of contents on slides (\ref{sec:toc}).\\\hline
%|highlight|& Highlights the current slide in the table of contents (\ref{sec:tochl}).\\\hline
%|hlsections|& Highlights the current section on every slide within the section (\ref{sec:tochl}).\\\hline
%|portrait|& Creates portrait slides (\ref{sec:portrait}).\\\hline
%|notes|& Includes the notes in your presentation (\ref{sec:notes}).\\\hline
%|notesonly|& Includes only the notes in your presentation (\ref{sec:notes}).\\\hline
%|slidesonly|& Includes only the slides in your presentation (\ref{sec:notes}).\\\hline
%|blackslide|& Includes a black slide at the start of the presentation (\ref{sec:blslide}).\\\hline
%\hline
%\end{tabular}}
%\end{table}
%
%\subsection{Summary of global options}\label{sec:globals}
%Table~\ref{tab:hapsetupfeats} lists all the features of
%\pf{HA-prosper} that can be set using |\HAPsetup|. The numbers
%in between brackets are the sections where you can find more
%information about a specific feature. See section~\ref{sec:setup}
%how to use these global options.\par
%\begin{table}[ht]\caption{Global
%\pf{HA-prosper} options for \ci{HAPsetup}.}\label{tab:hapsetupfeats}
%\makebox[\textwidth][r]{
%\begin{tabular}{e}\hline\hline
%|lf|&Left footer (\ref{sec:footers}).&|sound|&Transition sound (\ref{sec:slide}).\\\hline
%|rf|&Right footer (\ref{sec:footers}).&|template|&Template for parts (\ref{sec:part}).\\\hline
%|sn|&Slide number layout (\ref{sec:footers}).&|stype|&Stepping environment type (\ref{sec:iestep}).\\\hline
%|tsnav|&Title slide navigation (\ref{sec:navs}).&|sstart|&Starting overlay (\ref{sec:iestep}).\\\hline
%|nsnav|&Normal slide navigation (\ref{sec:navs}).&|iacolor|&Inactive color (\ref{sec:iestep}).\\\hline
%|trans|&Transition effect (\ref{sec:slide}).&|counters|&Protect custom counters (\ref{sec:numbering}).\\\hline\hline
%\end{tabular}}
%\end{table}
%The features listed in table~\ref{tab:hapsetupfeats} all have a
%default value, which are discussed in the relevant sections. These
%values are defined in the file |HA-prosper.cfg|. This file can
%be modified. Modifications will have an effect on all
%presentations created using \pf{HA-prosper}\footnote{Note that the
%defaults saved in the |HA-prosper.cfg| file at the moment of
%installation are also saved in |HA-prosper.sty|. In case you
%accidentally delete a line in the |HA-prosper.cfg| file, the
%predefined defaults in |HA-prosper.sty| will be used.}.
%
%\subsection{Compilation}\label{sec:compile}
%If you use the |pdf| option in the |\documentclass|, compile with
%LaTeX2DVI - DVI2PS - PS2PDF to create slides with animations
%(incrementally displayed items created by the |itemstep|
%environment) that can be projected using for instance Acrobat Reader
%\cite{AcroRead}. Notice that \pf{HA-prosper} is build to work with
%papertype |letter| in the DVI2PS step (which is the default in the
%MiKTeX distribution and which can be achieved by adding |-t letter|
%to the command line of |dvips|), but the |Fyma| style supports |A4|
%paper as well. See section~\ref{sec:supportt}.
%
%If you want to print the slides, use the |ps2pdf| option and
%compile them with LaTeX2DVI - DVI2PS - PS2PDF and you can print
%the slides without animations.
%
%You can also use the Acrobat Distiller (included in Acrobat
%\cite{Acrobat}) to create the PDF from the PS file. This creates
%very efficient PDF files. Also see section~\ref{sec:result}. Do
%not forget to specify the \pf{prosper} class option `distiller' in
%this case to avoid errors when distilling the PS document. For
%instance
%\begin{verbatim}
%\documentclass[pdf,distiller]{prosper}
%\end{verbatim}
%
%If you prefer to use GhostView \cite{GhostView} for printing
%purposes, you can of course suffice with LaTeX2DVI - DVI2PS and
%print the slides form GhostView\footnote{You might have to shrink
%pages to fit the paper when printing the slides.}.
%
%A nice option for the `documentclass' is `draft'. This is provided
%by \pf{prosper} and speeds up the process of compiling and
%viewing the presentation by leaving out images. Deleting the
%option produces a presentation that includes all images again. See
%the \pf{prosper} class documentation for more details.
%
%\subsection{Upgrade information}
%This section contains information how to change your presentation
%in case you worked with an earlier version of \pf{HA-prosper}
%before and want to upgrade it. The list below contains the hints
%for upgrading with a single version step at a time. If you for
%instance want to upgrade from version 3.5 to the latest version,
%read all the entries in the list starting from the entry right the
%entry of version 3.5. If a particular version is not mentioned,
%this means that no changes need to be made to adapt the
%presentation to that version when starting at the last version
%before.
%
%\begin{itemize}
%\item[\fbox{3.0}] From \pf{HA-prosper} version 3.0, the
%package is based on the CTAN version of \pf{prosper}. This means
%that a separate version of \pf{prosper} is not distributed with
%this package anymore. If you used \pf{HA-prosper} before, replace
%the old style-file with the new one to upgrade to the latest
%version of \pf{HA-prosper} and do not forget to rename or delete
%prosper.cls in the working directory. \item[\fbox{3.5}] From
%version 3.5 of \pf{HA-prosper} the style definitions (template)
%will be loaded by \pf{HA-prosper}, not by \pf{prosper} anymore.
%This is done to avoid conflict when trying to use \pf{HA-prosper}
%templates with \pf{prosper}. Delete the style from the
%|\documentclass| command and put it in the |\usepackage|
%command of \pf{HA-prosper} when updating \pf{HA-prosper}. See also
%section~\ref{sec:inst}.
%\item[\fbox{3.6x}]\begin{itemize} \item When upgrading to
%\pf{HA-prosper} version 3.6, you might need to delete the
%|.toc| file of an existing presentation first since table
%of contents commands have changed and the new \pf{HA-prosper}
%is not able to understand the old commands. \item The
%|\email| and |\institution| commands have changed.
%In earlier version, defining them in the preamble of your
%presentation would make them appear on the title slide. Now, you
%have to put them inside the |\author| command. See
%section~\ref{sec:eia} for an example.
%\end{itemize}
%\item[\fbox{3.7x}]\begin{itemize} \item Download the full package
%to use the latest versions of the styles that are compatible to
%this version of \pf{HA-prosper}. \item Rename
%|\section| and |\sectionandpart| to
%|\tsection| and |\tsectionandpart| respectively.
%\end{itemize}
%\item[\fbox{3.8}]\begin{itemize} \item Download the full package
%to use the latest versions of the styles that are compatible to
%this version of \pf{HA-prosper}. \item Rename
%|\figureitem| to |\hiddenitem|. See
%section~\ref{sec:xitemwait}.\item Change slides that use the
%|dualslide| environment to for instance a normal
%|slide| and use the |\dualslide| macro to create a
%dualslide on that slide. See
%section~\ref{sec:dualslide}.\end{itemize}
%\item[\fbox{3.9}]
%\begin{itemize} \item |\figureitem| and
%|\putfigureitem| are no longer supported;
%|\putfigure| should be replaced by the more general
%|\topbl|, see section~\ref{sec:xitemwait}. \item The
%dualslide dimensions have changed a bit, see
%section~\ref{sec:dualslide}.\item More optional arguments for the
%|itemstep| environment are available now, see
%section~\ref{sec:iestep}.
%\end{itemize}
%\item[\fbox{4.0}]
%\begin{itemize} \item
%Commands |\TitleSlideNav|, |\NormalSlideNav|, |\LeftFoot|
%and |\RightFoot| are obsolete but still supported. You can use
%|\HAPsetup| instead, see section~\ref{sec:globals}.
%\item Some style commands have changed but backward
%compatibility is provided, see section~\ref{sec:styledev}.
%\item |\onSlide| and |\OnSlide| are provided but the \pf{prosper}
%macros |\fromSlide|, |\FromSlide|, |\untilSlide|, |\UntilSlide|,
%|\onlySlide| and |\OnlySlide| still work, see section~\ref{sec:onslide}.
%\item Toc behavior has changed a little bit. Empty slide titles
%will now produce empty toc entries and empty bookmarks. Deleting
%these happens by using respectively |toc=| and |bm=| (see section~\ref{sec:toc}).
%\end{itemize}
%\item[\fbox{4.1x}]
%\begin{itemize}
%\item \pf{HA-prosper} now uses \pf{xkeyval} \cite{xkeyvalCTAN}. Install
%this package to work with \pf{HA-prosper}.
%\item
%|\topbl| has been deleted. The macro can be found on the \TeX\ FAQ \cite{TeXFAQTop}.
%\item Replace |\item| by |\xitem| (see section~\ref{sec:xitem}).
%\item Replace |\hiddenitem| by |\xitemwait| (see section~\ref{sec:xitemwait}).
%\item When using |Lakar| style, replace |emptyslide| environments by
%|partslide| environments (see section~\ref{sec:wpe}).
%\end{itemize}
%\item[\fbox{4.2x}] No changes to presentations necessary.
%\end{itemize}
%
%\clearpage\section{New or changed environments and
%commands}\label{sec:new} This section describes the new commands
%provided by \pf{HA-prosper} and the originally \pf{prosper} commands
%that have been extended. The section assumes knowledge of the
%\pf{prosper} documentation.
%
%\subsection{The slide environment}\label{sec:slide}
%\DescribeEnv{slide}
%A slide is created using the |slide| environment. For instance
%\begin{verbatim}
%\begin{slide}[trans=Replace]{Sample slide}
%...
%\end{slide}
%\end{verbatim}
%The new |slide| environment has four options. They are
%listed in table~\ref{tab:slide}.
%\begin{table}[ht]
%\caption{Slide environment options.}\label{tab:slide}
%\makebox[\textwidth][r]{
%\begin{tabular}{d}\hline\hline
%|toc|&When specified, it will be used for the table of contents. When not\\
%&specified, the slide title will be used to create a toc entry (see section~\ref{sec:toc}).\\\hline
%|bm|&When specified, it will be used to create a bookmark. If not, the slide\\
%&title will be used as a bookmark.\\\hline
%|trans|&Slide transition effect (see the \pf{prosper} documentation) Default: |Replace|.\\\hline
%|sound|&Specify a sound file to be played when the slide is displayed.\\\hline
%\hline
%\end{tabular}}
%\end{table}
%Some remarks need to be made. First of all, when you supply an
%empty string as bookmark (so |bm=|), the bookmark will not be
%created. A similar thing holds for empty toc strings (|toc=|).
%See section~\ref{sec:toc}. The bookmark option is supplied to
%provide low level text for creating a bookmark in case you want
%the slide title to contain \LaTeX\ commands which might not be
%convertable to bookmarks\footnote{Note that the bookmarking
%procedure uses \ci{pdfstringdef} of \pf{hyperref} which is able
%to process things like \ci{"i}.}. For instance:
%\begin{verbatim}
%\begin{slide}[bm=Important!]{\red Important!}
%\end{verbatim}
%
%\DescribeSwitch{sounds}
%Second, adding transition sounds to a presentation is possible,
%but it is important to know that the sounds will not be embedded
%in the presentation and hence need to be supplied separately.
%Further, the presentation becomes system dependent by using
%sounds. It depends on the target machine if the specific sound
%file can be played or not. To switch on the use of sounds in your
%presentation, use the package option |sounds|, see
%section~\ref{sec:packageoptions}.
%
%The options |trans| and |sound| can be set globally by |\HAPsetup|
%(see section~\ref{sec:globals})\footnote{Notice that backward
%compatibility for \ci{DefaultTransition} is provided.}. The |sound|
%slide option adds the transition sound to all slides within
%|\overlays|. For more flexibility, the sound option also has a user
%interface to set sounds on pages directly. The sound file
%\DescribeMacro{\SlideSound}
%|sound.wav| is added using |\SlideSound| as follows.
%\begin{verbatim}
%\SlideSound{sound.wav}
%\end{verbatim}
%This code adds a transition sound to the first overlay only:
%\begin{verbatim}
%\onSlide*{1}{\SlideSound{sound.wav}}
%\end{verbatim}
%(see also section~\ref{sec:onslide} for the use of |\onSlide|).
%
%\subsection{Structuring the presentation}\label{sec:toc}
%\subsubsection{Building a table of contents}
%\DescribeSwitch{toc}
%You can include a table of contents on each slide. This can be
%used for navigational purposes during the presentation. When
%printing the slides, you might decide to leave out the table of
%contents. You can request a table of contents by specifying the
%option |toc| in the |\usepackage| command for the style
%file, like
%\begin{verbatim}
%\usepackage[toc,HA]{HA-prosper}
%\end{verbatim}
%(see also the examples in this distribution). \pf{HA-prosper} will
%use slide titles by default to produce the table of contents, but
%this behavior can be changed (see section~\ref{sec:slide}).
%
%Some remarks. First of all, the table of contents will of course
%only be put on the slides when it has been implemented in the style
%that you are using. See section~\ref{sec:supportt}. Second,
%\pf{HA-prosper} offers possibilities for style developers to split
%the table of contents into two parts the first of which will contain
%the sections and the second will contain the content of the current
%section.
%
%Third, if you specify an empty string as toc entry (so |toc=|),
%the toc entry will be deleted from the table of contents. This
%allows for building an overview of your presentation. Hence the
%table of contents can both be used for navigational purposes (like
%the bookmarks) and to provide an overview of the presentation.
%
%Finally, as with a usual table of contents in \LaTeX, you need to
%run your presentation at least twice after altering slides or toc
%entries. On the first pass, the table of contents will be updated
%and on the second run, the new table of contents will be included
%in the presentation.
%
%\subsubsection{Highlighting table of contents entries}\label{sec:tochl}
%\DescribeSwitch{highlight}
%If you want to highlight the current slide or the slide created by
%a |\part| or |\tsectionandpart| command (see section~\ref{sec:pas})
%in the table of contents, specify the
%|highlight| option, like
%\begin{verbatim}
%\usepackage[toc,highlight,HA]{HA-prosper}.
%\end{verbatim}
%Of course, the |highlight| option only takes effect when
%also the |toc| option has been specified (and of
%course the style you are using should support highlighting and the
%table of contents). This |highlight| option can be nice
%for both yourself and the audience since everyone can clearly see
%on which slide or in which section of the presentation you are.
%
%\DescribeSwitch{hlsections}
%An extra option is the |hlsections| option. This will make the
%current section highlighted on every slide within the current
%section. This can be especially useful when sections and section
%content are split in the style that you use, which would otherwise
%result in unclarities about the current section\footnote{Splitting
%of the table of contents is often implemented on portrait
%templates.}. When the table of contents is not split up, this option
%might be left out since in this case, the hierarchical structure of
%the table of contents clearly identifies the current section.
%
%\subsection{Parts and sections}\label{sec:pas}
%\subsubsection{tsection}\label{sec:section}
%\DescribeMacro{\tsection}
%By using the |\tsection|
%command, it is possible to divide the table of contents in several
%sections. The content of a section will be hidden until you access
%a slide inside this section. The section heading in the table of
%contents itself refers to the first slide after the section
%command. The section command should be used between slides. The
%following shows an example.
%\begin{verbatim}
%\begin{slide}{First slide}
%Some text
%\end{slide}
%
%\tsection[Bookmark for section 1]{Section 1}
%
%\begin{slide}{Second slide}
%Some text
%\end{slide}
%\end{verbatim}
%The optional argument of the |\tsection| macro can be used
%to specify the string to be used for the bookmark. Notice that all
%slides that are met before issuing the first |\tsection|
%command will always be displayed in the table of contents.
%Exceptions hold for two cases. The first is when issuing an empty
%string as toc entry in the |slide| environment (see
%section~\ref{sec:slide}). The second is when the style that you
%are using implements a split table of contents. In this case, the
%content of every new section will replace the content of the old
%section when going from the old section to the new section. The
%entries before the first section will then be replaced by the
%entries of the first section when advancing to that section.
%
%\DescribeMacro{\tsection*}
%Furthermore, |\tsection*| is available. It has the exact same
%possibilities as |\tsection|, but this command hides the section
%created by |\tsection*| completely until you enter it (for instance
%with a hyperlink to a slide, by using bookmarks or by browsing the
%slides). This can be useful if you want to include slides in your
%presentation, that you don't want to show in the table of contents,
%but which you could include into the presentation if you see that
%you have some time left. But there are of course other applications
%thinkable.
%
%\subsubsection{part}\label{sec:part}
%\DescribeMacro{\part}
%The |\part| command lets you identify separate parts in your
%presentation. The command |\part{Part I}| produces a normal slide
%with horizontally centered the words `Part I'. The argument will
%also be used to create a bookmark and a toc entry (if a table of
%contents is requested). The |\part| takes the same options as the
%|slide| environments (see section~\ref{sec:slide}), but it should be
%noted that in case you specify an empty string for the |bm| option,
%the part title will be used to create the bookmark.
%
%An additional option for the |\part| command is the
%|template| option. This allows to select a different
%template (supplied by the style that you use) for the slide
%created by the |\part| command. For instance, the HA-style
%supplies the template `wideslide'. You can use that template for
%the part to delete the table of contents from that particular
%slide. Example:
%\begin{verbatim}
%\part[template=wideslide,toc=Part number one,bm=The first part]{Part I}
%\end{verbatim}
%
%Note that the option |template| can be set globally for the entire
%presentation (see section~\ref{sec:globals}). The default value of
%|template| is |slide|.
%
%\subsubsection{tsectionandpart}\label{sec:secandpart}
%\DescribeMacro{\tsectionandpart}
%The
%|\tsectionandpart| command is a combination of the
%|\tsection| command (see section~\ref{sec:section}) and the
%|\part| command (see section~\ref{sec:part}). This command
%is supplied since issuing the two previous commands after each
%other cannot replicate the output of |\tsectionandpart|.
%The command has the same optional arguments as the |\part|
%command and besides creating a slide, it also creates a section in
%the table of contents. The section heading in the table of
%contents will now refer to the slide created by the |\part|
%command.
%
%\DescribeMacro{\tsectionandpart*}
%Notice that |\tsectionandpart*| produces similar output as
%|\tsection*|. Namely, it hides the section in the table of
%contents completely until it is accessed by going to any slide
%within this section. See also section~\ref{sec:section}. As
%|\tsectionandpart|, it also creates a |\part| slide.
%
%\subsection{Dualslide}\label{sec:dualslide}
%\DescribeMacro{\dualslide}
%The |\dualslide| macro allows to split content into two
%columns. Usage:
%\begin{samepage}
%\begin{verbatim}
%\dualslide[opt1][opt2][opt3]{options}{left}{right}
%\end{verbatim}
%The parameters are explained in
%table~\ref{tab:dspars}.\end{samepage}\par
%\begin{table}[ht]\centering
%\caption{Dualslide parameters.}\label{tab:dspars}
%\begin{tabular}{d}
%\hline\hline
%|opt1|& Any \pf{PSTricks} options to change the style of the\\
%&(optional) left frame. Example: |linestyle=dotted|.\\\hline
%|opt2|& Idem for the line in between the two columns.\\\hline
%|opt3|& Idem for the right column.\\\hline
%|options|& Options for the dualslide, see table~\ref{tab:dsoptions}.\\\hline
%|left|& The content for the left column.\\\hline
%|right|& The content for the right column.\\\hline\hline
%\end{tabular}
%\end{table}
%\begin{table}[ht]
%\caption{Dualslide options.}\label{tab:dsoptions}
%\makebox[\textwidth][r]{
%\begin{tabular}{d}
%\hline\hline
%|lineheight|& If |lineheight| is specified, a line of the specified height will be created\\
%&using \ci{psline} in between the two columns. Example: |lineheight=6cm|.\\\hline
%|lfrheight|& Creates a frame of the specified height around the left column.\\\hline
%|rfrheight|& Creates a frame of the specified height around the right column.\\\hline
%|frsep|& Space between text and the frames. Default: |1.5mm|.\\\hline
%|colsep|& Space between the two columns. Default: |0.06|\ci{linewidth}.\\\hline
%|lcolwidth|& Width of the left column. Default: |0.47|\ci{linewidth}.\\\hline
%|rcolwidth|& Width of the right column. Default: |0.47|\ci{linewidth}.\\\hline
%|topsep|& The extra space (additional to \ci{baselineskip}) between text above\\
%&the columns and the text within the columns. Default: |0cm|.\\\hline
%|bottomsep|& Idem for the bottom of the columns. Default: |0cm|.\\\hline
%|indent|&Horizontal indent left to the left column. Default: |0cm|.\\\hline\hline
%\end{tabular}}
%\end{table}
%The dimensions described in table~\ref{tab:dsoptions} are
%represented graphically in figure~\ref{fig:dsldim}.
%\begin{figure}[ht]
%\centering\caption{Dualslide dimensions.}\label{fig:dsldim}
%\pspicture(0,.5)(13,10.5)
%\psline(0,0.5)(0,10)
%\rput[tl](.05,9.95){Top}
%\psframe[dimen=middle](1,9)(7,2)
%\psline{C-C}(8.5,9)(11,9)
%\psline{C-C}(8.5,2)(8.5,9)
%\psline{C-C}(8.5,2)(11,2)
%\qdisk(1.7,8.3){.1cm}
%\psset{linestyle=dashed}
%\psline{C-C}(1.7,8.3)(6.3,8.3)
%\psline{C-C}(1.7,8.3)(1.7,3)
%\psline{C-C}(6.3,5)(6.3,8.3)
%\psline{C-C}(11,9)(12,9)
%\psline{C-C}(11,2)(12,2)
%\psline{C-C}(11,7)(12,7)
%\psline{C-C}(9.2,8.3)(12,8.3)
%\psline{C-C}(9.2,8.3)(9.2,3)
%\rput[tl](1.75,8.25){Left column text}
%\rput[tl](9.25,8.25){Right column text}
%\rput[tl](.05,1){Bottom}
%\psset{linestyle=dotted,dotsep=2pt}
%\psline(0,8.3)(1.7,8.3)
%\psline(0,9.6)(1,9.6)
%\psline(0,2)(1,2)
%\psline(0,1.1)(1,1.1)
%\psset{linestyle=solid}
%\psline{<->}(.2,8.33)(.2,9.57)
%\psline{<->}(4,8.33)(4,8.97)
%\psline{<->}(1.73,7)(6.27,7)
%\psline{<->}(1.03,6.5)(1.67,6.5)
%\psline{<->}(0.03,5.5)(1.67,5.5)
%\psline{<->}(6.33,7.4)(9.17,7.4)
%\psline{<->}(8.53,6.5)(9.17,6.5)
%\psline{<->}(6.33,6.5)(6.97,6.5)
%\psline{<->}(10.7,8.33)(10.7,8.97)
%\psline{<->}(7.3,8.97)(7.3,2.03)
%\psline{<->}(.2,1.13)(.2,1.97)
%\psline{->}(1.7,9.3)(1.7,8.45)
%\psline{<-}(9.23,7)(11,7)
%\cput(4,6.6){\small 1}
%\cput(11.1,6.6){\small 2}
%\cput(8,7){\small 3}
%\cput(7.7,3){\small 4}
%\cput(4.4,8.65){\small 5}
%\cput(1.35,6.1){\small 5}
%\cput(8.85,6.1){\small 5}
%\cput(11.1,8.65){\small 5}
%\cput(6.65,6.1){\small 5}
%\cput(0.6,8.95){\small 6}
%\cput(0.6,5.1){\small 7}
%\cput(0.6,1.55){\small 8}
%\cput(1.7,9.6){\small 9}
%\endpspicture
%\begin{center}
%\begin{tabular}{c p{4cm}cl}
%\multicolumn{4}{c}{Meaning of the numbers}\\\hline
%1&|lcolwidth|&5&|frsep|\\
%2&|rcolwidth|&6&|topsep|\\
%3&|colsep|&7&|indent|\\
%4&|lfrheight|, |rfrheight|,&8&|bottomsep|\\
%&|lineheight|&9&Reference point
%\end{tabular}
%\end{center}
%\end{figure}
%Important to notice is that the |\dualslide| macro uses the
%current cursor position as the reference point to position the
%first line of text of the left column (see also
%figure~\ref{fig:dsldim}). This means that optional frames can
%extend to the text on the previous line. Use for instance
%|topsep=0.3cm| in that case to add extra space between the
%two lines of text. The default value of |topsep| is based
%on the situation that there is no text on top of the two columns.
%In that case, it is best to locate the first line of text of the
%left column at the same spot as text that is not created by
%|\dualslide| on other slides. The setting
%|topsep=0cm| does exactly this. However, with a combination
%of |topsep| and |indent| you can change this
%behavior and position the first line of text of the left column
%anywhere you want.
%
%The dualslide macro computes the height of the construction to
%position text below the construction correctly. The computation is
%done by taking the maximum height of |lfrheight|,
%|rfrheight|, |lineheight| (if requested) and the
%left and right column content. Hence when frames nor a line is
%requested, |bottomsep| is the vertical space between the
%lowest line of text in the columns and the text below the columns
%(additional to |\baselineskip|).
%
%Furthermore, if none of the optional arguments has been specified,
%|dualslide| will use the \pf{PSTricks} defaults for
%creating frames and the line. Two exceptions:
%|linewidth=.25pt| and |linecolor=HAP@framecolor| by
%default, but these can of course again be changed using the
%optional arguments. When only |opt1| has been specified,
%this is used globally for both frames and the line. When both
%|opt1| and |opt2| have been specified, |opt1|
%will be used for both frames and |opt2| will be used for
%the line. In case you want to change the properties of the right
%frame only, call for instance
%\begin{verbatim}
%\dualslide[ ][ ][linecolor=red]{rfrheight=6cm}{left content}{right content}
%\end{verbatim}
%
%More examples can be found in the example files of \pf{HA-prosper},
%see section~\ref{sec:examples}. Also have a look at
%section~\ref{sec:animating} for information about animating content.
%The commands described there can also be used to animated content in
%the two columns.
%
%\subsection{Animating content}\label{sec:animating}
%\subsubsection{itemstep and enumstep}\label{sec:iestep}
%\DescribeEnv{itemstep}
%\DescribeEnv{enumstep}
%The |itemstep| and |enumstep| environments are based
%on the |itemize| and |enumerate| environments
%respectively, but with these environments, items will be displayed
%incrementally. Available options can be found in
%table~\ref{tab:iestepopts}.
%\begin{table}[ht]
%\caption{Itemstep and enumstep
%options.}\label{tab:iestepopts}
%\makebox[\textwidth][r]{
%\begin{tabular}{d}
%\hline\hline
%|sstart|& Starts the stepping environment on overlay |sstart|. Default: 1.\\\hline
%|iacolor|& Inactive color, used for inactive items. Default: lightgray.\\\hline
%|stype|& Type of stepping environment. Default: 0. Possible:\\
%&0 -- items appear one by one, but remain active;\\
%&1 -- items appear one by one, but turn inactive when moving to the next item;\\
%&2 -- all items are displayed and only one is active at a time.\\
%\hline\hline
%\end{tabular}}
%\end{table}
%These environments can be nested into each other and lower level
%environments inherit options from higher level environments. The
%|sstart| option has effect only in the highest level stepping
%environment (which can be embedded in an |itemize| or |enumerate|
%environment). The items of an |itemize| environment, which is nested
%in a stepping environment, will inherit the state (active or not)
%from the item in the stepping environment to which the
%(sub)environment(s) belong to. If |itemize| or |enumerate| is used
%at the top level, all items are active on all overlays. Find an
%example below (for the meaning of |\xitem|, refer to
%section~\ref{sec:xitem}).
%\begin{verbatim}
%\overlays{6}{
%\begin{slide}{xitem example}
%Some text.
%  \begin{itemstep}[sstart=2,stype=0,iacolor=gray]
%    \xitem item 1
%    \begin{enumstep}[stype=1] % inherits iacolor!
%      \xitem item 1.1
%      \xitem item 1.2
%    \end{enumstep}
%    \xitem item 2
%    \xitem item 3
%  \end{itemstep}
%\end{slide}
%}
%\end{verbatim}
%See section~\ref{sec:examples} for more examples and section
%\ref{sec:xitemwait} for a tool for these environments. The
%options for the stepping environments can also be set globally
%using the |\HAPsetup| macro (see section~\ref{sec:globals}).
%
%Note that the use of type 1 or 2 stepping environments requires
%the definition of the color |HAP@textc| by the template
%that you use. See section~\ref{sec:styledev}.
%
%\subsubsection{xitem}\label{sec:xitem}
%\DescribeMacro{\xitem}
%\pf{HA-prosper} defines a new command, |\xitem|, to be used within
%|itemize|, |enumerate|, |itemstep| and |enumstep| environments.
%Within |itemstep| and |enumstep| environments it will take care of
%the animation effect discussed in section~\ref{sec:iestep}. Within
%|itemize| and |enumerate| environments it will just display the
%content. Defining this command is necessary since redefining |\item|
%would damage macros and environments using |\item| (for instance
%|center|, |flushright|, |flushleft|).
%
%The |\xitem| macro also has a version in which it takes an optional
%value $n$ by doing |\xitem<n>|. This value is the extra number of
%overlays that the item should remain active in a stepping
%environment and is ignored in an |itemize| or |enumerate|
%environment. This optional argument can be useful when you want to
%add content to the current item on a later overlay. Notice that this
%can make several items active at a particular overlay. To avoid
%this, add |\xitemwait| before the next item. See the example below
%and section~\ref{sec:xitemwait}.
%\begin{verbatim}
%\overlays{3}{
%\begin{slide}{xitem example}
%\begin{itemstep}[stype=1]
%  \xitem<1> Yes?
%  \onSlide{2-}{No!}
%  \xitemwait
%  \xitem Because...
%\end{itemstep}
%\end{slide}
%}
%\end{verbatim}
%
%Note that a possibly unfamiliar syntax has been chosen for
%|\xitem<n>|. This done to easily support the other optional argument
%that comes with |\xitem| since it is an extension of the standard
%|\item|. The optional argument allows you to overwrite the item
%label, for instance |\xitem[a]| or |\xitem<1>[b]|. See your favorite
%\LaTeX\ manual for more information about the latter.
%
%\subsubsection{xitemwait}\label{sec:xitemwait}
%\DescribeMacro{\xitemwait}
%The command |\xitemwait| tells \pf{HA-prosper} to wait for one
%overlay before passing on to the next item in a stepping
%environment. The optional argument $n$ tells \pf{HA-prosper} to wait
%$n$ overlays before passing on to the next item. Example:
%\begin{verbatim}
%\overlays{5}{
%\begin{slide}{xitemwait example}
%  \begin{itemstep}
%    \xitem 1
%    \xitem 2
%    \xitemwait[2]
%    \xitem 3
%  \end{itemstep}
%\end{slide}
%}
%\end{verbatim}
%This might come in handy to animate custom content using |\onSlide|
%(see section~\ref{sec:onslide}) in dualslides
%(section~\ref{sec:dualslide}) in combination with stepping
%environments (section~\ref{sec:iestep}). Outside stepping
%environments, the macro has no effect.
%
%\subsubsection{onSlide and OnSlide}\label{sec:onslide}
%\DescribeMacro{\onSlide}
%The macro
%|\onSlide{overlays}{material}| displays |material| on the
%overlays listed in |overlays|. This can be a comma delimited
%list and the syntax explained in table~\ref{tab:osnot} can be
%used ($x$ and $y$ are positive integers with $y\geq x$).
%\begin{table}[ht]\centering
%\caption{Notation for \ci{onSlide}, \ci{onSlide*} and
%\ci{OnSlide}.}\label{tab:osnot}
%\begin{tabular}{d}\hline\hline
%$x$&Display material only on overlay $x$.\\\hline
%-$x$&Display material until and including overlay $x$.\\\hline
%$x$-&Display material from and including overlay $x$.\\\hline
%$x$-$y$&Display material from $x$ until $y$, including $x$ and $y$.\\\hline
%\hline
%\end{tabular}
%\end{table}
%When used inside an |itemstep| or |enumstep| environment, there is
%extra syntax available. This syntax follows the same rules as
%explained in table~\ref{tab:osnot}, but now $x$ and $y$ can start
%with a |+| sign. This sign can be used to animate content relative
%to the preceding |\xitem| in an |itemstep| or |enumstep|
%environment. Suppose that for instance the preceding |\xitem| of
%|\onSlide{+1-+2}{...}| will be displayed on overlay 6. Then the
%material of |\onSlide| will be displayed from overlay 7 to 8. Since
%this construct is relative, it is very easy to add to or delete
%items from the list without having to adapt all of the |\onSlide|
%commands that you used. See another example below.
%\begin{verbatim}
%\overlays{4}{
%\begin{slide}{onSlide example}
%\begin{itemstep}
%  \xitem item 1
%  \xitem item 2
%  \begin{itemize}
%    \xitem item 3 \onSlide{+1-}{and item 4}
%  \end{itemize}
%  \xitemwait
%  \xitem item 5
%\end{itemstep}
%\end{slide}
%}
%\end{verbatim}
%
%The |\onSlide| macro collects and generalizes all the
%functionality of the \pf{prosper} macros |\onlySlide|,
%|\untilSlide| and |\fromSlide|. This macro advances the
%cursor position even if the material is not displayed. The stared
%version |\onSlide*| does not advance the cursor position in
%case the material is not displayed and collects the functionality
%of the \pf{prosper} macros |\onlySlide*|, |\untilSlide*| and
%|\fromSlide*|. Note that these macros can be nested into each
%other, which allows for the creation of more parsimonious
%structures (which will also become more complex). For instance,
%\begin{verbatim}
%\onSlide{-3,5-6,8,10-}{One}\onSlide{-2,6,8,10-}{Two}\onSlide{2,8,10-}{Three}
%\end{verbatim}
%and
%\begin{verbatim}
%\onSlide{-3,5-6,8,10-}{One\onSlide{-2,6-}{Two\onSlide{2,8-}{Three}}}
%\end{verbatim}
%produce the same output. The following example demonstrates the
%difference between |\onSlide| and |\onSlide*|:
%\begin{verbatim}
%\onSlide{1}{One}\onSlide{2}{Two}\onSlide{3-}{Three}\par
%\onSlide*{1}{One}\onSlide*{2}{Two}\onSlide*{3-}{Three}
%\end{verbatim}
%
%\DescribeMacro{\OnSlide}
%The macro |\OnSlide{overlays}| also accepts the same syntax as the
%|\onSlide| macro and can be used to display or not all of the
%following material on a slide after the |\OnSlide| macro. This macro
%collects the functionality of the \pf{prosper} macros |\OnlySlide|,
%|\UntilSlide| and |\FromSlide|.
%Example:
%\begin{verbatim}
%\OnSlide{3-} All of this material will be displayed as from overlay 3.
%\end{verbatim}
%
%\subsection{Numbering on overlays}\label{sec:numbering}
%Mathieu Goutelle \cite{Mathieu} contributed a patch for the
%|\overlays| macro which makes it possible to number equations,
%tables and figures on overlays. This patch has been extended such
%that you can also protect custom counters on overlays. For general
%information about numbering, see your favorite \LaTeX\ book for
%more information.
%
%The |counters| option for |\HAPsetup| (section~\ref{sec:globals})
%can be used to list the counters that should be protected. For instance,
%\begin{verbatim}
%\newtheorem{mytheorem}{Theorem}
%\newtheorem{myproof}{Proof}
%\HAPsetup{counters={mytheorem,myproof}}
%\end{verbatim}
%in your preamble, will let you safely do
%\begin{verbatim}
%\overlays{3}{
%\begin{slide}{Proof}
%  \begin{myproof}
%    Suppose that:
%    \begin{equation}
%      x^2+y^2=z^2
%    \end{equation}
%    then\dots
%  \end{myproof}
%\end{slide}
%}
%\end{verbatim}
%The counters |figure|, |equation| and |table| are protected
%on overlays by default. The |counters| option for |\HAPsetup|
%lists the additional counters that should be protected. Notice that
%the counter that you want to protect needs to exist when issuing
%|\HAPsetup| to set the protected counters.
%
%\subsection{Portrait slides}\label{sec:portrait}
%\DescribeSwitch{portrait}
%If a template supports portrait slides, you can access these by
%specifying the |portrait| option in the |\usepackage| command
%like
%\begin{verbatim}
%\usepackage[toc,portrait,HA]{HA-prosper}.
%\end{verbatim}
%When requesting portrait slides, a template will give an error if
%it does not support portrait slides. See
%section~\ref{sec:supportt} for the templates that support portrait
%slides. When using portrait slides, the |hlsections| option might
%be useful for you, see section~\ref{sec:tochl}.
%
%\subsection{Notes}\label{sec:notes}
%\DescribeEnv{notes}
%The \pf{HA-prosper} package provides a way to make notes in
%your presentation. To include notes in the presentation that go
%with a slide, start a |notes| environment after this slide.
%For instance
%\begin{verbatim}
%\begin{slide}{First slide}
%...
%\end{slide}
%
%\begin{notes}{Notes for the first slide}
%These are the notes for the first slide.
%\end{notes}
%\end{verbatim}
%
%\DescribeSwitch{slidesonly}
%\DescribeSwitch{notesonly}
%\DescribeSwitch{notes}
%An additional option in the |\usepackage| command provides a
%way to control the printing of notes and slides. Include at most
%one of the following options.
%\begin{itemize}
%\item |slidesonly|: produces the slides only. This is the
%default option. Use this to create the presentation that you want
%to project. \item |notesonly|: produces the notes only.
%\item |notes|: includes the notes in the presentation.
%\end{itemize}
%For instance
%\begin{verbatim}
%\usepackage[toc,notesonly,HA]{HA-prosper}
%\end{verbatim}
%
%\textbf{Note}: If you want the notes only, first run the
%presentation at least once with the option `notes' to create
%correct labels for the notes page numbers. Once that is done, run
%the presentation with the `notesonly' option to create the
%notes\footnote{In case you use landscape slides, do not forget to
%put Auto-Rotation of pages to `Individually' if you are using the
%Acrobat Distiller to create the PDF. `Collectively by File' will
%rotate will rotate notes to landscape just like the slides.}.
%
%\subsection{Bibliography}\label{sec:bib}
%\DescribeEnv{thebibliography}
%\pf{HA-prosper} redefines the standard \pf{article}
%|thebibliography| environment to suppress the creation of a section
%heading and running headers. All other properties are maintained.
%Now you can do either of the next two (depending whether you are
%using BiB\TeX\ or not):
%\begin{center}
%\begin{tabular}{p{7cm}p{5cm}}
%\begin{verbatim}
%\begin{slide}{slide 1}
%\cite{someone}
%\end{slide}
%\begin{slide}{References}
%\begin{thebibliography}{1}
%\bibitem{someone} Article of someone.
%\end{thebibliography}
%\end{slide}
%\end{verbatim}&
%\begin{verbatim}
%\begin{slide}{slide 1}
%\cite{someone}
%\end{slide}
%\begin{slide}{References}
%\bibliography{YourBib}
%\end{slide}
%\end{verbatim}
%\end{tabular}
%\end{center}
%In case you have a big reference list that you want to spread over
%multiple slides, have a look at the packages \pf{natbib} and
%\pf{bibentry} \cite{natbibCTAN}. Using both packages allows you to
%do:
%\begin{verbatim}
%\begin{slide}{References (1)}
%\nobibliography{YourBib}
%\bibentry{someone1}
%\bibentry{someone2}
%\end{slide}
%\begin{slide}{References (2)}
%\bibentry{someone3}
%\end{slide}
%\end{verbatim}
%Have a look at your favorite \LaTeX\ documentation for more
%information about citations and bibliographies.
%
%\subsection{Bookmarks}\label{sec:bookmarks}
%\pf{HA-prosper} nests bookmarks within sections created by
%|\tsection| and |\tsection*| (see section~\ref{sec:section}) and
%|\tsectionandpart| and |\tsectionandpart*| (see
%section~\ref{sec:secandpart}). On the first pass of a document,
%bookmarks will be written to disk and will be read on the second
%pass to create the bookmarks. This is necessary to identify the
%number of slide bookmarks that should be nested within section
%bookmarks.
%
%Notice that the bookmark of a |\tsection| (or
%|\tsection*|) points to the first slide within the section,
%just as the toc link generated by this section. Furthermore, as
%|\part| does not create a toc section, it does not create a
%bookmarks section. This allows for creating both a flat table of
%contents as well as a flat bookmarks list.
%
%The nesting of bookmarks in sections is fully compatible to the
%nesting of bookmarks of overlays subordinate to the bookmarks of
%the first overlay of a slide. Bookmarks created by section
%commands are open and the bookmarks of slides are closed by
%default. You can change the latter by issuing the \pf{prosper}
%command |\collapsedBookmarksfalse| in the preamble of your
%presentation.
%
%\subsection{Black slide}\label{sec:blslide}
%\DescribeSwitch{blackslide}
%The package option |blackslide| creates a completely black
%slide as the first slide of the presentation. The PDF-file will
%start at page 2 when opened, the first real slide, so the black
%slide will not be revealed. The slide has an embedded target
%called `blackslide'. In the top left corner of the black slide, a
%black button is positioned which performs the Acrobat menu option
%`GoBack' when clicking it. This allows to temporarily stop the
%presentation (for instance, to write something at the blackboard)
%by clicking a hyperlink that points to the target `blackslide'.
%When the writing it done, click in the top left corner of the
%black slide to continue the presentation.
%
%\subsection{Footers}\label{sec:footers} The
%footers can be defined by the |\HAPsetup| command (see
%section~\ref{sec:globals})\footnote{Notice that backward
%compatibility is provided for \ci{LeftFoot} and
%\ci{RightFoot}.}, for instance
%\begin{verbatim}
%\HAPsetup{lf={Left footer},rf={Right footer}}
%\end{verbatim}
%The default values of |lf| and |rf| are empty strings. The
%slide number layout can be specified by the |sn| option. The
%default value of |sn| is\footnote{\ci{thepage}
%contains the number of the current slide, \ci{totalpages} inserts
%the total number of slides in the presentation and
%\ci{ifallPages} is a conditional from \pf{prosper} which is false
%if the \pf{prosper} class option |nototal| is specified by the
%user.}
%\begin{verbatim}
%{-~p.~\thepage\ifallPages/\totalpages\fi}
%\end{verbatim}
% which resembles the standard \pf{prosper} layout.
%\pf{HA-prosper} adds a space in between the text specified by
%|rf| and the text specified by |sn| to create the entire
%right footer. Another example of the slide number layout could be
%\begin{verbatim}
%\HAPsetup{sn={slide~\#\thepage}}.
%\end{verbatim}
%
%\subsection{e-mail, institution and the
%and-command}\label{sec:eia}
%\DescribeMacro{\author}
%\DescribeMacro{\email}
%\DescribeMacro{\institution}
%\pf{HA-prosper} changes the behavior
%of the \pf{prosper} commands |\email| and |\institution|.
%The package does not anymore put them directly onto the title
%page. Instead, you can use them inside the |\author| command to
%use the fonts that the template specifies for the e-mail address
%and the institution. This is done to offer support for the
%|\and| command\footnote{This was not possible in the
%construction used by \pf{prosper}.}. Example:
%\begin{verbatim}
%\author{%
%  Me\\
%  \institution{My institution}\\
%  \email{My e-mail address}
%  \and
%  You\\
%  \institution{Your institution}\\
%  \email{Your e-mail address}
%}
%\end{verbatim}
%
%\clearpage\section{Style specific features} This section documents
%several style specific features. Check table~\ref{tab:supportt} in
%section~\ref{sec:supportt} to find which features are supported by
%each template.
%
%\subsection{maketitle}\label{sec:mct}
%\DescribeMacro{\maketitle}
%This adapted command
%replaces the usual |\maketitle| and takes care of defining
%a title slide with a different layout as the first slide, include
%the title on that slide and create the rest of the slides as
%normal slides (unless specified differently by using for instance
%another slide environment, see section~\ref{sec:wpe}).
%
%This command has the same options as the |slide| environment (see
%section~\ref{sec:slide}. By default, the title slide will appear in
%neither the bookmarks list nor the table of contents. You can change
%this by specifying respectively the |bm| option and/or the |toc|
%option (see section~\ref{sec:slide}).
%
%If the |\maketitle| feature is not supported by a style,
%then the |\maketitle| uses a normal slide to display the
%title on.
%
%\subsection{Wideslide and partslide}\label{sec:wpe}
%\DescribeEnv{wideslide}
%A |wideslide| produces a slide with an extended text area in case
%you need to display very wide formulas or figures. In a lot of
%templates, this means that the table of contents will not be
%displayed on a wideslide.
%
%As a remark: the optional arguments possible for the
%|\maketitle| (see section~\ref{sec:mct}) are also available
%for the modified slide environments. So
%\begin{verbatim}
%\begin{wideslide}[toc=Toc slide title,trans=Replace]{Slide title}
%...
%\end{wideslide}
%\end{verbatim}
%creates a |wideslide| which does not have transition
%effects itself and uses `Toc slide title' as the entry for the
%(optional) table of contents. See section~\ref{sec:toc} for more
%information about the optional table of contents.
%
%\DescribeEnv{partslide}
%The |partslide| environment is available in some styles. This
%environment uses a template which has been designed especially for
%use with the |\part| (see section~\ref{sec:part}) and the
%|\sectionandpart| commands (see section~\ref{sec:secandpart}).
%
%See section~\ref{sec:supportt} to find which styles support
%|wideslide| or |partslide| environments.
%
%\subsection{Hidden navigation}\label{sec:navs} If you use Acrobat (Reader)
%to project the slides, it is possible to embed hidden navigational
%components. The navigational components are accessed by clicking
%the logo on a slide (unless stated otherwise in style specific
%documentation). These components are always hidden and hence
%removing their definitions when you want to print the slides is
%not necessary. Using |\HAPsetup| (see
%section~\ref{sec:globals}), you can set the following
%options\footnote{Notice that backward compatibility for
%\ci{TitleSlideNav} and \ci{NormalSlideNav} is provided.}:
%\begin{itemize}
%\item |tsnav|\\
%Navigation possibilities of the logo on the title slide.\\
%For instance: |tsnav=FullScreen|: when starting the
%presentation, you can make the presentation full screen by
%clicking the logo.
%
%\item |nsnav|\\
%Navigation possibilities on all other slides.\\
%For instance: |nsnav=ShowBookmarks| or |nsnav=GoToPage|: the
%former will provide a list of slide titles when viewing the
%presentation in full screen mode. In this case, proper slide
%titles might help you navigate your presentation. The latter will
%show a menu where you can type the slide number of the slide that
%you want to display.
%\end{itemize}
%
%For more possibilities, see the documentation of the
%\pf{hyperref} package.
%
%\subsection{Support table}\label{sec:supportt}
%Table~\ref{tab:supportt} displays an overview of the available
%extra features in the styles. In between brackets you can find
%links to sections explaining the features.
%
%\begin{table}[ht]
%\caption{Available features in styles.}\label{tab:supportt}
%\makebox[\textwidth][r]{
%\begin{tabular}{l}\rlap{
%\pstilt{60}{%
%\begin{tabular}{g}\hline
%\rotateleft{\rnode{c1}{}\hphantom{ TCSTealBlue }} &
%\rotateleft{\rnode{c2}{}\hphantom{TCSTealBlue}\rnode{c0}{}} &
%\rotateleft{\rnode{c3}{}} &
%\rotateleft{\rnode{c4}{}} &
%\rotateleft{\rnode{c5}{}} &
%\rotateleft{\rnode{c6}{}} &
%\rotateleft{\rnode{c7}{}} &
%\rotateleft{\rnode{c8}{}} &
%\rotateleft{\rnode{c9}{}} &
%\rotateleft{\rnode{c10}{}} &
%\rotateleft{\rnode{c11}{}} &
%\rotateleft{\rnode{c12}{}} &
%\rotateleft{\rnode{c13}{}}
%\end{tabular}
%}}\\
%\rput[rt](c0){Styles\hspace{1.5em}}
%\rput[lb](c1){ Features}
%\rput[lt]{60}(c2){ Aggie}
%\rput[lt]{60}(c3){ Capsules}
%\rput[lt]{60}(c4){ CentER}
%\rput[lt]{60}(c5){ Ciment}
%\rput[lt]{60}(c6){ Fyma}
%\rput[lt]{60}(c7){ HA}
%\rput[lt]{60}(c8){ Lakar}
%\rput[lt]{60}(c9){ Simple}
%\rput[lt]{60}(c10){ TCS}
%\rput[lt]{60}(c11){ TCSgrad}
%\rput[lt]{60}(c12){ TCSTealBlue}
%\rput[lt]{60}(c13){ Tycja}
%\hspace{.67em}\begin{tabular}{g}\hline
%table of contents (\ref{sec:toc})          & x & x & x & x & x & x & x & x & x & x & x & x \\
%portrait slides (\ref{sec:portrait})       & x &   &   &   &   & x & x & x &   &   &   & x \\
%A4 support                                 &   &   &   &   & x &   &   &   &   &   &   &   \\
%modified \ci{maketitle} (\ref{sec:mct})    & x & x & x & x & x & x & x & x & x & x & x & x \\
%wideslide environment (\ref{sec:wpe})      & x & x & x & x & x & x & x & x & x & x & x & x \\
%partslide environment (\ref{sec:wpe})      &   & x &   & x & x &   & x &   &   &   &   &   \\
%tsnav (\ref{sec:navs})                     & x &   & x &   &   &   &   &   & x & x & x &   \\
%nsnav (\ref{sec:navs})                     & x &   & x &   &   & x &   &   & x & x & x &   \\
%\hline
%\end{tabular}
%\end{tabular}}
%\end{table}
%
%Currently only the |Fyma| style supports the |A4| papersize. To use
%it, issue the command |\FymaAFour| in your preamble and use |-t A4|
%in the |dvips| command line to get slides in A4 dimensions.
%
%\clearpage\section{Information for style developers}\label{sec:styledev}
%\subsection{General tools}
%This section provides some information in case you want to develop
%your own style. Remember that this package is still based on
%\pf{prosper}, so for the standard \pf{prosper} features, see the
%\pf{prosper} documentation. Table~\ref{tab:devfeats1} lists
%additional features of \pf{HA-prosper} available to control the
%layout, fonts and colors of your style. The controls in
%table~\ref{tab:devfeats2} are \pf{HA-prosper} internals and should
%only be used in style files. In between brackets you can find links
%to sections explaining the related user interface commands. Do not
%forget to take a look at existing styles since these are the ideal
%starting point to create a new style.
%Note that if you use |\HAP@NSNav| or |\HAP@TSNav| in a style, make
%sure to check whether it has been defined by the user or not.
%
%\begin{table}[ht]\centering
%\caption{\pf{HA-prosper} features for style development.}
%\label{tab:devfeats1}
%\makebox[\textwidth][r]{
%\begin{tabular}{d}
%\hline\hline
%\ci{FontLeftFoot\string{C\string}\string{BW\string}},& This command is used to
%assign a font to the left footer (\ref{sec:footers}). The\\
%& first argument is for color slides, the second for black
%and white ones.\\
%& Default: font: \ci{fontText}; text height: 5pt; line height: 5pt.\\
%\ci{fontLeftFoot\string{xx\string}}& This command writes |xx| in the font
%defined by the former command.\\\hline
%\ci{FontRightFoot\string{C\string}\string{BW\string}},& Idem for right footer (\ref{sec:footers}).\\
%\ci{fontRightFoot\string{xx\string}}& Default: font: \ci{fontText}; text height: 5pt; line height: 5pt.\\\hline
%\ci{FontAuthor\string{C\string}\string{BW\string}},& Idem for author (\ref{sec:eia}).\\
%\ci{fontAuthor\string{xx\string}}& Default: font: \ci{fontText}.\\\hline
%\ci{FontInst\string{C\string}\string{BW\string}},& Idem for institution (\ref{sec:eia}).\\
%\ci{fontInst\string{xx\string}}& Default: font: \ci{fontText}; text height: 7pt; line height: 7pt.\\\hline
%\ci{FontEmail\string{C\string}\string{BW\string}},& Idem for e-mail address (\ref{sec:eia}).\\
%\ci{fontEmail\string{xx\string}}& Default: font: \ci{fontText}; text height: 7pt; line height: 7pt.\\\hline
%\ci{FontToc\string{C\string}\string{BW\string}},& Idem for table of contents (\ref{sec:toc}).\\
%\ci{fontToc\string{xx\string}}& Default: font: \ci{fontText}; text height: 4pt; line height: 6pt.\\\hline
%\hline
%\end{tabular}}
%\end{table}
%
%\begin{table}[ht]
%\caption{Internal \pf{HA-prosper} controls for style development.}\label{tab:devfeats2}
%\makebox[\textwidth][r]{
%\begin{tabular}{d}\hline\hline
%\ci{HAP@PutLF\string{A\string}\string{C\string}}&
%Uses \ci{rput} to position the left footer using anchor |A| and coordinates |C|.\\\hline
%\ci{HAP@PutRF\string{A\string}\string{C\string}}&
%Uses \ci{rput} to position the right footer using anchor |A| and coordinates |C|.\\\hline
%\ci{HAP@NSNav}&Contains argument of \ci{NormalSlideNav}, if defined (\ref{sec:navs}).\\\hline
%\ci{HAP@TSNav}&Contains argument of \ci{TitleSlideNav}, if defined (\ref{sec:navs}).\\\hline
%Color |HAP@textc|&Text color, used for switching back from inactive colors; default: black (\ref{sec:iestep}).\\\hline
%Color |HAP@framecolor|&Color for dualslide frames and lines; default: black (\ref{sec:dualslide}).\\\hline
%\ci{ifHAP@active}&True if item is active, for use with \ci{myitem} (see \pf{prosper} docs and \ref{sec:xitem}).\\\hline
%\ci{ifHAP@highlight}&True if highlighting has been requested by the user (\ref{sec:tochl}).\\\hline
%\ci{ifHAP@portrait}&True if portrait slides have been requested by the user (\ref{sec:portrait}).\\\hline
%\ci{ifHAP@notes}&If's that contain the state of requested notes, slides only or notes only.\\
%\ci{ifHAP@notesonly}&These can take the value 0 or 1 (false or true) and it holds that\\
%\ci{ifHAP@slidesonly}&the sum is equal to one and the product is equal to zero (\ref{sec:notes}).\\
%\hline\hline
%\end{tabular}}
%\end{table}
%
%\subsection{Table of contents typesetting}
%\pf{HA-prosper} uses the macros |\HAP@tocentry| and
%|\HAP@hltocentry| to typeset table of contents entries. The latter
%macro will be used in case the entry needs to be highlighted. By
%default, \pf{HA-prosper} puts the toc entry at hand in a |\parbox|
%to allow for multi-line toc entries. For |\HAP@hltoctext|, the
%latter is inserted in a |\psframebox|. You can redefine the former
%macros to typeset the table of contents for your style in a
%different way. Use |\HAP@toctext| in your definitions. This will at
%run time contain the entry at hand in the markup specified by either
%|\HAP@tline|, |\HAP@tlineonly|, |\HAP@tsection| or
%|\HAP@tsectiononly| depending on the type of table of contents and
%the type of the entry. See for instance the |Fyma| style for an
%alternative table of contents markup. See further
%table~\ref{tab:tocmarkup} for other macros related to typesetting
%the table of contents and section~\ref{sec:toc} for more information
%about the table of contents.
%
%\begin{table}[ht]
%\caption{Table of contents typesetting macros.}\label{tab:tocmarkup}
%\makebox[\textwidth][r]{
%\begin{tabular}{d}\hline\hline
%\ci{HAP@toc}&Command that includes the toc file in \ci{fontToc}.\\\hline
%\ci{HAP@tsections}&Includes sections of the toc file in \ci{fontToc}.\\\hline
%\ci{HAP@tcontent}&Contains the content of the current section.\\\hline
%\ci{ifHAP@toc}&True if a table of contents has been requested by the user.\\\hline
%\ci{HAP@tline}&Layout of a table of contents entry in a full toc.\\\hline
%\ci{HAP@tlineonly}&Layout of a table of contents entry in \ci{HAP@tcontent}.\\\hline
%\ci{HAP@tsection}&Layout of a table of contents section in a full toc.\\\hline
%\ci{HAP@tsectionm}&Section marker, inserted just before creating a section.\\\hline
%\ci{HAP@tsectiononly}&Layout of a table of contents section in \ci{HAP@tsections}.\\\hline
%\ci{HAP@tsectionskip}&Vertical skip above a section; default: 1.5em.\\\hline
%\ci{HAP@titemskip}&Vertical skip in between items, not sections; default: 0.1em.\\\hline
%\ci{HAP@tocentry}&Construct for entry, use \ci{HAP@toctext} inside, see leading text.\\\hline
%\ci{HAP@hltocentry}&Construct for highlighting, use \ci{HAP@toctext} inside, see leading text.\\\hline
%Color |HAP@hcolor|&Color for PostScript frame used for highlighting; default: black.\\\hline
%Color |HAP@htcolor|&Text color for highlighted toc entry; default: white.\\\hline
%\ci{HAP@twidth}&Width of toc, used for \ci{parbox} in \ci{HAP@tocentry} and \ci{HAP@hltocentry}.\\\hline
%\ci{HAP@tborder}&Border size in \ci{psframebox} of \ci{HAP@hltocentry}; default: 0.05cm\\\hline\hline
%\end{tabular}}
%\end{table}
%
%Note that the macros |\HAP@hcolor|, |\HAP@htcolor|, |\HAP@twidth|
%and |\HAP@tborder| are only used in the default definitions of
%|\HAP@tocentry| and |\HAP@hltocentry|. If you decide to redefine the
%latter two macros, defining and using the former four might not be
%necessary. The default toc typesetting uses these macros to provide
%an easy way for style designers to tweak the default markup of the
%table of contents.
%
%\subsection{Reserved commands}
%\pf{HA-prosper} knows a couple of reserved commands. If these
%commands are defined by a style, they will be used by
%\pf{HA-prosper} to create new slide environments. See
%table~\ref{tab:reserved}.
%
%\begin{table}[ht]
%\caption{Reserved commands in \pf{HA-prosper}.} \label{tab:reserved}
%\makebox[\textwidth][r]{
%\begin{tabular}{d}\hline\hline
%\ci{HAPR@normalSlide}&Should contain the layout
%of a standard slide.\\\hline
%\ci{HAPR@wideSlide}&Should contain the layout of a
%wide slide; used for |wideslide| environment (\ref{sec:wpe}).\\\hline
%\ci{HAPR@partSlide}&Should contain the layout of a
%part slide; used for |partslide| environment (\ref{sec:wpe}).\\\hline
%\ci{HAPR@titleSlide}&Should contain the layout of a
%title slide; used to create title slide,\\
%&which will be embedded in the \ci{maketitle} command (\ref{sec:mct}).\\\hline
%\hline
%\end{tabular}}
%\end{table}
%
%Note that |\HAPR@normalSlide| is used to switch back to after
%creating a special slide environment like |wideslide|. If this
%command has not been defined in your style, then \pf{HA-prosper}
%will not be able to define the environments mentioned in
%section~\ref{sec:wpe} for you. As a last note: don't forget the
%power of the \pf{PSTricks} package for designing styles.
%
%\clearpage\section{Miscellaneous issues}
%
%\subsection{Examples}\label{sec:examples}
%Examples that use the \pf{HA-prosper} package are contained in the
%|HAPIntroduction.tex|, |HAPBigtest.tex| and |HAPDualslide.tex|
%files in this distribution. The examples assume that you have the
%|HA| style. More examples can be found at the \pf{HA-prosper} website
%\cite{HA-prosper}.
%
%Do not forget to take a look at the documentation of the
%\pf{prosper} class, the \pf{hyperref} package and the
%\pf{PSTricks} package to fully understand the possibilities of
%slides created by \pf{HA-prosper}.
%
%\subsection{Required packages}\label{sec:req}
%The most important requirements of the \pf{prosper} class are:
%\begin{multicols}{2}
%\begin{itemize}\setlength{\itemsep}{0pt}
%\item \pf{seminar},
%\item \pf{hyperref},
%\item \pf{pstricks},
%\item \pf{graphicx}.
%\end{itemize}
%\end{multicols}
%The most important requirements of the \pf{HA-prosper} package
%are:
%\begin{multicols}{2}\raggedright
%\begin{itemize}\setlength{\itemsep}{0pt}
%\item \pf{prosper} (|prosper.cls| version 1.24),
%\item \pf{xkeyval} \cite{xkeyvalCTAN},
%\item \pf{xcomment},
%\item \pf{verbatim}.
%\end{itemize}
%\end{multicols}
%
%\subsection{Resulting PDF}\label{sec:result}
%The PDF produced by PS2PDF (GhostScript) is usually very big.
%Unfortunately, it includes a copy of the logos on the slides every
%time they appear. In case this logo is a rendered picture, the PDF
%will become very big. There is not much you can do about that.
%However, you can compress a generic presentation PDF file very
%much (often even to 10\% of the original size) using for instance
%WinZip. And you could of course delete the logo or replace it by a
%non-rendered picture, for instance created by \pf{PSTricks}, see
%the \pf{PSTricks} website \cite{PSTricks}. Compare for example
%the |HA| style and the |Lakar| style.
%
%Another possibility is to use `Reduce file size' in the file menu
%of Acrobat (available from version 6). You can also use the PDF
%Optimizer in this version of Acrobat (Tools - PDF Optimizer).
%Using this option, you can compress the pictures inside the
%presentation and make the presentation considerably smaller. Hint:
%do not use JPEG or JPEG2000 for the compression of images. Even at
%the highest level of quality, this produces poor results for
%projecting purposes. Instead, use the ZIP compression. Also, do
%not downsize the resolution lower than 300 pixels per inch (for
%retaining printing quality).
%
%However, to get the most efficient PDF document, use the Acrobat
%Distiller to convert the PS file into a PDF file. Do not forget to
%include the `distiller' option in the document class in this case
%(see section~\ref{sec:compile}).
%
%\subsection{Credits}
%I want to thank the following people for their contribution(s).
%\begin{itemize}
%\item\textbf{Style contributors}\\
%Chris Ellison: |TCS|, |TCSgrad| and |TCSTealBlue| styles.\\
%Jack Stalnaker: |Aggie| style.\\
%Laurent Jacques \cite{Laurent}: |Fyma| style.\\
%Mathieu Goutelle \cite{Mathieu}: |Capsules| and |Ciment| styles.
%\item\textbf{Bug reports}\\
%Bugs have been detected and reported by Chris Ellison, Victor
%Francisco Fonte, Johan Joubert, Fr\'ed\'eric Mayot, and Johan
%Segers.
%\item\textbf{Contributions and ideas}\\
%A lot of thanks go Mathieu Goutelle \cite{Mathieu}, Herbert Vo\ss\
%\cite{Herbert}, Murali Krishna Ganapathy \cite{Murali} and Laurent
%Jacques for great help, code contributions and/or ideas for improvements.
%\end{itemize}
%
%\subsection{Questions}\label{sec:questions}
%If you have questions, please first consult the documentation of
%the package that could possibly answer your question. Probably,
%you can find the answer in the documentation of either the
%\pf{HA-prosper} package, \pf{prosper} class, the \pf{hyperref}
%package or the \pf{PSTricks} package. Also have a look at
%WikiProsper \cite{WikiProsper} for a \pf{prosper} FAQ,
%\pf{prosper} open questions, known \pf{prosper} bugs,
%etcetera.
%
%If you cannot solve the problem yourself, or if you have comments or
%requests for additional features, you may try to post a message to
%the \pf{HA-prosper} mailinglist \cite{HAprospermaillist}. Do not
%forget to include a \emph{minimal} example when you want help with
%an error message.
%
%The use of the mailinglist will be supported as long as possible,
%but as stated in section~\ref{sec:newclass} most effort will be done
%to help \pf{powerdot} users and the \pf{HA-prosper} mailinglist may
%disappear over time.
%
%
%{\small
%\begin{thebibliography}{[00]}
%
%\bibitem{Acrobat}
%Acrobat.
%\newblock \url{http://www.adobe.com/products/acrobat}.
%
%\bibitem{AcroRead}
%{Acrobat Reader}.
%\newblock \url{http://www.adobe.com/products/acrobat/readstep2.html}.
%
%\bibitem{GhostScript}
%{AFPL GhostScript}.
%\newblock \url{http://www.cs.wisc.edu/~ghost}.
%
%\bibitem{GhostView}
%GhostView.
%\newblock \url{http://www.cs.wisc.edu/~ghost/gsview}.
%
%\bibitem{HAprospermaillist}
%{HA-prosper mailinglist}.
%\newblock \url{http://listserv.surfnet.nl/archives/ha-prosper.html}.
%
%\bibitem{HA-prosperCTAN}
%{HA-prosper on CTAN}.
%\newblock
%  \url{http://www.ctan.org/tex-archive/macros/latex/contrib/ha-prosper}.
%
%\bibitem{HA-prosper}
%{HA-prosper website}.
%\newblock \url{http://stuwww.uvt.nl/~hendri/downloads/haprosper.html}.
%
%\bibitem{Herbert}
%{Herbert Vo\ss}.
%\newblock \url{http://www.perce.de}.
%
%\bibitem{Laurent}
%{Laurent Jacques}.
%\newblock \url{http://www.fyma.ucl.ac.be/~ljacques}.
%
%\bibitem{Mathieu}
%{Mathieu Goutelle}.
%\newblock \url{http://webperso.easyconnect.fr/goutelle}.
%
%\bibitem{MiKTeX}
%MiKTeX.
%\newblock \url{http://www.miktex.org}.
%
%\bibitem{Murali}
%{Murali Krishna Ganapathy}.
%\newblock \url{http://www.cs.uchicago.edu/people/gmkrishn}.
%
%\bibitem{natbibCTAN}
%{Natbib on CTAN}.
%\newblock
%  \url{http://www.ctan.org/tex-archive/macros/latex/contrib/natbib}.
%
%\bibitem{powerdot}
%{powerdot on CTAN}.
%\newblock
%  \url{http://www.ctan.org/tex-archive/macros/latex/powerdot}.
%
%\bibitem{ppr-prv}
%{ppr-prv}.
%\newblock
%  \url{http://www.ctan.org/tex-archive/macros/latex/contrib/ppr-prv}.
%
%\bibitem{prosperCTAN}
%{Prosper on CTAN}.
%\newblock
%  \url{http://www.ctan.org/tex-archive/macros/latex/contrib/prosper}.
%
%\bibitem{prosper}
%{Prosper website}.
%\newblock \url{http://prosper.sourceforge.net}.
%
%\bibitem{PSTricks}
%{PSTricks website}.
%\newblock \url{http://www.pstricks.de}.
%
%\bibitem{SWP}
%{Scientific WorkPlace}.
%\newblock \url{http://www.mackichan.com}.
%
%\bibitem{TeXFAQInst}
%{TeX FAQ (Installing packages)}.
%\newblock \url{http://www.tex.ac.uk/cgi-bin/texfaq2html?label=instpackages}.
%
%\bibitem{TeXFAQTop}
%{TeX FAQ (Top-aligning imported graphics)}.
%\newblock \url{http://www.tex.ac.uk/cgi-bin/texfaq2html?label=topgraph}.
%
%\bibitem{TeXLive}
%{TeXLive}.
%\newblock \url{http://www.tug.org/texlive}.
%
%\bibitem{TexNicCenter}
%TeXnicCenter.
%\newblock \url{http://www.toolscenter.org}.
%
%\bibitem{WikiProsper}
%WikiProsper.
%\newblock \url{http://wikiprosper.bbclone.de}.
%
%\bibitem{WinEdt}
%WinEdt.
%\newblock \url{http://www.winedt.com}.
%
%\bibitem{xkeyvalCTAN}
%{xkeyval on CTAN}.
%\newblock
%  \url{http://www.ctan.org/tex-archive/macros/latex/xkeyval}.
%
%\end{thebibliography}}
%
%\subsection{Copyright}
%Copyright \copyright\ 2003-2005 by Hendri Adriaens. All rights reserved.\\
%
%This program may be distributed and/or modified under the
%conditions of the \LaTeX\ Project Public License, either version
%1.2 of this license or (at your option) any later version. The
%latest version of this license is in
%\url{http://www.latex-project.org/lppl.txt} and version 1.2 or
%later is part of all distributions of \LaTeX\
%version 1999/12/01 or later.\\
%
%\subsection{Version history}
%This section lists the main changes in this package as from
%version 3.5. Note that each version change also contains solutions
%to known (minor) bugs and improvements in programming and user
%interface.
%
%\begin{itemize}
%\item[\fbox{3.5}] Solved a bug with toc entries in combination with
%highlighting. This bug was mainly caused
%by the \pf{keyval} package not undefining variables when they are
%not used. Thanks to Mathieu Goutelle for the help; added support
%for the |\part| command. Made \pf{HA-prosper} load slide
%style definitions itself at the final stage; changed style names
%to |HAP[name].sty| to identify \pf{HA-prosper} style
%definitions from \pf{prosper} style definitions; made
%\pf{HA-prosper} undefine |\slidetitle| before loading the
%style definitions;
%
%\item[\fbox{3.6}] Improved writing of toc entries; solved an
%inconsistency in writing definitions between |seminar| and
%|latex.ltx|; introduced |\section| and
%|\sectionandpart|; completely changed |notes| environment,
%not using |seminar| note constructions anymore; added support
%for |\and| in |\author|; added |\fontToc|;
%\begin{itemize}
%\item[\fbox{3.61}] Removed redundant grouping;
%\item[\fbox{3.62}] Adapted writing definitions a bit to be more consistent with
%|seminar|;
%\end{itemize}
%
%\item[\fbox{3.7}] Prepared \pf{HA-prosper} for compatibility to the
%|prosper preview| class \cite{ppr-prv}; integrated specific
%style features into \pf{HA-prosper}; recoded |\figureitem|
%command; renamed |\section| to |\tsection|,
%|\sectionandpart| to |\tsectionandpart| to provide
%compatibility to for instance |\bibliography|; restructured
%\pf{HA-prosper} internals;
%\begin{itemize}
%\item[\fbox{3.71}] Solved a small bug writing final toc entry AtEndDocument;
%added |TCS| style by Chris Ellison.
%\end{itemize}
%
%\item[\fbox{3.8}] Added |\tsection*|, |\tsectionandpart*| and
%nesting of bookmarks; created |\dualslide|; added
%|\hiddenitem|, |\putfigure|, |\figureitem| and
%|\putfigureitem|. Revised the documentation; revised the
%examples; added the |\dualslide| example; revised the styles.
%
%\item[\fbox{3.9}] Deleted |\putfigureitem| and |\figureitem|
%and replaced |\putfigure| by the more general |\topbl|;
%improved positioning of bottom text when using |\dualslide|;
%added |indent| option for |\dualslide|; added support for a
%split toc; added package option |hlsections|; added package
%option |blackslide|; solved a bug occurring when
%|\tsectionandpart| was used to create the last slide; added
%|enumstep|; made it possible to nest |itemstep| and
%|enumstep| environments; added |\HAPsetup|, yet only used
%for stepping environments.
%
%\item[\fbox{4.0}] Changed to |.dtx| format and wrote code
%documentation. Added slide options |bm| and |sound|. Added
%default behavior of stepping environments with the |ps2pdf|
%\pf{prosper} option to be type 1, namely all active. Changed
%bookmarking process to a system that allows for deletion of
%bookmarks. Added global control of features through
%|HA-prosper.cfg|. Added |Aggie| style by Jack Stalnaker.
%Made some code more efficient. Added entrance point for
%\pf{ppr-prv} to make redefining macros easier for that class.
%Solved a bug in combination with loading \pf{babel}. Added
%|\onSlide| and |\OnSlide|.
%
%\item[\fbox{4.1}] Moved documentation to |.dtx| file. Added
%package option |counters|. Restored original |\item| and
%created |\xitem|. Changed |\hiddenitem| to |\xitemwait|
%which is a bit more general. Removed a bug in |\onSlide|.
%Rewrote a lot of code. Made \pf{HA-prosper} use \pf{xkeyval}.
%Changed |emptyslide| into more |partslide|. Added |Fyma| style
%by Laurent Jacques.
%
%\begin{itemize}
%\item[\fbox{4.11}] Corrected small bug in \pf{ppr-prv} compatibility
%check. Made \pf{HA-prosper} use original \LaTeX\ macros |\title| and
%|\author|. Added missing `=' in |\HAP@contentsline| definition.
%\end{itemize}
%
%\item[\fbox{4.2}] Improved table of contents typesetting. Added
%|\xitem<n>|. Added |thebibliography| environment. Improved
%positioning of the slide title in the styles. Added handle for state
%of list items. Updated styles. Added |TCSgrad| and |TCSTealBlue|
%styles by Chris Ellison. Added extra syntax for |\onSlide| and
%|\OnSlide| to make displaying material relative to the preceding
%|\xitem|.
%
%\begin{itemize}
%\item[\fbox{4.21}] Added |Capsules| and |Ciment| styles by Mathieu
%Goutelle. Updated for \pf{xkeyval} version 1.4.
%\end{itemize}
%
%\end{itemize}
%
% \StopEventually{\PrintIndex}
%
% \section{Implementation}\label{sec:impl}
%
% \subsection{Preamble and options}
% The start of the file.
%    \begin{macrocode}
%<*program>
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\def\HAP@Version{v4.21}
\ProvidesPackage{HA-prosper}[2004/08/20 \HAP@Version\space Patch for prosper]
\typeout{(c) 2003-2004 Hendri Adriaens, Tilburg, the Netherlands}
\typeout{ }
%    \end{macrocode}
% Required packages. Load \pf{xkeyval} safely to avoid problems with
% \pf{pst-key} which redefines |\setkeys| as well as \pf{xkeyval}.
%    \begin{macrocode}
\let\HAP@orig@setkeys\setkeys
\RequirePackage{xkeyval}
\let\xsetkeys\setkeys
\RequirePackage{xcomment}
\RequirePackage{verbatim}
%    \end{macrocode}
% Check the version of \pf{ppr-prv} for compatibility.
%    \begin{macrocode}
\def\PPRPRV@ReqVersion{v. 0.13}
\@ifclassloaded{ppr-prv}{%
  \ifx\PPRPRV@ReqVersion\PPRPRV@Version\else
    \PackageError{HA-prosper}{HA-prosper \HAP@Version\space and
      ppr-prv \PPRPRV@Version\space are incompatible}%
      {Read the documentation of HA-prosper.}%
  \fi}{}
%    \end{macrocode}
% \DescribeSwitch{slidesonly}\DescribeSwitch{notesonly}\DescribeSwitch{notes}
% Define package options using \pf{xkeyval}. We start with the options for notes.
%    \begin{macrocode}
\newif\ifHAP@notes
\newif\ifHAP@notesonly
\newif\ifHAP@slidesonly
\DeclareOptionX{notes}{\HAP@slidesonlyfalse\HAP@notestrue\HAP@notesonlyfalse}
\DeclareOptionX{notesonly}{\HAP@notesonlytrue\HAP@slidesonlyfalse\HAP@notesfalse}
\DeclareOptionX{slidesonly}{\HAP@slidesonlytrue\HAP@notesonlyfalse\HAP@notesfalse}
%    \end{macrocode}
% \DescribeSwitch{toc}
% Table of contents (toc) option.
%    \begin{macrocode}
\newif\ifHAP@toc
\DeclareOptionX{toc}{\HAP@toctrue}
%    \end{macrocode}
% \DescribeSwitch{highlight}
% Highlighting of toc entries.
%    \begin{macrocode}
\newif\ifHAP@highlight
\DeclareOptionX{highlight}{\HAP@highlighttrue}
%    \end{macrocode}
% \DescribeSwitch{hlsections}
% Permanent highlighting of toc sections.
%    \begin{macrocode}
\newif\ifHAP@hlsections
\DeclareOptionX{hlsections}{\HAP@hlsectionstrue}
%    \end{macrocode}
% \DescribeSwitch{portrait}
% Portrait slides.
%    \begin{macrocode}
\newif\ifHAP@portrait
\DeclareOptionX{portrait}{\HAP@portraittrue}
%    \end{macrocode}
% \DescribeSwitch{blackslide}
% The black slide.
%    \begin{macrocode}
\newif\ifHAP@blackslide
\DeclareOptionX{blackslide}{\HAP@blackslidetrue}
%    \end{macrocode}
% \DescribeSwitch{sounds}
% Include sounds.
%    \begin{macrocode}
\newif\ifHAP@sounds
\DeclareOptionX{sounds}{\HAP@soundstrue}
%    \end{macrocode}
% Default template.
%    \begin{macrocode}
\def\HAP@Style@chosen{HA}
\DeclareOptionX*{\let\HAP@Style@chosen\CurrentOption}
%    \end{macrocode}
% Default: slides only.
%    \begin{macrocode}
\ExecuteOptionsX{slidesonly}
\ProcessOptionsX
%    \end{macrocode}
% Reset |\setkeys| to avoid problems for pstricks packages using
% \pf{pst-key}.
%    \begin{macrocode}
\let\setkeys\HAP@orig@setkeys
%    \end{macrocode}
% \subsection{Main code}
% \subsubsection{Some necessary stuff}
% Temporary boxes, lengths and counters.
%    \begin{macrocode}
\newbox\HAP@tba
\newbox\HAP@tbb
\newlength\HAP@tla
\newlength\HAP@tlb
\newlength\HAP@tlc
\newlength\HAP@tld
\newcounter{HAP@tca}
%    \end{macrocode}
% Paper sizes for portrait and landscape slides.
%    \begin{macrocode}
\ifHAP@portrait
  \slidewidth=150mm
  \slideheight=222mm
\else
  \slidewidth=222mm
  \slideheight=150mm
\fi
%    \end{macrocode}
% \DescribeEnv{NewSlideStyle}
% This environment needs to be redefined to be able to remember
% the anchor and the position of the main text box on slides.
% The original comes from \pf{prosper}.
%    \begin{macrocode}
\renewcommand{\NewSlideStyle}[4][11cm]{%
  \setlength{\slideWidth}{#1}%
  \global\pslongbox{posit@Box}{\rput[#2](#3)}%
  \newslideframe{the#4}{\csname #4\endcsname{##1}}%
  \slidepagestyle{GenericPageStyle}%
  \slideframe{the#4}%
  \gdef\HAP@current@anchor{#2}%
  \gdef\HAP@current@pos{#3}%
}
%    \end{macrocode}
% \DescribeMacro{\protected@write}
% |Seminar| uses a somewhat different writing macro than |latex.ltx|. The
% |seminar| definition gets inserted at every |\begin{slide}| and is local.
% To assure
% that this writing definition is also used in between slides (e.g.
% for |\tsection|) we need to redefine it once. The main difference
% is in the use of |\immediate| by |seminar| while this is not used
% by |latex.ltx|. This difference would, without this definition, create mixing errors.
%    \begin{macrocode}
\def\protected@write#1#2#3{%
  \begingroup
  #2%
  \let\protect\noexpand
  \immediate\normal@write#1{#3}%
  \endgroup
  \if@nobreak\ifvmode\nobreak\fi\fi
}
%    \end{macrocode}
% \subsubsection{Support for notes}
% Notes are created on slides, but with an adapted template. We start
% with defining some counters. The first is used to count the number
% of notes with a particular slide.
%    \begin{macrocode}
\newcounter{HAP@notes@slide}
%    \end{macrocode}
% This counter is used to count the total number of notes.
%    \begin{macrocode}
\newcounter{HAP@notes@true}
%    \end{macrocode}
% And this is a temp counter to remember the slide that the notes
% belong to.
%    \begin{macrocode}
\newcounter{HAP@notes@temp}
%    \end{macrocode}
% The template to be used by notes.
%    \begin{macrocode}
\def\HAP@notes@frame#1{#1}
\ifHAP@portrait
  \def\HAP@notes@template{\NewSlideStyle[8.8cm]{tl}{-0.6,4}{HAP@notes@frame}}
\else
  \def\HAP@notes@template{\NewSlideStyle[8.8cm]{tl}{1.2,4}{HAP@notes@frame}}
\fi
%    \end{macrocode}
% Start writing a file to store notes page numbers.
%    \begin{macrocode}
\ifHAP@notes
  \newwrite\HAP@notesout\openout\HAP@notesout\jobname.not\relax
\fi
%    \end{macrocode}
% When notes only, use saved page numbers.
%    \begin{macrocode}
\ifHAP@notesonly
  \begingroup\InputIfFileExists{\jobname.not}{}{}\endgroup
  \xcomment{notes}
\fi
%    \end{macrocode}
% \begin{environment}{notes}
% This macro defines the notes environment.
%    \begin{macrocode}
\def\notes#1{%
  \ifHAP@slidesonly\comment\else
%    \end{macrocode}
% Count the number of notes with a particular slide. If we are still
% on the same slide, but have a new notes slide, add one to the counter
% for notes slides, otherwise reset that counter.
%    \begin{macrocode}
    \ifnum\value{slide}=\value{HAP@notes@temp}
      \stepcounter{HAP@notes@slide}%
    \else
      \setcounter{HAP@notes@slide}{1}%
    \fi
%    \end{macrocode}
% Set the temp counter to the current slide to remember to which slide
% the notes belong.
%    \begin{macrocode}
    \setcounter{HAP@notes@temp}{\value{slide}}%
    \stepcounter{HAP@notes@true}%
%    \end{macrocode}
% If not notes only, then the notes page numbers get written to disk
% by using labels. This makes sure that, when using the option |notesonly|
% at the first pass of the presentation, there are no errors, only warnings.
%    \begin{macrocode}
    \ifHAP@notesonly\else
      \protected@write\HAP@notesout{}{\string\newlabel{notes@\number\c@HAP@notes@true}%
      {{}{\number\c@HAP@notes@temp-\number\c@HAP@notes@slide}{\relax }{}{}}}%
    \fi
%    \end{macrocode}
% Save anchor and position of the text box of the previous slide.
%    \begin{macrocode}
    \xdef\HAP@temp@anchor{\HAP@current@anchor}%
    \xdef\HAP@temp@pos{\HAP@current@pos}%
%    \end{macrocode}
% Start notes on a portrait slide environment.
%    \begin{macrocode}
    \HAP@notes@template\HAP@portraittrue
    \begin{slide}[toc=,bm=,trans=Replace]{HAP@notitle}\black
    \rput[tl](0,1.5){\fontTitle{\black#1}}%
%    \end{macrocode}
% Position the notes number using |PSTricks|.
%    \begin{macrocode}
    \ifHAP@notesonly
      \rput[tc](4.4,-10.5){\realpageref{notes@\number\c@HAP@notes@true}}%
    \else
      \rput[tc](4.4,-10.5){\number\c@HAP@notes@temp-\number\c@HAP@notes@slide}%
    \fi
  \fi
}
%    \end{macrocode}
% Closing the notes environment and restoring the text box position
% and anchor to its original values to be used by the next slide (or note).
%    \begin{macrocode}
\def\endnotes{%
  \ifHAP@slidesonly\endcomment\else
    \end{slide}%
    \global\pslongbox{posit@Box}{\rput[\HAP@temp@anchor](\HAP@temp@pos)}%
    \gdef\HAP@current@anchor{\HAP@temp@anchor}%
    \gdef\HAP@current@pos{\HAP@temp@pos}%
    \addtocounter{slide}{-1}%
  \fi
}
%    \end{macrocode}
% \end{environment}
% \subsubsection{Blackslide option}
% First we create a template for the black slide.
%    \begin{macrocode}
\def\HAP@bs@frame#1{%
  \psframe[fillstyle=solid,fillcolor=black](-3,-3)(13,13)%
  {#1}%
}
%    \end{macrocode}
% And we position that.
%    \begin{macrocode}
\ifHAP@portrait
  \def\HAP@bs@template{\NewSlideStyle[10cm]{tl}{-1.25,5.9}{HAP@bs@frame}}
\else
  \def\HAP@bs@template{\NewSlideStyle[10cm]{tl}{-1.87,5.2}{HAP@bs@frame}}
\fi
%    \end{macrocode}
% Do not provide blackslide when \pf{ppr-prv} is loaded since it cannot
% be undone by that class. The black slide is a normal slide at the
% start of the presentation, is black and has a black button in the
% top left corner with Acrobat |GoBack| functionality.
%    \begin{macrocode}
\ifHAP@blackslide
  \ifx\PPRPRV@Version\@undefined
%    \end{macrocode}
% Alter PDF starting slide to hide the black slide.
%    \begin{macrocode}
    \def\@pdfstartpage{2}%
    \AtBeginDocument{%
%    \end{macrocode}
% Set the template.
%    \begin{macrocode}
      \HAP@bs@template
      \begin{slide}[trans=Replace,toc=,bm=]{HAP@notitle}%
%    \end{macrocode}
% Create the button.
%    \begin{macrocode}
      {\black\hypertarget{blackslide}{\Acrobatmenu{GoBack}%
        {\setlength{\fboxsep}{.5cm}\fbox{GoBack}}}}%
      \end{slide}%
%    \end{macrocode}
% Restore the slide counter to get real slide numbers right.
%    \begin{macrocode}
      \addtocounter{slide}{-1}%
      \HAPR@normalSlide
    }
  \fi
\fi
%    \end{macrocode}
% \DescribeMacro{\HAP@writebm}
% Macro that writes bookmark entries to the |.bm| file so that they
% can be read on the next pass.
% \HAPcmd{\ci{HAP@writebm}\marg{open}\marg{csec}\marg{title}\marg{page}\marg{bsec}}
% |csec| is the current section label and |bsec| is the section label
% of the section that the current slide belongs to for nesting bookmarks.
% These are used to compute the number of bookmarks that should be
% nested within the current bookmark.
% |open| is `+' or `-' to open bookmarks in the PDF or not.
% The other arguments are self-explaining.
%    \begin{macrocode}
\def\HAP@writebm#1#2#3#4#5{%
    \protected@write\HAP@bmout{}{%
      \string\HAPbookmark{#1}{#2}{#3}{#4}{#5}}%
}
%    \end{macrocode}
% \DescribeMacro{\HAP@checkbmnumber}
% Based on |pdfmark.def| (|hyperref|). Returns the number of bookmarks
% to be nested within the current bookmark. Notice that the macros
% |HAP_[label]| will contain the numbers of bookmarks to be nested
% within the current bookmark.
%    \begin{macrocode}
\def\HAP@checkbmnumber#1{%
  \expandafter\ifx\csname HAP_#1\endcsname\relax
    0%
  \else
    \csname HAP_#1\endcsname
  \fi
}
%    \end{macrocode}
% Temporary counter.
%    \begin{macrocode}
\newcounter{HAP@temp@sc}
%    \end{macrocode}
% \begin{macro}{\HAP@calcbmnumber}
% Based on |pdfmark.def| (|hyperref|). Computes the number of bookmarks
% to be nested within the current bookmark.
%    \begin{macrocode}
\def\HAP@calcbmnumber#1{%
%    \end{macrocode}
% Set the number of bookmarks for this section equal to the number
% of slides that we already encountered.
%    \begin{macrocode}
  \setcounter{HAP@temp@sc}{\HAP@checkbmnumber{#1}}%
%    \end{macrocode}
% Add one bookmark to this section.
%    \begin{macrocode}
  \stepcounter{HAP@temp@sc}%
%    \end{macrocode}
% And save the updated number of bookmarks again in the |HAP_[label]|
% macro which will be read later to nest the bookmarks.
%    \begin{macrocode}
  \expandafter\xdef\csname HAP_#1\endcsname{\number\c@HAP@temp@sc}%
}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\HAPbookmark}
% This is the macro that is written to the |.bm| file. First we
% read the |.bm| file to compute the number of bookmarks to be
% nested within each bookmark.
%    \begin{macrocode}
\def\HAPbookmark#1#2#3#4#5{\HAP@calcbmnumber{#5}}%
\InputIfFileExists{\jobname.bm}{}{}%
%    \end{macrocode}
% Now we redefine the |\HAPbookmark| macro to create the bookmarks.
%    \begin{macrocode}
\def\HAPbookmark#1#2#3#4#5{%
%    \end{macrocode}
% Notice the use of |\pdfstringdef| to allow for things like |\"i|
% in bookmarks.
%    \begin{macrocode}
  \pdfstringdef\HAP@temp@bm{#3}%
  \pdfmark{pdfmark=/OUT,
    Raw={/Count #1\HAP@checkbmnumber{#2}
    /Page #4 /View [/XYZ null null null]
    /Title (\HAP@temp@bm)}%
  }%
}%
%    \end{macrocode}
% We read the |.bm| file again and now the bookmarks will be created.
%    \begin{macrocode}
\InputIfFileExists{\jobname.bm}{}{}%
%    \end{macrocode}
% After reading the |.bm| file, we rewrite it for the next pass.
%    \begin{macrocode}
\newwrite\HAP@bmout\immediate\openout\HAP@bmout\jobname.bm\relax
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\SlideSound}
% This macro creates a link to a sound file and sets the open action
% of the current page to play the file. Notice that this will make
% the PDF neither self sustaining nor system independent! This macro
% can be called from the optional arguments of slide environments, but
% can also be called directly for more flexibility.
%    \begin{macrocode}
\def\SlideSound#1{%
  \ifHAP@sounds
%    \end{macrocode}
% Check availability of the sound file in the current directory. Note
% the use of |.///| for the current directory to circumvent a bug in
% MiKTeX. |./| is the standard to denote the current directory but
% MiKTeX (only) still searches the \TeX\ tree when using |./|. This
% bug has been reported to MiKTeX and will hopefully be solved soon.
%    \begin{macrocode}
    \IfFileExists{.///#1}{}{%
      \PackageError{HA-prosper}{The sound file is not in the
      current directory. You can go ahead, but any PDF viewer
      will complain that the file is missing!}\@ehc
    }%
%    \end{macrocode}
% Put the link to the media on the slide.
%    \begin{macrocode}
    \pdfmark{pdfmark=/ANN,
      Raw={/Rect [0 0 0 0] /Subtype /Movie
      /Title (SlideSound) /Movie << /F (#1) >>}%
    }%
%    \end{macrocode}
% Play the file when the current slide is displayed.
%    \begin{macrocode}
    \pdfmark{pdfmark=/PUT,
      Raw={{ThisPage} << /AA << /O << /S /Movie
      /T (SlideSound) /Operation /Play >> >> >>}%
    }%
  \fi
}
%    \end{macrocode}
% \end{macro}
% \subsubsection{Sectioning the presentation}
% First some counters. The first counter is used for counting slides
% inside sections in the toc.
%    \begin{macrocode}
\newcounter{HAP@sc@toc}
%    \end{macrocode}
% This counter is used to count sections in the presentation.
%    \begin{macrocode}
\newcounter{HAP@sc@pres}
%    \end{macrocode}
% This counter is for counting the number of slides in a section.
%    \begin{macrocode}
\newcounter{HAP@sc@slides}
%    \end{macrocode}
% \DescribeMacro{\tsection}
% This macro creates a section in the table of contents. The stared
% version creates a hidden section. The optional argument is for
% creating a bookmark. The macro uses |\HAP@@tsection| to do the job.
%    \begin{macrocode}
\def\tsection{\@ifstar
  {\@ifnextchar[{\HAP@@tsection{0}{2}}{\HAP@@tsection{0}{2}[]}}%
  {\@ifnextchar[{\HAP@@tsection{0}{1}}{\HAP@@tsection{0}{1}[]}}%
}
%    \end{macrocode}
% \begin{macro}{\HAP@@tsection}
% The workhorse for |\tsection|, |\tsectionandpart| and |\part|.
% \HAPcmd{\ci{HAP@@tsection}\marg{page}\marg{type}\oarg{bm}\marg{title}} |page| indicates
% whether the section got a page (1) or not (0). |type| indicates
% the type of section: 0=not a section (to serve |\part|), 1=normal, 2=hidden.
% This indicator is reused by several other macros, like |\pcontentsline|.
% The optional argument |bm| can contain a replacement for the bookmark
% title created by the |title| option.
%    \begin{macrocode}
\def\HAP@@tsection#1#2[#3]#4{%
%    \end{macrocode}
% Check whether the optional argument is empty. If yes, set it to
% the mandatory argument. This cannot be done by |\tsection| since
% the |\HAP@part| macro needs to access |\@tsection| macro directly.
%    \begin{macrocode}
  \def\HAP@tempa{#3}%
  \ifx\HAP@tempa\@empty
    \def\HAP@tempa{#4}%
  \fi
%    \end{macrocode}
% Step the section counter since we have a new section.
%    \begin{macrocode}
  \stepcounter{HAP@sc@pres}%
%    \end{macrocode}
% Reset the counter for slides in a section.
%    \begin{macrocode}
  \setcounter{HAP@sc@slides}{0}%
%    \end{macrocode}
% Step this counter to get correct bookmarks.
%    \begin{macrocode}
  \stepcounter{trueSlideCounter}%
%    \end{macrocode}
% Add an entry to the |.toc| file.
%    \begin{macrocode}
  \HAP@contentsline{#2}{#4}{\number\c@trueSlideCounter}{\number\c@HAP@sc@pres}%
%    \end{macrocode}
% Write a bookmark.
%    \begin{macrocode}
  \HAP@writebm{}{section.\number\c@HAP@sc@pres}{\HAP@tempa}%
    {\number\c@trueSlideCounter}{}%
%    \end{macrocode}
% Reset the main slide counter.
%    \begin{macrocode}
  \addtocounter{trueSlideCounter}{-1}%
}
%    \end{macrocode}
% \end{macro}
% \subsubsection{part and tsectionandpart}
% An optional key for |\part| and |\tsectionandpart|.
%    \begin{macrocode}
\define@key{HAP@keys@slide}{template}{\def\HAP@templatekey{#1}}
%    \end{macrocode}
% \DescribeMacro{\part}
% This macro uses |\HAP@part|. The entry `0' indicates that this
% macro does not produce a section. See also the |\tsection| macro.
%    \begin{macrocode}
\def\part{\@ifnextchar[{\HAP@part{0}}{\HAP@part{0}[]}}
%    \end{macrocode}
% \DescribeMacro{\tsectionandpart}
% Creates a |\tsection| and a |\part|. The stared version creates
% a hidden section and part.
%    \begin{macrocode}
\def\tsectionandpart{\@ifstar
  {\@ifnextchar[{\HAP@part{2}}{\HAP@part{2}[]}}%
  {\@ifnextchar[{\HAP@part{1}}{\HAP@part{1}[]}}%
}
%    \end{macrocode}
% \begin{macro}{\HAP@part}
% The workhorse for |\part| and |\tsectionandpart|.
% \HAPcmd{\ci{HAP@part}\marg{type}\oarg{opt}\marg{title}}
% |type| coincides with the types used by |\tsection|.
%    \begin{macrocode}
\def\HAP@part#1[#2]#3{%
%    \end{macrocode}
% Grouping is necessary to keep options local.
%    \begin{macrocode}
  \begingroup
%    \end{macrocode}
% Set options.
%    \begin{macrocode}
  \xsetkeys{HAP@keys@slide,HAP@keys@slidespec}{#2}%
%    \end{macrocode}
% Several cases. We start with `not a section'.
%    \begin{macrocode}
  \ifnum#1=\z@
    \ifx\HAP@bmkey\@empty
%    \end{macrocode}
% If bookmark entry is empty, overwrite it to use the title.
%    \begin{macrocode}
      \begin{\HAP@templatekey}[toc=#3,#2,bm=#3]{HAP@notitle}%
    \else
%    \end{macrocode}
% In all other cases, use the bookmark entry supplied by the user
% if is actually there. By default, use the title.
%    \begin{macrocode}
      \begin{\HAP@templatekey}[bm=#3,toc=#3,#2]{HAP@notitle}%
    \fi
  \else
%    \end{macrocode}
% It is a section.
%    \begin{macrocode}
    \ifcase
      \ifx\HAP@tockey\@undefined\@ne\fi
      \ifx\HAP@tockey\@empty\@ne\fi
      \z@
      \ifcase
        \ifx\HAP@bmkey\@undefined\@ne\fi
        \ifx\HAP@bmkey\@empty\@ne\fi
        \z@
%    \end{macrocode}
% Create the section with the supplied optional arguments.
%    \begin{macrocode}
        \HAP@@tsection{1}{#1}[\HAP@bmkey]{\HAP@tockey}%
      \else
%    \end{macrocode}
% Create the section with the title as bookmark since it is absent.
%    \begin{macrocode}
        \HAP@@tsection{1}{#1}[#3]{\HAP@tockey}%
      \fi
    \else
      \ifcase
        \ifx\HAP@bmkey\@undefined\@ne\fi
        \ifx\HAP@bmkey\@empty\@ne\fi
        \z@
%    \end{macrocode}
% Use the title for the toc.
%    \begin{macrocode}
        \HAP@@tsection{1}{#1}[\HAP@bmkey]{#3}%
      \else
%    \end{macrocode}
% Use the title for both the toc and the bookmark.
%    \begin{macrocode}
        \HAP@@tsection{1}{#1}[#3]{#3}%
      \fi
    \fi
%    \end{macrocode}
% For sections, do not create a toc entry or bookmark since that
% is already done by |\HAP@@tsection|, but we do create a slide.
%    \begin{macrocode}
    \begin{\HAP@templatekey}[#2,toc=,bm=]{HAP@notitle}%
  \fi
%    \end{macrocode}
% Put the text onto the slide, after \pf{prosper}.
%    \begin{macrocode}
  \vspace*{1.5cm}%
  \begin{center}%
    \fontTitle{#3}%
  \end{center}%
  \end{\HAP@templatekey}%
  \endgroup
}
%    \end{macrocode}
% \end{macro}
% \subsubsection{Table of contents}
% First some initializations. |\HAP@tempentryb| holds the toc entry
% from one slide to the next to determine at which pages highlighting
% of this entry needs to be created. Versions a--d of |\HAP@tempentry|
% are all used for storing part of a toc entry.
%    \begin{macrocode}
\let\HAP@tocentryb\@undefined
%    \end{macrocode}
% True if a toc entry is the first inside the toc. Used to determine
% if vertical space needs to be inserted or not.
%    \begin{macrocode}
\newif\ifHAP@firstTocEntry
%    \end{macrocode}
% Write the toc at the end of the document so that it can be used
% during a pass.
%    \begin{macrocode}
\AtEndDocument{%
  \ifHAP@toc
    \expandafter\newwrite\csname tf@toc\endcsname
    \immediate\openout\csname tf@toc\endcsname\jobname.toc\relax
%    \end{macrocode}
% When highlighting toc entries, the toc is created with a lag to be able to
% determine the start and stop slide for highlighting and hence the
% final entry has to be written to file at the end of the document.
%    \begin{macrocode}
    \ifHAP@highlight\ifHAP@notesonly\else
      \stepcounter{trueSlideCounter}%
      \protected@write\@auxout{}{%
        \string\@writefile{toc}{%
        \string\pcontentsline{\HAP@tocentrya}{\HAP@tocentryb}%
          {\HAP@tocentryc}{\number\c@trueSlideCounter}{\HAP@tocentryd}}%
      }%
  \fi\fi\fi
}
%    \end{macrocode}
% \begin{macro}{\pcontentsline}
% This macro is used in the |.toc| file and creates the actual toc
% entry from a set of inputs.
% \HAPcmd{\ci{pcontentsline}\marg{type}\marg{title}\marg{start}\marg{stop}\marg{secctr}}
% For |type|, see |\tsection|.
% |start| is the starting page of the slide and |stop| is the
% final slide, both used for highlighting toc entries. If no highlighting
% is requested, only |start| is used to create a link to that page. |secctr| is
% the number of the section in the presentation (only used when
% |type| is 1 or 2). This macro does the first rough filtering in
% the decision to display the inputs at a certain slide or not.
%    \begin{macrocode}
\def\pcontentsline#1#2#3#4#5{%
%    \end{macrocode}
% Not a section.
%    \begin{macrocode}
  \ifnum#1=\z@
%    \end{macrocode}
% For |\HAP@toctype| see the definitions of |\HAP@toc|, |\HAP@tcontent|
% and |\HAP@tsections|. If 1, only sections wanted, hence do nothing.
% Else continue to |\HAP@pcontentsline|.
%    \begin{macrocode}
    \ifnum\HAP@toctype=\@ne\else
      \HAP@pcontentsline{#1}{#2}{#3}{#4}{#5}%
    \fi
%    \end{macrocode}
% It is a section.
%    \begin{macrocode}
  \else
%    \end{macrocode}
% If 2, hidden section, only set counter for keeping track of the
% section number inside the toc which is necessary for the |hlsections|
% package option.
%    \begin{macrocode}
    \ifnum\HAP@toctype=\tw@
      \setcounter{HAP@sc@toc}{#5}%
    \else
%    \end{macrocode}
% Else continue to |\HAP@pcontentsline|.
%    \begin{macrocode}
      \HAP@pcontentsline{#1}{#2}{#3}{#4}{#5}%
    \fi
  \fi
}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\HAP@pcontentsline}
% Workhorse for |\pcontentsline|.
% \HAPcmd{\ci{HAP@pcontentsline}\marg{type}\marg{title}\marg{start}\marg{stop}\marg{secctr}}
% Takes the same arguments as that  macro and is used to divide input
% in all different cases and creates PDF page links from those inputs.
%    \begin{macrocode}
\def\HAP@pcontentsline#1#2#3#4#5{%
%    \end{macrocode}
% It is not a section.
%    \begin{macrocode}
  \ifnum#1=\z@
%    \end{macrocode}
% Select right typesetting for toc entry.
%    \begin{macrocode}
    \ifnum\HAP@toctype=\tw@
      \def\HAP@toctext{\HAP@tlineonly{#2}}%
    \else
      \def\HAP@toctext{\HAP@tline{#2}}%
    \fi
%    \end{macrocode}
% It is a section.
%    \begin{macrocode}
  \else
%    \end{macrocode}
% Set the counter for later use and typeset the section.
%    \begin{macrocode}
    \setcounter{HAP@sc@toc}{#5}%
    \ifnum\HAP@toctype=\@ne
      \def\HAP@toctext{\HAP@tsectiononly{#2}}%
    \else
      \def\HAP@toctext{\HAP@tsection{#2}}%
    \fi
  \fi
%    \end{macrocode}
% Here we end up with some cluster of cases. Basically, we need to
% determine whether or not the toc entry at hand should be displayed
% and if it will be highlighted. Let's go ahead case by case, line by line.
%    \begin{macrocode}
  \ifcase
%    \end{macrocode}
% First, we decide whether or not to display the entry. We display
% the entry at hand on this slide if it is in the current section.
%    \begin{macrocode}
    \ifnum\value{HAP@sc@pres}=\value{HAP@sc@toc}\@ne\fi
%    \end{macrocode}
% Or if it is an entry that occurs before the first section (independent
% of the current toc section), but only if the toc type is 0. If it is not 0
% we only display it when the first section didn't start yet.
%    \begin{macrocode}
    \ifnum\value{HAP@sc@toc}=\z@\ifnum\HAP@toctype=\z@\@ne\else
      \ifnum\value{HAP@sc@pres}=\z@\@ne\fi\fi\fi
%    \end{macrocode}
% Or when it is a regular section. Hidden sections (type 2) and
% content of not current sections is not displayed.
%    \begin{macrocode}
    \ifnum#1=\@ne\@ne\fi
    \z@
  \else
%    \end{macrocode}
% Add extra vertical space between sections and items given that the
% current entry section is not the first entry in the toc. Be careful
% for a possibly split toc. No extra vertical space in that case.
%    \begin{macrocode}
    \ifHAP@firstTocEntry\else
      \ifcase
        \ifnum#1=\z@\@ne\fi
        \ifnum\HAP@toctype=\@ne\@ne\fi
        \z@
        \vspace*{\HAP@tsectionskip}%
      \else
        \vspace*{\HAP@titemskip}%
      \fi
    \fi
%    \end{macrocode}
% Set for the rest of the |.toc| processing.
%    \begin{macrocode}
    \HAP@firstTocEntryfalse
%    \end{macrocode}
% Add a section marker when the current entry is a section.
%    \begin{macrocode}
    \ifnum#1=\z@\else\HAP@tsectionm\fi
%    \end{macrocode}
% Then we come to the point where we start to create the
% toc entries. Now we have to decide how to display the entries.
%    \begin{macrocode}
    \ifcase
%    \end{macrocode}
% If highlighting has been requested
%    \begin{macrocode}
      \ifHAP@highlight
%    \end{macrocode}
% and if the current entry is the active one
%    \begin{macrocode}
        \ifnum\value{trueSlideCounter}<#3\space\else
          \ifnum\value{trueSlideCounter}<#4\@ne\fi\fi
%    \end{macrocode}
% or the section is the current section and section highlighting
% has been requested, then we highlight the entry.
%    \begin{macrocode}
        \ifHAP@hlsections\ifnum#1=\z@\else
          \ifnum\value{HAP@sc@pres}=\value{HAP@sc@toc}\@ne\fi\fi\fi
      \fi
      \z@
      \let\HAP@tempa\HAP@tocentry
    \else
      \let\HAP@tempa\HAP@hltocentry
    \fi
%    \end{macrocode}
% Create the pdf hyperlink to the page.
%    \begin{macrocode}
    \HAP@pdfpagelink{\HAP@tempa}{#3}%
    \par
  \fi
}
%    \end{macrocode}
% \end{macro}
% \DescribeMacro{\HAP@pdfpagelink}
% This macro creates the page link for |\HAP@pcontentsline| using a PDF annotation.
% \HAPcmd{\ci{HAP@pdfpagelink}\marg{constr}\marg{page}}
% |constr| is the construction to attach the link to.
% |page| is the target page. This code does not use |hyperref|'s
% hypertarget since these can lead to half slides being displayed.
%    \begin{macrocode}
\def\HAP@pdfpagelink#1#2{%
  \pdfmark[#1]{pdfmark=/LNK,
    Raw={/Page #2 /Border [0 0 0] /View [/XYZ null null null]}}%
}
%    \end{macrocode}
% \begin{macro}{\HAP@contentsline}
% This macro writes the toc entries to disk or remembers them
% if necessary. \HAPcmd{\ci{HAP@contentsline}\marg{type}\marg{title}\marg{page}\marg{secctr}}
% For the arguments, see |\pcontentsline|.
%    \begin{macrocode}
\def\HAP@contentsline#1#2#3#4{%
  \ifHAP@toc
    \ifHAP@highlight
      \ifx\HAP@tocentryb\@undefined\else
%    \end{macrocode}
% When highlighting and it is not the first toc entry of the presentation, write it to disk.
%    \begin{macrocode}
        \protected@write\@auxout{}{%
          \string\@writefile{toc}{%
          \string\pcontentsline{\HAP@tocentrya}{\HAP@tocentryb}%
            {\HAP@tocentryc}{#3}{\HAP@tocentryd}}}%
      \fi
%    \end{macrocode}
% Remember the current entry. This is done to remember the starting
% page of a slide. Write it when the next slide appears and the final
% page of the current slide is known.
%    \begin{macrocode}
      \gdef\HAP@tocentrya{#1}%
%    \end{macrocode}
% |\protected@xdef| necessary to expand |\@tockey| inputs correctly.
%    \begin{macrocode}
      \protected@xdef\HAP@tocentryb{#2}%
      \xdef\HAP@tocentryc{#3}%
      \xdef\HAP@tocentryd{#4}%
    \else
%    \end{macrocode}
% When not highlighting, write the entry to disk.
%    \begin{macrocode}
      \protected@write\@auxout{}{%
        \string\@writefile{toc}{%
        \string\pcontentsline{#1}{#2}{#3}{}%
        {\ifnum#1=\z@\else\number\c@HAP@sc@pres\fi}}}%
    \fi
  \fi
}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\HAP@toc}
% \begin{macro}{\HAP@tsections}
% \begin{macro}{\HAP@tcontent}
% These macros put (part of) the table of contents on slides.
% The latter two allow for splitting of the toc. Notice that
% the actual splitting is handled by |\pcontentsline| using
% |\HAP@toctype| as guidance. The macros use |\HAP@tocinput|
% to perform initializations and then load the |.toc| file.
% The first macro will put the entire toc on slides.
%    \begin{macrocode}
\def\HAP@toc{%
  \def\HAP@toctype{0}%
%    \end{macrocode}
% Load |.toc| file.
%    \begin{macrocode}
  \HAP@tocinput
}
%    \end{macrocode}
% This puts only the sections on slides.
%    \begin{macrocode}
\def\HAP@tsections{%
  \def\HAP@toctype{1}%
  \HAP@tocinput
}
%    \end{macrocode}
% This puts only the current section content on slides.
%    \begin{macrocode}
\def\HAP@tcontent{%
  \def\HAP@toctype{2}%
  \HAP@tocinput
}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \begin{macro}{\HAP@tocinput}
% Macro performs some initializations and then loads the |.toc| file.
%    \begin{macrocode}
\def\HAP@tocinput{%
%    \end{macrocode}
% Eliminates space on top of the first toc entry.
%    \begin{macrocode}
  \HAP@firstTocEntrytrue
%    \end{macrocode}
% Reset within |.toc| counter.
%    \begin{macrocode}
  \setcounter{HAP@sc@toc}{0}%
%    \end{macrocode}
% Allow for instance the |babel| package to insert |\select@language|
% into the |.toc| file.
%    \begin{macrocode}
  \makeatletter
%    \end{macrocode}
% Apply |\FontToc| and input |.toc| file for processing.
%    \begin{macrocode}
  \fontToc{\InputIfFileExists{\jobname.toc}{}{}}%
  \makeatother
}
%    \end{macrocode}
% \end{macro}
% \subsubsection{Redefining slide definitions}
% We start with optional keys for the new slide environment.
%    \begin{macrocode}
\define@key{HAP@keys@slidespec}{bm}{\def\HAP@bmkey{#1}}
\define@key{HAP@keys@slidespec}{toc}{\def\HAP@tockey{#1}}
\define@key{HAP@keys@slide}{trans}{\def\HAP@transkey{#1}}
\define@key{HAP@keys@slide}{sound}{\def\HAP@soundkey{#1}}
%    \end{macrocode}
% \begin{environment}{SlideNormal}
% What follows now is adapted code, originally taken from
% \pf{prosper}.
%    \begin{macrocode}
\def\SlideNormal{\@ifnextchar[\HAP@SlideNormal{\HAP@SlideNormal[]}}
\def\HAP@SlideNormal[#1]#2{%
%    \end{macrocode}
% Set the optional keys using the \pf{xkeyval} package.
%    \begin{macrocode}
  \xsetkeys{HAP@keys@slide,HAP@keys@slidespec}{#1}%
  \stepcounter{trueSlideCounter}%
%    \end{macrocode}
% Transition effects.
%    \begin{macrocode}
  \PDFtransition{\HAP@transkey}%
%    \end{macrocode}
% Add transition sounds.
%    \begin{macrocode}
  \ifx\HAP@soundkey\@undefined\else
    \SlideSound{\HAP@soundkey}%
  \fi
  \begin{slide@seminar}%
%    \end{macrocode}
% |\landscapefalse| is defined by |seminar|.
%    \begin{macrocode}
    \ifHAP@portrait\landscapefalse\fi
%    \end{macrocode}
% Slide title empty?
%    \begin{macrocode}
    \def\HAP@tempa{#2}%
    \def\HAP@tempb{HAP@notitle}%
    \ifx\HAP@tempa\HAP@tempb
%    \end{macrocode}
% This part is used by |\part| related commands and |\maketitle|. It
% allows these macros to delete the toc entry and the bookmark entry.
% Deleting bookmark entries on other slides will mess up the nesting
% of bookmarks into sections. First checking the toc entry.
%    \begin{macrocode}
      \ifx\HAP@tockey\@undefined\else\ifx\HAP@tockey\@empty\else
        \HAP@contentsline{0}{\HAP@tockey}{\number\c@trueSlideCounter}{}%
      \fi\fi
%    \end{macrocode}
% Check the bookmark entry. If empty, do not create the bookmark.
%    \begin{macrocode}
      \ifx\HAP@bmkey\@undefined\else\ifx\HAP@bmkey\@empty\else
%    \end{macrocode}
% We have a new bookmark in the current section.
%    \begin{macrocode}
        \stepcounter{HAP@sc@slides}%
%    \end{macrocode}
% Write the bookmark to the |.bm| file. The labelling will later on
% be used to compute the number of bookmarks to be nested within
% the current section.
%    \begin{macrocode}
        \HAP@writebm{}{section.\number\c@HAP@sc@pres.\number\c@HAP@sc@slides}%
          {\HAP@bmkey}{\number\c@trueSlideCounter}{section.\number\c@HAP@sc@pres}%
      \fi\fi
    \else
%    \end{macrocode}
% Slide title.
%    \begin{macrocode}
      \slidetitle{#2}%
%    \end{macrocode}
% Empty bookmarks will not be created.
%    \begin{macrocode}
      \ifx\HAP@bmkey\@undefined
        \stepcounter{HAP@sc@slides}%
        \HAP@writebm{}{section.\number\c@HAP@sc@pres.\number\c@HAP@sc@slides}%
          {#2}{\number\c@trueSlideCounter}{section.\number\c@HAP@sc@pres}%
      \else\ifx\HAP@bmkey\@empty\else
        \stepcounter{HAP@sc@slides}%
        \HAP@writebm{}{section.\number\c@HAP@sc@pres.\number\c@HAP@sc@slides}%
          {\HAP@bmkey}{\number\c@trueSlideCounter}{section.\number\c@HAP@sc@pres}%
      \fi\fi
%    \end{macrocode}
% Create toc entry, unless it is empty, then delete it from the toc.
%    \begin{macrocode}
      \ifx\HAP@tockey\@undefined
        \HAP@contentsline{0}{#2}{\number\c@trueSlideCounter}{}%
      \else\ifx\HAP@tockey\@empty\else
        \HAP@contentsline{0}{\HAP@tockey}{\number\c@trueSlideCounter}{}%
      \fi\fi
    \fi
%    \end{macrocode}
% Start a box, a minipage and make it raggedright.
%    \begin{macrocode}
    \begin{posit@Box}%
      \begin{minipage}{\slideWidth}%
        \raggedright
        \@DefMyItem%
%    \end{macrocode}
% Set the text font.
%    \begin{macrocode}
        \ifinColor\@fontTextColor\else\@fontTextBW\fi
}
%    \end{macrocode}
% Close all started environments and boxes.
%    \begin{macrocode}
\def\endSlideNormal{%
      \end{minipage}%
    \end{posit@Box}%
  \end{slide@seminar}%
}
%    \end{macrocode}
% \end{environment}
% \begin{environment}{SlideOverlay}
% Overlay slides are very comparable to |\SlideNormal|, but these
% get nested bookmarks and an overlay. The case |\ifDVItoPStrue|
% which \pf{prosper} specifies, is
% not interesting here since the macro is only called from the
% |Overlays| environment which is called from |\overlays| (see page~\pageref{macro:overlays})
% but only
% |\ifDVItoPSfalse|. There is no useful application of the |Overlays|
% environment when not being called from the |\overlays| macro.
%    \begin{macrocode}
\def\SlideOverlay{\@ifnextchar[\HAP@SlideOverlay{\HAP@SlideOverlay[]}}
\def\HAP@SlideOverlay[#1]#2{%
  \xsetkeys{HAP@keys@slide,HAP@keys@slidespec}{#1}%
  \stepcounter{trueSlideCounter}%
  \PDFtransition{\HAP@transkey}%
  \ifx\HAP@soundkey\@undefined\else
    \SlideSound{\HAP@soundkey}%
  \fi
  \begin{slide@seminar}%
    \ifHAP@portrait\landscapefalse\fi
    \def\HAP@tempa{#2}%
    \def\HAP@tempb{HAP@notitle}%
    \ifx\HAP@tempa\HAP@tempb\else
      \ifHAP@firstOverlay
%    \end{macrocode}
% This code is used for the first overlay slide created by |\overlays|.
%    \begin{macrocode}
        \global\HAP@firstOverlayfalse
%    \end{macrocode}
% \pf{prosper} option to open bookmarks of overlays.
%    \begin{macrocode}
        \ifcollapsedBookmarks\def\HAP@tempa{-}\else\def\HAP@tempa{}\fi
%    \end{macrocode}
% Create bookmarks, nest them and open them if requested.
%    \begin{macrocode}
        \ifx\HAP@bmkey\@undefined
          \stepcounter{HAP@sc@slides}%
          \HAP@writebm{\HAP@tempa}{section.\number\c@HAP@sc@pres.\number\c@HAP@sc@slides}%
            {#2}{\number\c@trueSlideCounter}{section.\number\c@HAP@sc@pres}%
        \else\ifx\HAP@bmkey\@empty\else
          \stepcounter{HAP@sc@slides}%
          \HAP@writebm{\HAP@tempa}{section.\number\c@HAP@sc@pres.\number\c@HAP@sc@slides}%
            {\HAP@bmkey}{\number\c@trueSlideCounter}{section.\number\c@HAP@sc@pres}%
        \fi\fi
%    \end{macrocode}
% Create toc entries.
%    \begin{macrocode}
        \ifx\HAP@tockey\@undefined
          \HAP@contentsline{0}{#2}{\number\c@trueSlideCounter}{}%
        \else\ifx\HAP@tockey\@empty\else
          \HAP@contentsline{0}{\HAP@tockey}{\number\c@trueSlideCounter}{}%
        \fi\fi
      \else
%    \end{macrocode}
% This case relates to the rest of the slides created by |\overlays|.
% Create bookmarks without nesting and no toc entries.
%    \begin{macrocode}
        \ifx\HAP@bmkey\@undefined
          \HAP@writebm{}{overlay}{#2}{\number\c@trueSlideCounter}%
            {section.\number\c@HAP@sc@pres.\number\c@HAP@sc@slides}%
        \else\ifx\HAP@bmkey\@empty\else
          \HAP@writebm{}{overlay}{\HAP@bmkey}{\number\c@trueSlideCounter}%
            {section.\number\c@HAP@sc@pres.\number\c@HAP@sc@slides}%
        \fi\fi
      \fi
      \slidetitle{#2}%
    \fi
    \begin{posit@Box}%
      \begin{minipage}{\slideWidth}%
        \raggedright
        \@DefMyItem%
        \ifinColor\@fontTextColor\else\@fontTextBW\fi
        {\overlay{1}}%
}
%    \end{macrocode}
% Close all started environments and boxes.
%    \begin{macrocode}
\def\endSlideOverlay{%
      \end{minipage}%
    \end{posit@Box}%
  \end{slide@seminar}%
  \ifDVItoPS\else
    \addtocounter{slide}{-1}%
  \fi
}
%    \end{macrocode}
% \end{environment}
% \DescribeEnv{slide}
% These macros define the |slide| environment.
%    \begin{macrocode}
\let\slide=\SlideNormal
\let\endslide=\endSlideNormal
%    \end{macrocode}
% \subsubsection{Bibliography}
% \DescribeEnv{thebibliography}
% This section includes a redefined |bibliography| environment which
% does not create a section heading. The original has been taken from
% |article.cls|.
%    \begin{macrocode}
\renewenvironment{thebibliography}[1]{%
  \list{\@biblabel{\@arabic\c@enumiv}}%
    {\settowidth\labelwidth{\@biblabel{#1}}%
    \leftmargin\labelwidth
    \advance\leftmargin\labelsep
    \@openbib@code
    \usecounter{enumiv}%
    \let\p@enumiv\@empty
    \renewcommand\theenumiv{\@arabic\c@enumiv}}%
  \sloppy
  \clubpenalty4000
  \@clubpenalty \clubpenalty
  \widowpenalty4000%
  \sfcode`\.\@m
}{%
  \def\@noitemerr{\@latex@warning{Empty `thebibliography' environment}}%
  \endlist
}
%    \end{macrocode}
% \subsubsection{Underlying macros for itemize and enumerate}
% First let the \pf{prosper} command |\NoFrenchBabelItemize| do nothing
% anymore since we redefine lists |\AtBeginDocument| always.
%    \begin{macrocode}
\let\NoFrenchBabelItemize\relax
\def\HAP@toodeep{\PackageError{HA-prosper}{Items too deeply nested}\@ehd}
%    \end{macrocode}
% |\ifHAP@active| indicates state of an item. \pf{HA-prosper} only
% sets it, but does not use it. It can be used in styles.
%    \begin{macrocode}
\newif\ifHAP@active
%    \end{macrocode}
% |\ifHAP@nested| indicates whether an |itemize| or |enumerate|
% environment is nested in a stepping environment. In that case,
% active state is inherited.
%    \begin{macrocode}
\newif\ifHAP@nested
%    \end{macrocode}
% Keep a copy of the original |\item|.
%    \begin{macrocode}
\let\HAP@orig@item=\item
%    \end{macrocode}
% \DescribeMacro{\xitem}
% The |\xitem| macro.
%    \begin{macrocode}
\def\xitem{\@ifnextchar<\HAP@xitem{\HAP@xitem<0>}}
%    \end{macrocode}
% \DescribeMacro{\HAP@xitem}
% The workhorse for |\xitem|. It can be reset in environments.
%    \begin{macrocode}
\def\HAP@xitem<#1>{%
  \PackageError{HA-prosper}{Lonely \string\item--perhaps a missing
    list environment}\@ehc
}
\AtBeginDocument{%
%    \end{macrocode}
% \begin{environment}{HAP@itemize}
% Define the |HAP@itemize| and |HAP@enumerate| environments without a left block indent
% and |topsep| since this creates ugly lists on slides and wastes
% a lot of space.
% Definitions taken mainly from |latex.ltx| and modified.
%    \begin{macrocode}
  \def\itemize{%
    \def\HAP@xitem<##1>{%
%    \end{macrocode}
% If not nested, item is active, otherwise, inherit.
%    \begin{macrocode}
      \ifHAP@nested\else\HAP@activetrue\fi
      \HAP@orig@item
    }%
    \ifnum\@itemdepth>\tw@\HAP@toodeep\else
      \advance\@itemdepth\@ne
      \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}%
      \expandafter
      \list
        \csname\@itemitem\endcsname{%
%    \end{macrocode}
% Setting relevant lengths.
%    \begin{macrocode}
        \setlength{\itemsep}{\z@}%
        \setlength{\parsep}{\z@}%
        \setlength{\topsep}{\z@}%
        \setlength{\partopsep}{\z@}%
        \addtolength{\topsep}{-\parskip}%
        \addtolength{\partopsep}{\parskip}%
        \ifnum\@itemdepth<2
          \settowidth{\HAP@tla}{\labelitemi}%
          \addtolength{\HAP@tla}{\labelsep}%
          \setlength{\leftmargin}{\HAP@tla}%
          \setlength{\itemsep}{.5ex}%
        \fi\raggedright
        \def\makelabel##1{\hss\llap{##1}}}%
    \fi
  }
%    \end{macrocode}
% End the list.
%    \begin{macrocode}
  \let\enditemize\endlist
%    \end{macrocode}
% \end{environment}
% \begin{environment}{HAP@enumerate}
% For |HAP@enumerate| we do roughly the same thing.
%    \begin{macrocode}
  \def\enumerate{%
    \def\HAP@xitem<##1>{%
      \ifHAP@nested\else\HAP@activetrue\fi
      \HAP@orig@item
    }%
    \ifnum\@enumdepth>\tw@\HAP@toodeep\else
      \advance\@enumdepth\@ne
      \edef\@enumctr{enum\romannumeral\the\@enumdepth}%
      \expandafter
      \list
        \csname label\@enumctr\endcsname{%
        \setlength{\itemsep}{\z@}%
        \setlength{\parsep}{\z@}%
        \setlength{\topsep}{\z@}%
        \setlength{\partopsep}{\z@}%
        \addtolength{\topsep}{-\parskip}%
        \addtolength{\partopsep}{\parskip}%
        \ifnum\@enumdepth<2
          \settowidth{\HAP@tla}{\labelenumi}%
          \addtolength{\HAP@tla}{\labelsep}%
          \setlength{\leftmargin}{\HAP@tla}%
          \setlength{\itemsep}{.5ex}%
        \fi\raggedright
        \usecounter\@enumctr\def\makelabel##1{\hss\llap{##1}}}%
    \fi
  }
%    \end{macrocode}
% End the list.
%    \begin{macrocode}
  \let\endenumerate\endlist
%    \end{macrocode}
% \end{environment}
% End of |\AtBeginDocument|.
%    \begin{macrocode}
}
%    \end{macrocode}
% \subsubsection{Stepping environments}
% Now we define animated lists. We start with the overall depth of a list
% with possibly |itemstep|s and |enumstep|s nested into each other.
%    \begin{macrocode}
\newcounter{HAP@listdepth}
%    \end{macrocode}
% Optional arguments.
%    \begin{macrocode}
\define@key{HAP@keys@step}{sstart}{\def\HAP@Istart{#1}}
\define@key{HAP@keys@step}{stype}{\def\HAP@Itype{#1}}
\define@key{HAP@keys@step}{iacolor}{\def\HAP@Icolor{#1}}
%    \end{macrocode}
% \DescribeEnv{itemstep}\DescribeEnv{enumstep}
% These macros generate the animated lists. Taken from
% prosper and heavily modified to allow for multiple types
% of animated lists and nesting of |enumstep| and |itemstep|
% environments.
%    \begin{macrocode}
\def\itemstep{\@ifnextchar[{\HAP@stepenv{0}}{\HAP@stepenv{0}[]}}
\def\enumstep{\@ifnextchar[{\HAP@stepenv{1}}{\HAP@stepenv{1}[]}}
%    \end{macrocode}
% Closing the environments |itemstep| and |enumstep|.
%    \begin{macrocode}
\def\enditemstep{\endHAP@stepenv{0}}
\def\endenumstep{\endHAP@stepenv{1}}
%    \end{macrocode}
% \begin{environment}{HAP@stepenv}
% Workhorse for both |itemstep| and |enumstep|. The first
% argument identifies the type of list (0 for |itemstep|)
% and the second contains the optional arguments.
%    \begin{macrocode}
\def\HAP@stepenv#1[#2]{%
%    \end{macrocode}
% A following environment might be nested. Important for setting active
% state.
%    \begin{macrocode}
  \HAP@nestedtrue
%    \end{macrocode}
% Load the options into macros.
%    \begin{macrocode}
  \xsetkeys{HAP@keys@step}{#2}%
%    \end{macrocode}
% If |dvi2ps|, all items should be active since overlays create
% only one slide.
%    \begin{macrocode}
  \ifDVItoPS\def\HAP@Itype{0}\fi
%    \end{macrocode}
% Start the list.
%    \begin{macrocode}
  \ifnum#1=\z@
    \begin{itemize}%
  \else
    \begin{enumerate}%
  \fi
%    \end{macrocode}
% Possibility to let the animated list start at a later overlay.
% Only possible when the overall depth is zero, hence the current
% list is not nested.
%    \begin{macrocode}
  \ifnum\value{HAP@listdepth}=\z@
    \setcounter{item@step}{\HAP@Istart}%
    \addtocounter{item@step}{-1}%
  \fi
%    \end{macrocode}
% Increase list depth. We are one level deeper.
%    \begin{macrocode}
  \stepcounter{HAP@listdepth}%
%    \end{macrocode}
% \begin{macro}{\HAP@xitem}
% Workhorse for |\xitem|.
%    \begin{macrocode}
  \def\HAP@xitem<##1>{%
%    \end{macrocode}
% Next step in the list.
%    \begin{macrocode}
    \stepcounter{item@step}%
%    \end{macrocode}
% Set temp counter to |item@step + input value|.
%    \begin{macrocode}
    \setcounter{HAP@tca}{\value{item@step}}%
    \addtocounter{HAP@tca}{##1}%
    \HAP@activetrue
%    \end{macrocode}
% If the type is 0, all items remain active, display incrementally.
%    \begin{macrocode}
    \ifnum\HAP@Itype=\z@
      \HAP@textc
      \OnSlide{\value{item@step}-}%
    \else
%    \end{macrocode}
% Else, items can become inactive. If type is 1, display list incrementally.
%    \begin{macrocode}
      \ifnum\HAP@Itype=\@ne\OnSlide{\value{item@step}-}\fi
      \ifcase
%    \end{macrocode}
% If |item@step| $\leq$ |overlay number| $\leq$ |item@step + input value|,
% then item is active.
%    \begin{macrocode}
        \ifnum\value{overlaysCount}<\value{item@step}\@ne\fi
        \ifnum\value{overlaysCount}>\value{HAP@tca}\@ne\fi
        \z@
        \HAP@textc
      \else
        \csname\HAP@Icolor\endcsname
        \HAP@activefalse
      \fi
    \fi
%    \end{macrocode}
% Original |\item|. This allows for doing |\xitem[a]| or |\xitem<1>[b]|.
%    \begin{macrocode}
    \HAP@orig@item
  }%
%    \end{macrocode}
% \end{macro}
%    \begin{macrocode}
}
%    \end{macrocode}
% Workhorse for |\enditemstep| and |\endenumstep|
%    \begin{macrocode}
\def\endHAP@stepenv#1{%
  \ifnum#1=\z@
    \end{itemize}%
  \else
    \end{enumerate}%
  \fi
%    \end{macrocode}
% Decrease list depth.
%    \begin{macrocode}
  \addtocounter{HAP@listdepth}{-1}%
%    \end{macrocode}
% Reset the |item@step| counter for a next list.
%    \begin{macrocode}
  \ifnum\value{HAP@listdepth}=\z@
    \setcounter{item@step}{0}%
    \HAP@nestedfalse
  \fi
}
%    \end{macrocode}
% \end{environment}
% \subsubsection{Maketitle}
% \begin{macro}{\maketitle}
% We start with restoring two macros to the \LaTeX\ original.
%    \begin{macrocode}
\def\title#1{\gdef\@title{#1}}
\def\author#1{\gdef\@author{#1}}
%    \end{macrocode}
% This code originates from the \pf{prosper} but has been modified
% a lot.
%    \begin{macrocode}
\renewcommand{\maketitle}[1][]{%
%    \end{macrocode}
% \pf{prosper} comment: Tests whether the 'french' style from B. Gaulle is loaded.
%    \begin{macrocode}
  \expandafter\ifx\csname frenchTeXmods\endcsname\relax
  \else
%    \end{macrocode}
% \pf{prosper} comment: Is it an old version affected by the bug.
%    \begin{macrocode}
  \ifx\@soORI\@undefined
  \PackageWarning{prosper}{This page is intentionally left blank
    to overcome an incompatibility bug in the seminar class with
    the old (< 1999/11/23) B. Gaulle's 'french' package.}%
  \begin{center}%
    {\black\small
  \textsf{prosper} class: page intentionally left blank to overcome
    an incompatibility bug between B. Gaulle 'french' package and
    the seminar class.}%
  \end{center}%
  \clearpage \setcounter{page}{0}%
  \fi\fi
%    \end{macrocode}
% Allow for optional arguments in |\maketitle| command.
%    \begin{macrocode}
  \begin{slide}[#1]{HAP@notitle}%
    \ptsize{10}%
    \begin{center}%
    \@titleSpacing\par
    \normalfont
    {\ifinColor\@fontTitleColor\else\@fontTitleBW\fi\@title\par}%
    \ifx\@Subtitle\@empty\else
    {\ifinColor\@fontSubtitleColor\else\@fontSubtitleBW\fi\@Subtitle\par}%
    \fi
    \vskip2em
%    \end{macrocode}
% Put author in a tabular to allow for the use of the standard |\and| command.
%    \begin{macrocode}
    {\ifinColor\@fontAuthorColor\else\@fontAuthorBW\fi
      \begin{tabular}[t]{c}\@author\end{tabular}\par}%
    \vfill
    \end{center}%
  \end{slide}%
}
%    \end{macrocode}
% \end{macro}
% \subsubsection{Overlays}
% This section contains some overlays macros. We start with the
% |Overlays| environment used by the |\overlays| macro.
%    \begin{macrocode}
\newif\ifHAP@firstOverlay
\def\Overlays{%
  \HAP@firstOverlaytrue
  \global\let\slide\SlideOverlay
  \global\let\endslide\endSlideOverlay
  \setcounter{overlay@page}{\value{slide}}%
}
\def\endOverlays{%
  \HAP@firstOverlayfalse
  \global\let\slide\SlideNormal
  \global\let\endslide\endSlideNormal
  \setcounter{slide}{\value{overlay@page}}%
  \stepcounter{slide}%
}
%    \end{macrocode}
% This patch by Mathieu Goutelle, modified by Hendri Adriaens,
% solves the problem of numbering on overlays. Custom counters
% can be requested to be protected using |\HAPsetup|.
% \begin{macro}{\overlays}\label{macro:overlays}
% This code has been taken from \pf{prosper} and has been modified.
%    \begin{macrocode}
\long\def\overlays#1#2{%
  \bgroup
  \aftergroup\HAP@cleanupOverlay
  \InOverlaystrue
  \setcounter{limitOverlays}{#1}%
  \setcounter{overlaysCount}{1}%
  \ifDVItoPS
    #2
  \else
    \begin{Overlays}%
    \bgroup
    \loop
      \@everyOverlay
%    \end{macrocode}
% Save current counter values.
%    \begin{macrocode}
      \HAP@scounters
      #2
      \ifnum\value{overlaysCount}<\value{limitOverlays}{%
      \stepcounter{overlaysCount}%
%    \end{macrocode}
% Return the counters to the original setting on every
% overlay to be able to number items correctly.
%    \begin{macrocode}
      \HAP@rcounters
    }%
    \repeat
    \egroup
    \end{Overlays}%
  \fi
  \egroup
}
%    \end{macrocode}
% \end{macro}
% \DescribeMacro{\HAP@cleanupOverlay}
% To be performed after using |\overlays|. Reset the counters to allow
% for reusing the value of the counters, for instance in style files.
%    \begin{macrocode}
\def\HAP@cleanupOverlay{%
  \InOverlaysfalse
  \setcounter{limitOverlays}{0}%
  \setcounter{overlaysCount}{0}%
}
%    \end{macrocode}
% Let the |\saveCtr| do nothing since this package offers a different
% mechanism to protect counters on overlays.
%    \begin{macrocode}
\let\saveCtr\relax
%    \end{macrocode}
% The following key saves the input to |\HAP@counterslist|, adds the
% counters |figure|, |table| and |equation| to the list and creates
% backup counters.
%    \begin{macrocode}
\define@key{HAP@keys@globalonly}{counters}{%
  \def\HAP@counterslist{#1}%
  \ifx\HAP@counterslist\@empty
    \g@addto@macro\HAP@counterslist{figure,equation,table}%
  \else
    \g@addto@macro\HAP@counterslist{,figure,equation,table}%
  \fi
%    \end{macrocode}
% Create backup counters.
%    \begin{macrocode}
  \@for\HAP@tempa:=\HAP@counterslist\do{%
    \@ifundefined{c@\HAP@tempa}{\@nocounterr{\HAP@tempa}}%
      {\@ifundefined{c@HAP@oldc@\HAP@tempa}{\newcounter{HAP@oldc@\HAP@tempa}}{}}%
  }%
}
%    \end{macrocode}
% \DescribeMacro{\HAP@scounters}
% Saves current counter values to the backup counters.
%    \begin{macrocode}
\def\HAP@scounters{%
  \@for\HAP@tempa:=\HAP@counterslist\do{%
    \setcounter{HAP@oldc@\HAP@tempa}{\value{\HAP@tempa}}%
  }%
}
%    \end{macrocode}
% \DescribeMacro{\HAP@rcounters}
% Resets the actual counters using the backup counters.
%    \begin{macrocode}
\def\HAP@rcounters{%
  \@for\HAP@tempa:=\HAP@counterslist\do{%
    \setcounter{\HAP@tempa}{\value{HAP@oldc@\HAP@tempa}}%
  }%
}
%    \end{macrocode}
% \subsubsection{Font definitions}
% This section contains some font definitions in the light of \pf{prosper}
% The |\Font...| macros define fonts to be used for certain text elements
% and the |\font...| versions allow to apply the predefined font to
% the text.\par
% \DescribeMacro{\FontLeftFoot}\DescribeMacro{\fontLeftFoot}
% Definitions for the left footer.
%    \begin{macrocode}
\def\@fontLFColor{\@fontTextColor\fontsize{5pt}{5pt}\selectfont}
\def\@fontLFBW{\@fontTextBW\fontsize{5pt}{5pt}\selectfont}
\newcommand{\FontLeftFoot}[2]{%
  \gdef\@fontLFColor{#1}%
  \gdef\@fontLFBW{#2}}
\newcommand{\fontLeftFoot}[1]{{\ifinColor\@fontLFColor\else\@fontLFBW\fi#1}}
%    \end{macrocode}
% \DescribeMacro{\FontRightFoot}\DescribeMacro{\fontRightFoot}
% Definitions for the right footer.
%    \begin{macrocode}
\def\@fontRFColor{\@fontTextColor\fontsize{5pt}{5pt}\selectfont}
\def\@fontRFBW{\@fontTextBW\fontsize{5pt}{5pt}\selectfont}
\newcommand{\FontRightFoot}[2]{%
  \gdef\@fontRFColor{#1}%
  \gdef\@fontRFBW{#2}}
\newcommand{\fontRightFoot}[1]{{\ifinColor\@fontRFColor\else\@fontRFBW\fi#1}}
%    \end{macrocode}
% \DescribeMacro{\FontAuthor}\DescribeMacro{\fontAuthor}
% Definitions for author.
%    \begin{macrocode}
\def\@fontAuthorColor{\@fontTextColor}
\def\@fontAuthorBW{\@fontTextBW}
\newcommand{\FontAuthor}[2]{%
  \gdef\@fontAuthorColor{#1}%
  \gdef\@fontAuthorBW{#2}}
\newcommand{\fontAuthor}[1]{{\ifinColor\@fontAuthorColor\else\@fontAuthorBW\fi#1}}
%    \end{macrocode}
% \DescribeMacro{\FontInst}\DescribeMacro{\fontInst}
% Definitions for institution.
%    \begin{macrocode}
\def\@fontInstColor{\@fontTextColor\fontsize{7pt}{7pt}\selectfont}
\def\@fontInstBW{\@fontTextBW\fontsize{7pt}{7pt}\selectfont}
\newcommand{\FontInst}[2]{%
  \gdef\@fontInstColor{#1}%
  \gdef\@fontInstBW{#2}}
\newcommand{\fontInst}[1]{{\ifinColor\@fontInstColor\else\@fontInstBW\fi#1}}
%    \end{macrocode}
% \DescribeMacro{\institution}
% The |\institution| macro does not put text anymore directly onto
% the title slide. Instead, it applies the font settings and can be
% used inside the |\author| macro.
%    \begin{macrocode}
\let\institution\fontInst
%    \end{macrocode}
% \DescribeMacro{\FontEmail}\DescribeMacro{\fontEmail}
% Definitions for e-mail.
%    \begin{macrocode}
\def\@fontEmailColor{\@fontTextColor\fontsize{7pt}{7pt}\selectfont}
\def\@fontEmailBW{\@fontTextBW\fontsize{7pt}{7pt}\selectfont}
\newcommand{\FontEmail}[2]{%
  \gdef\@fontEmailColor{#1}%
  \gdef\@fontEmailBW{#2}}
\newcommand{\fontEmail}[1]{{\ifinColor\@fontEmailColor\else\@fontEmailBW\fi#1}}
%    \end{macrocode}
% \DescribeMacro{\email}
% The |\email| macro does not put text anymore directly onto
% the title slide. Instead, it applies the font settings and can be
% used inside the |\author| macro.
%    \begin{macrocode}
\let\email\fontEmail
%    \end{macrocode}
% \DescribeMacro{\FontToc}\DescribeMacro{\fontToc}
% Definitions for the table of contents.
%    \begin{macrocode}
\def\@fontTocColor{\@fontTextColor\fontsize{4pt}{6pt}\selectfont}
\def\@fontTocBW{\@fontTextBW\fontsize{4pt}{6pt}\selectfont}
\newcommand{\FontToc}[2]{%
  \gdef\@fontTocColor{#1}%
  \gdef\@fontTocBW{#2}}
\newcommand{\fontToc}[1]{{\ifinColor\@fontTocColor\else\@fontTocBW\fi#1}}
%    \end{macrocode}
% \subsubsection{Footers}
% We don't use the seminar page style. It provides not enough flexibility
% for placement of footers.
%    \begin{macrocode}
\renewpagestyle{GenericPageStyle}{}{}
%    \end{macrocode}
% \DescribeMacro{\HAP@leftfoot}\DescribeMacro{\HAP@rightfoot}
% These macros store the footer texts.
%    \begin{macrocode}
\define@key{HAP@keys@globalonly}{lf}{\def\HAP@leftfoot{#1}}
\define@key{HAP@keys@globalonly}{rf}{\def\HAP@rightfoot{#1}}
%    \end{macrocode}
% \DescribeMacro{\LeftFoot}\DescribeMacro{\RightFoot}
% Backward compatibility for earlier version of \pf{HA-prosper} which
% where not using the |\HAPsetup| user interface yet.
%    \begin{macrocode}
\def\LeftFoot#1{\def\HAP@leftfoot{#1}}
\def\RightFoot#1{\def\HAP@rightfoot{#1}}
%    \end{macrocode}
% \DescribeMacro{\HAP@sn}
% Slide number.
%    \begin{macrocode}
\define@key{HAP@keys@globalonly}{sn}{\def\HAP@sn{#1}}
%    \end{macrocode}
% \DescribeMacro{\HAP@PutLF}
% This can be used to in a template to position the left footer. It
% uses |\rput| and puts the footer in the left footer font.
%    \begin{macrocode}
\newcommand{\HAP@PutLF}[2]{%
  \rput[#1](#2){\parbox[t]{\slidewidth}{\fontLeftFoot{\HAP@leftfoot}}}%
}
%    \end{macrocode}
% \DescribeMacro{\HAP@PutRF}
% Puts the right footer on slides.
%    \begin{macrocode}
\newcommand{\HAP@PutRF}[2]{%
  \ifx\HAP@sn\@empty
    \rput[#1](#2){%
      \parbox[t]{\slidewidth}{\hfill\fontRightFoot{\HAP@rightfoot}}}%
  \else
    \rput[#1](#2){%
      \parbox[t]{\slidewidth}{\hfill\fontRightFoot{\HAP@rightfoot~\HAP@sn}}}%
  \fi
}
%    \end{macrocode}
% \subsubsection{Dualslides}
% This section contains the code to create dualslides.
% We start with a lot of lengths which can be set by the user.
%    \begin{macrocode}
\newlength{\HAP@lcolwidth}
\newlength{\HAP@rcolwidth}
\newlength{\HAP@frsep}
\newlength{\HAP@colsep}
\newlength{\HAP@topsep}
\newlength{\HAP@bottomsep}
\newlength{\HAP@indent}
%    \end{macrocode}
% Optional arguments. Refer to the manual for a full
% description of the options.
%    \begin{macrocode}
\define@key{HAP@keys@dual}{lineheight}{\def\HAP@lineheight{#1}}
\define@key{HAP@keys@dual}{lfrheight}{\def\HAP@lfrheight{#1}}
\define@key{HAP@keys@dual}{rfrheight}{\def\HAP@rfrheight{#1}}
\define@key{HAP@keys@dual}{frsep}{\setlength{\HAP@frsep}{#1}}
\define@key{HAP@keys@dual}{colsep}{\setlength{\HAP@colsep}{#1}}
\define@key{HAP@keys@dual}{lcolwidth}{\setlength{\HAP@lcolwidth}{#1}}
\define@key{HAP@keys@dual}{rcolwidth}{\setlength{\HAP@rcolwidth}{#1}}
\define@key{HAP@keys@dual}{topsep}{\setlength{\HAP@topsep}{#1}}
\define@key{HAP@keys@dual}{bottomsep}{\setlength{\HAP@bottomsep}{#1}}
\define@key{HAP@keys@dual}{indent}{\setlength{\HAP@indent}{#1}}
%    \end{macrocode}
% \DescribeMacro{\HAP@maxdim}
% Macro that returns the maximum of two dimensions.
%    \begin{macrocode}
\def\HAP@maxdim#1#2{\ifdim#1>#2#1\else#2\fi}
%    \end{macrocode}
% \DescribeMacro{\dualslide}\DescribeMacro{\HAP@dualslide}\DescribeMacro{\HAP@@dualslide}
% The |\dualslide| macro is called with
% \HAPcmd{\ci{dualslide}\oarg{opt1}\oarg{opt2}\oarg{opt3}\marg{options}\marg{left}\marg{right}}
% If only |opt1| specified, then |opt2|=|opt1| and |opt3|=|opt1|. If
% |opt1| and |opt2| specified, |opt3|=|opt1|. The macros |\HAP@dualslide|
% and |\HAP@@dualslide| are used to achieve this behavior.
% See for more info on the arguments the manual.
%    \begin{macrocode}
\def\dualslide{\@ifnextchar[\HAP@dualslide{\HAP@@@dualslide[][][]}}
\def\HAP@dualslide[#1]{%
  \@ifnextchar[{\HAP@@dualslide[#1]}%
  {\HAP@@@dualslide[#1][#1][#1]}%
}
\def\HAP@@dualslide[#1][#2]{%
  \@ifnextchar[{\HAP@@@dualslide[#1][#2]}%
  {\HAP@@@dualslide[#1][#2][#1]}%
}
%    \end{macrocode}
% \begin{macro}{\HAP@@@dualslide}
% Workhorse for |\dualslide|. This macro creates the dualslide construct.
%    \begin{macrocode}
\long\def\HAP@@@dualslide[#1][#2][#3]#4#5#6{%
%    \end{macrocode}
% Set default dimensions.
%    \begin{macrocode}
  \setlength{\HAP@frsep}{1.5mm}%
  \setlength{\HAP@colsep}{.06\linewidth}%
  \setlength{\HAP@lcolwidth}{.47\linewidth}%
  \setlength{\HAP@rcolwidth}{.47\linewidth}%
  \setlength{\HAP@topsep}{0cm}%
  \setlength{\HAP@bottomsep}{0cm}%
  \setlength{\HAP@indent}{0cm}%
%    \end{macrocode}
% Load options.
%    \begin{macrocode}
  \xsetkeys{HAP@keys@dual}{#4}%
%    \end{macrocode}
% The next section computes the height of the dualslide construct.
% We start with left content height.
%    \begin{macrocode}
  \sbox\HAP@tba{\begin{minipage}{\HAP@lcolwidth}#5\end{minipage}}%
  \setlength{\HAP@tlc}{\the\ht\HAP@tba}%
  \addtolength{\HAP@tlc}{\the\dp\HAP@tba}%
%    \end{macrocode}
% Right content height.
%    \begin{macrocode}
  \sbox\HAP@tbb{\begin{minipage}{\HAP@rcolwidth}#6\end{minipage}}%
  \setlength{\HAP@tld}{\the\ht\HAP@tbb}%
  \addtolength{\HAP@tld}{\the\dp\HAP@tbb}%
%    \end{macrocode}
% Take the maximum of left and right content.
%    \begin{macrocode}
  \setlength{\HAP@tlc}{\HAP@maxdim{\HAP@tlc}{\HAP@tld}}%
%    \end{macrocode}
% If a left frame is requested, compute max height again.
%    \begin{macrocode}
  \ifx\HAP@lfrheight\@undefined\else
    \setlength{\HAP@tlc}{\HAP@maxdim{\HAP@lfrheight}{\HAP@tlc}}%
  \fi
%    \end{macrocode}
% If a line is requested, compute max height again.
%    \begin{macrocode}
  \ifx\HAP@lineheight\@undefined\else
    \setlength{\HAP@tlc}{\HAP@maxdim{\HAP@lineheight}{\HAP@tlc}}%
  \fi
%    \end{macrocode}
% Finally, evaluate the height of the right frame and compute the max again.
%    \begin{macrocode}
  \ifx\HAP@rfrheight\@undefined\else
    \setlength{\HAP@tlc}{\HAP@maxdim{\HAP@rfrheight}{\HAP@tlc}}%
  \fi
%    \end{macrocode}
% Now we know the height of the construct, create vertical space
% with a |pspicture| on which we position the elements. In between
% creating elements, we compute a bit with lengths to calculate the
% positions of the elements depending on all the inputs. The code
% below contains references to points. These points can be found in
% the picture below, which shows the top part of the dualslide
% construct to be created by |\HAP@@@dualslide|.\par
%\setlength{\unitlength}{.7cm}
%\begin{picture}(14,2)(0,.5)
%\put(0,.5){\line(0,1){2}}
%\put(0,2.5){\line(1,0){6}}
%\put(6,2.5){\line(0,-1){2}}
%\put(7,.5){\line(0,1){2}}
%\put(8,.5){\line(0,1){2}}
%\put(8,2.5){\line(1,0){6}}
%\put(14,2.5){\line(0,-1){2}}
%\dashline{2}(.75,.5)(.75,1.125)(.75,1.75)
%\dashline{2}(.75,1.75)(1.25,1.75)(1.75,1.75)%
%(2.25,1.75)(2.75,1.75)(3.25,1.75)(3.75,1.75)%
%(4.25,1.75)(4.75,1.75)(5.25,1.75)
%\dashline{2}(5.25,.5)(5.25,1.125)(5.25,1.75)
%\dashline{2}(8.75,.5)(8.75,1.125)(8.75,1.75)
%\dashline{2}(8.75,1.75)(9.25,1.75)(9.75,1.75)%
%(10.25,1.75)(10.75,1.75)(11.25,1.75)(11.75,1.75)%
%(12.25,1.75)(12.75,1.75)(13.25,1.75)
%\dashline{2}(13.25,.5)(13.25,1.125)(13.25,1.75)
%\put(.75,1){\circle*{.15}}
%\put(.35,1){|1|}
%\put(5.25,1){\circle*{.15}}
%\put(4.85,1){|2|}
%\put(6,1){\circle*{.15}}
%\put(5.6,1){|3|}
%\put(7,1){\circle*{.15}}
%\put(6.6,1){|4|}
%\put(8.75,1){\circle*{.15}}
%\put(8.35,1){|5|}
%\put(8,1){\circle*{.15}}
%\put(7.6,1){|6|}
%\put(14,1){\circle*{.15}}
%\put(13.6,1){|7|}
%\end{picture}
% \par
% The starting point is |1|.
%    \begin{macrocode}
  \pspicture(-\HAP@indent,\HAP@topsep)(\linewidth,-\HAP@tlc)%
%    \end{macrocode}
% Set defaults for linewidth and color.
%    \begin{macrocode}
  \psset{unit=1pt,linewidth=.25pt,linecolor=HAP@framecolor}%
%    \end{macrocode}
% The next line brings us to point |2|.
%    \begin{macrocode}
  \setlength{\HAP@tla}{\HAP@lcolwidth}%
%    \end{macrocode}
% And the next to point |3|.
%    \begin{macrocode}
  \addtolength{\HAP@tla}{\HAP@frsep}%
%    \end{macrocode}
% Create the left frame.
%    \begin{macrocode}
  \ifx\HAP@lfrheight\@undefined\else
    \psframe[#1](-\HAP@frsep,\HAP@frsep)(\HAP@tla,-\HAP@lfrheight)%
  \fi
%    \end{macrocode}
% Put the left content.
%    \begin{macrocode}
  \rput[tl](0,0){\usebox{\HAP@tba}}%
%    \end{macrocode}
% We are back at |2| with the next line.
%    \begin{macrocode}
  \setlength{\HAP@tla}{\HAP@lcolwidth}%
%    \end{macrocode}
% This line moves us on to point |4|.
%    \begin{macrocode}
  \addtolength{\HAP@tla}{.5\HAP@colsep}%
%    \end{macrocode}
% Create the line.
%    \begin{macrocode}
  \ifx\HAP@lineheight\@undefined\else
    \psline[#2](\HAP@tla,\HAP@frsep)(\HAP@tla,-\HAP@lineheight)%
  \fi
%    \end{macrocode}
% And we go further to point |5|.
%    \begin{macrocode}
  \addtolength{\HAP@tla}{.5\HAP@colsep}%
  \setlength{\HAP@tlc}{\HAP@tla}%
%    \end{macrocode}
% With the next line, we are at point |6|.
%    \begin{macrocode}
  \addtolength{\HAP@tla}{-\HAP@frsep}%
  \setlength{\HAP@tlb}{\HAP@tla}%
%    \end{macrocode}
% And the next two lines give us point |7|.
%    \begin{macrocode}
  \addtolength{\HAP@tlb}{\HAP@rcolwidth}%
  \addtolength{\HAP@tlb}{2\HAP@frsep}%
%    \end{macrocode}
% Create the right frame.
%    \begin{macrocode}
  \ifx\HAP@rfrheight\@undefined\else
    \psframe[#3](\HAP@tla,\HAP@frsep)(\HAP@tlb,-\HAP@rfrheight)%
  \fi
%    \end{macrocode}
% Put the right content.
%    \begin{macrocode}
  \rput[tl](\HAP@tlc,0){\usebox{\HAP@tbb}}%
  \endpspicture\par
}
%    \end{macrocode}
% \end{macro}
% \subsubsection{onSlide and OnSlide}
% The macros in this section form a generelization of the following
% macros of \pf{prosper}: |\fromSlide|, |\FromSlide|, |\untilSlide|,
% |\UntilSlide|, |\onlySlide| and |\OnlySlide|. The macros are more
% or less based on these \pf{prosper} macros, but are more general
% and replace all those macros. We start with some counters
% and an if necessary to determine whether material should be
% displayed on the current overlay or not.
%    \begin{macrocode}
\newcounter{HAP@onslide@count}
\newcounter{HAP@onslide@end}
\newif\ifHAP@displayMat
\let\HAP@onslide@list\@empty
%    \end{macrocode}
% \begin{macro}{\onSlide}
% \HAPcmd{\ci{onSlide}\marg{overlays}\marg{mat}}
% This macro allows for
% comma seperated inputs like |\onSlide{-2,4,6-8,10-}|. |\onSlide|
% has a starred version which doesn't move the cursor in case the
% material is not displayed on the slide.
%    \begin{macrocode}
\def\onSlide{\@ifstar{\HAP@onSlide{1}}{\HAP@onSlide{0}}}
\long\def\HAP@onSlide#1#2{%
%    \end{macrocode}
% Split the comma seperated list into parts to be read by |\HAP@read|.
% The macro will set |\ifHAP@displayMat| which tells us to display
% the material on the current slide or not.
%    \begin{macrocode}
  \HAP@split#2,\relax,%
  \let\HAP@next\@gobble
  \ifDVItoPS
    \ifAccumulate
%    \end{macrocode}
% Just display the material in case of printing slides.
%    \begin{macrocode}
      \let\HAP@next\@iden%
    \fi
  \else
    \ifHAP@displayMat
%    \end{macrocode}
% We should display it.
%    \begin{macrocode}
      \let\HAP@next\@iden%
%    \end{macrocode}
% Reset |\ifHAP@displayMat| for future use.
%    \begin{macrocode}
      \HAP@displayMatfalse
    \else
%    \end{macrocode}
% If no star, move the cursor using \pf{prosper}'s |PSTricks| construct.
%    \begin{macrocode}
      \ifnum#1=\z@
        \let\HAP@next\@on@overlay@one%
      \fi
    \fi
  \fi
%    \end{macrocode}
% Put the material on the slide. This can be |\@gobble|.
%    \begin{macrocode}
  \HAP@next
}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\OnSlide}
% \HAPcmd{\ci{OnSlide}\marg{overlays}}
% This macro also allows for comma seperated lists, but takes only
% one argument and masks or not all the following material.
%    \begin{macrocode}
\def\OnSlide#1{%
%    \end{macrocode}
% Split the comma seperated list into parts to be read by |\HAP@read|.
%    \begin{macrocode}
  \HAP@split#1,\relax,%
  \ifDVItoPS\else
%    \end{macrocode}
% We should display the following material; don't hide it.
%    \begin{macrocode}
    \ifHAP@displayMat
%    \end{macrocode}
% Reset |\ifHAP@displayMat|.
%    \begin{macrocode}
      \HAP@displayMatfalse
    \else
%    \end{macrocode}
% Hide it using \pf{prosper}'s |\overlay|.
%    \begin{macrocode}
      \overlay{1}%
    \fi
  \fi
}
%    \end{macrocode}
% \end{macro}
% \DescribeMacro{\HAP@split}
% Splits the comma seperated list into parts and reads them one by one.
% This is based on \pf{keyval}'s |\KV@do|.
%    \begin{macrocode}
\def\HAP@split#1,{%
  \ifx\relax#1\@empty\else
    \HAP@read#1--\relax
    \expandafter\HAP@split
  \fi
}
%    \end{macrocode}
% \begin{macro}{\HAP@read}
% This macro reads the argument between two commas supplied by |\HAP@split|.
% We distinct 4 cases: $x$, -$x$, $x$- and $x$-$y$ where $x$ and $y$ are positive
% integers with $y\geq x$. We will not check the argument for specification;
% the responsibility is with the user. The macro first sets a range from
% the inputs, then runs over this range to check wether the current
% overlay is inside the range and hence material should be displayed.
%    \begin{macrocode}
\def\HAP@read#1-#2-#3\relax{%
  \def\HAP@tempa{#1}%
  \def\HAP@tempb{#2}%
  \def\HAP@tempc{#3}%
  \ifx\HAP@tempa\@empty
%    \end{macrocode}
% If |#1| empty, we have -$x$. Set the counter to the starting overlay.
%    \begin{macrocode}
    \setcounter{HAP@onslide@count}{1}%
  \else
%    \end{macrocode}
% Else, we have something that starts with $x$ or $+x$, but we don't know the
% exact specification yet. Check whether the input starts with a |+|.
%    \begin{macrocode}
    \HAP@sp\HAP@tempd{#1}%
    \ifHAP@plus
%    \end{macrocode}
% If a plus sign, make displaying relative to the current |\xitem|.
%    \begin{macrocode}
      \setcounter{HAP@onslide@count}{\value{item@step}}%
      \addtocounter{HAP@onslide@count}{\HAP@tempd}%
    \else
      \setcounter{HAP@onslide@count}{#1}%
    \fi
  \fi
  \ifx\HAP@tempb\@empty
    \ifx\HAP@tempc\@empty
%    \end{macrocode}
% If both |#2| and |#3| empty, we have the case $x$ or $+x$.
%    \begin{macrocode}
      \HAP@sp\HAP@tempd{#1}%
      \ifHAP@plus
%    \end{macrocode}
% If a plus sign, make displaying relative to the current |\xitem|.
%    \begin{macrocode}
        \setcounter{HAP@onslide@end}{\value{item@step}}%
        \addtocounter{HAP@onslide@end}{\HAP@tempd}%
      \else
       \setcounter{HAP@onslide@end}{#1}%
      \fi
    \else
%    \end{macrocode}
% If |#2| empty, but |#3| not (has value |-|), we have the case $x$- or $+x$-.
%    \begin{macrocode}
      \setcounter{HAP@onslide@end}{\value{limitOverlays}}%
    \fi
  \else
%    \end{macrocode}
% If both |#2| and |#3| non-empty, we have the case $x$-$y$ or a
% variation with |+| signs.
%    \begin{macrocode}
    \HAP@sp\HAP@tempd{#2}%
    \ifHAP@plus
%    \end{macrocode}
% If a plus sign, make displaying relative to the current |\xitem|.
%    \begin{macrocode}
      \setcounter{HAP@onslide@end}{\value{item@step}}%
      \addtocounter{HAP@onslide@end}{\HAP@tempd}%
    \else
      \setcounter{HAP@onslide@end}{#2}%
    \fi
  \fi
%    \end{macrocode}
% Check on input.
%    \begin{macrocode}
  \ifnum\value{HAP@onslide@count}>\value{HAP@onslide@end}%
    \@expandtwoargs\in@{,\theslide,}{,\HAP@onslide@list,}%
    \ifin@\else
      \PackageError{HA-prosper}{Invalid onSlide or OnSlide range or missing overlays
        on slide \theslide}{You can go ahead, but material will be missing.}%
%    \end{macrocode}
% Add current slide number to a list to avoid multiple errors per slide.
%    \begin{macrocode}
      \xdef\HAP@onslide@list{%
        \HAP@onslide@list
        \ifx\HAP@onslide@list\@empty\else,\fi
        \theslide
      }%
    \fi
  \else
%    \end{macrocode}
% If the current overlay number is in the range, material should be
% displayed.
%    \begin{macrocode}
    \ifnum\value{HAP@onslide@count}>\value{overlaysCount}\else
      \ifnum\value{HAP@onslide@end}<\value{overlaysCount}\else
      \HAP@displayMattrue
    \fi\fi
  \fi
}
%    \end{macrocode}
% \end{macro}
% Code to strip the |+| sign from the start of a list of tokens.
% This is necessary since the input to |\HAP@read| can also
% contain |\value{item@step}|. The code is based on the \pf{keyval}
% macro |\KV@@sp@def|.
%    \begin{macrocode}
\def\:{\let\@pltoken=+}\:%
\newtoks\HAP@toks@
\newif\ifHAP@plus
\def\HAP@sp#1#2{%
  \futurelet\HAP@tempa\HAP@@sp#2\@nil\@nil+\@nil\relax#1}%
\def\HAP@@sp{%
  \ifx\HAP@tempa\@pltoken
    \HAP@plustrue
    \expandafter\HAP@@@sp
  \else
    \HAP@plusfalse
    \expandafter\HAP@@@sp\expandafter+%
  \fi
}%
\def\HAP@@@sp+#1\@nil{\HAP@@@@sp#1}%
\def\HAP@@@@sp#1\@nil#2\relax#3{\HAP@toks@{#1}\edef#3{\the\HAP@toks@}}
%    \end{macrocode}
% \subsubsection{Miscellaneous}
% \DescribeMacro{\xitemwait}
% Tells \pf{HA-prosper} to wait some overlays before continuing
% incrementally displayed items.
%    \begin{macrocode}
\newcommand{\xitemwait}[1][1]{\addtocounter{item@step}{#1}}
%    \end{macrocode}
% \DescribeMacro{\HAP@TSNav}
% Entrance point for navigational elements on the title slide. This
% macro takes the value specified by the |tsnav| global key and can
% be used to put navigational components on slides through a style file.
%    \begin{macrocode}
\define@key{HAP@keys@globalonly}{tsnav}{\gdef\HAP@TSNav{#1}}
%    \end{macrocode}
% \DescribeMacro{\TitleSlideNav}
% Backward compatibility for earlier version of \pf{HA-prosper} which
% where not using the |\HAPsetup| user interface yet.
%    \begin{macrocode}
\def\TitleSlideNav#1{\gdef\HAP@TSNav{#1}}
%    \end{macrocode}
% \DescribeMacro{\HAP@NSNav}
% Entrance point for navigational elements on normal slides.
%    \begin{macrocode}
\define@key{HAP@keys@globalonly}{nsnav}{\gdef\HAP@NSNav{#1}}
%    \end{macrocode}
% \DescribeMacro{\NormalSlideNav}
% Backward compatibility for older presentations.
%    \begin{macrocode}
\def\NormalSlideNav#1{\gdef\HAP@NSNav{#1}}
%    \end{macrocode}
% Simple interface for the total number of slides in the presentation.
%    \begin{macrocode}
\def\totalpages{\realpageref{last@page}}
%    \end{macrocode}
% \subsection{Postamble and defaults}
% This section of code contains the finalizing elements like loading
% the requested style, setting defaults and creating extra slide environments.
% \subsubsection{Defaults (1)}
% \DescribeMacro{\HAPsetup}
% Allows for setting some options globally.
%    \begin{macrocode}
\def\HAPsetup#1{%
  \xsetkeys{HAP@keys@globalonly,HAP@keys@slide,HAP@keys@step}{#1}%
}
%    \end{macrocode}
% Set global defaults to prevent errors when the user decides to delete
% a line from the |HA-prosper.cfg| file.
%    \begin{macrocode}
\HAPsetup{lf=,rf=,trans=\@defaultTransition,template=slide,sstart=1,
  stype=0,iacolor=lightgray,tsnav=FullScreen,nsnav=ShowBookmarks,
  sn={-~p.~\thepage\ifallPages/\totalpages\fi},counters=
}
%    \end{macrocode}
% Load defaults for global options. Refer to section~\ref{sec:config} for
% the |HA-prosper.cfg| file.
%    \begin{macrocode}
\input{HA-prosper.cfg}
%    \end{macrocode}
% PDF page cropping default.
%    \begin{macrocode}
\hypersetup{pdfpagescrop={0 0 595 840}}
%    \end{macrocode}
% PDF creator.
%    \begin{macrocode}
\AtBeginDocument{\def\@pdfcreator{LaTeX with hyperref and
  HA-prosper packages}}
%    \end{macrocode}
% Calibration of commands like |\small| to default font sizes.
%    \begin{macrocode}
\ptsize{10}
%    \end{macrocode}
% \subsubsection{Load the style}
% First undefine |\slidetitle| since it is already defined by \pf{prosper}.
%    \begin{macrocode}
\let\slidetitle\@undefined
%    \end{macrocode}
% Load the requested style.
%    \begin{macrocode}
\IfFileExists{HAP\HAP@Style@chosen.sty}{%
  \RequirePackage{HAP\HAP@Style@chosen}%
}{\PackageError{HA-prosper}{unknown HA-prosper style file: HAP\HAP@Style@chosen.sty}%
  {Sorry, no additional help}}
%    \end{macrocode}
% \subsubsection{Extra slide definitions}
% \DescribeMacro{\HAPR@normalslide}
% Check that the normal slide template has been defined by the template.
%    \begin{macrocode}
\ifx\HAPR@normalSlide\@undefined
  \PackageError{HA-prosper}{HA-prosper normal slide is
    not defined in your template}%
  {Check that your template HAP\HAP@Style@chosen.sty supports
    normal slides and that it is up to date}%
\else
  \HAPR@normalSlide
%    \end{macrocode}
% \DescribeMacro{\HAPR@wideslide}
% If |\HAPR@wideslide| defined, use it to create the |wideslide| environment.
%    \begin{macrocode}
  \ifx\HAPR@wideSlide\@undefined
  \else
    \def\wideslide{\@ifnextchar[\HAP@wideslide{\HAP@wideslide[]}}%
    \def\HAP@wideslide[#1]#2{%
      \HAPR@wideSlide
      \begin{slide}[#1]{#2}%
    }%
    \def\endwideslide{\end{slide}\HAPR@normalSlide}%
  \fi
%    \end{macrocode}
% \DescribeMacro{\HAPR@partslide}
% If |\HAPR@partslide| defined, use it to create the |partslide| environment.
%    \begin{macrocode}
  \ifx\HAPR@partSlide\@undefined
  \else
    \def\partslide{\@ifnextchar[\HAP@partslide{\HAP@partslide[]}}%
    \def\HAP@partslide[#1]#2{%
      \HAPR@partSlide
      \begin{slide}[#1]{#2}%
    }%
    \def\endpartslide{\end{slide}\HAPR@normalSlide}%
  \fi
\fi
%    \end{macrocode}
% \DescribeMacro{\maketitle}
% If both |\HAPR@normalslide| and |\HAPR@titleslide| defined, use these
% to redefine the |\maketitle| macro which switches back to the normal
% template automatically after creating the title slide on the title template.
%    \begin{macrocode}
\ifcase
  \ifx\HAPR@normalSlide\@undefined\@ne\fi
  \ifx\HAPR@titleSlide\@undefined\@ne\fi
  \z@
  \let\HAP@orig@maketitle=\maketitle
  \def\maketitle{\@ifnextchar[\HAP@maketitle{\HAP@maketitle[]}}%
  \newcommand{\HAP@maketitle}[1][]{%
    \HAPR@titleSlide\HAP@orig@maketitle[#1]\HAPR@normalSlide
  }%
\fi
%    \end{macrocode}
% \subsubsection{Defaults (2)}
% Here we check wether certain vital macros have been defined
% by the template and if not, define them. See the section containing
% developers information in the manual for more information
% about a specific macro listed below.
%    \begin{macrocode}
\ifx\HAP@tline\@undefined\def\HAP@tline#1{#1}\fi
\ifx\HAP@tlineonly\@undefined\def\HAP@tlineonly#1{#1}\fi
\ifx\HAP@tsection\@undefined\def\HAP@tsection#1{#1}\fi
\ifx\HAP@tsectiononly\@undefined\def\HAP@tsectiononly#1{#1}\fi
\ifx\HAP@tsectionskip\@undefined\def\HAP@tsectionskip{1.5em}\fi
\ifx\HAP@titemskip\@undefined\def\HAP@titemskip{.1em}\fi
\ifx\HAP@tsectionm\@undefined\let\HAP@tsectionm\@empty\fi
\ifx\HAP@twidth\@undefined\def\HAP@twidth{2cm}\fi
\ifx\HAP@tborder\@undefined\def\HAP@tborder{.05cm}\fi
\ifx\HAP@textc\@undefined\newrgbcolor{HAP@textc}{0 0 0}\fi
\ifx\HAP@framecolor\@undefined\newrgbcolor{HAP@framecolor}{0 0 0}\fi
\ifx\HAP@hcolor\@undefined\newrgbcolor{HAP@hcolor}{0 0 0}\fi
\ifx\HAP@htcolor\@undefined\newrgbcolor{HAP@htcolor}{1 1 1}\fi
\ifx\HAP@tocentry\@undefined
  \def\HAP@tocentry{%
%    \end{macrocode}
% By default, put text in a |\parbox| for multi-line toc entries.
%    \begin{macrocode}
    \parbox[b]{\HAP@twidth}{\raggedright\HAP@toctext}%
  }%
\fi
\ifx\HAP@hltocentry\@undefined
  \def\HAP@hltocentry{%
%    \end{macrocode}
% By default, put text in |\parbox| and in |\psframebox| to create the frame.
%    \begin{macrocode}
    \psframebox*[framesep=\HAP@tborder,fillcolor=HAP@hcolor,boxsep=false]%
      {\parbox[b]{\HAP@twidth}{\raggedright{\HAP@htcolor\HAP@toctext}}}%
  }%
\fi
%    \end{macrocode}
% \subsubsection{ppr-prv entrance point}
% Allow \pf{ppr-prv} to redefine \pf{HA-prosper} macros easily.
%    \begin{macrocode}
\@ifclassloaded{ppr-prv}{\InputIfFileExists{HAP-ppr-prv.def}{}{}}{}
%</program>
%    \end{macrocode}
% \subsection{Default configuration}\label{sec:config}
% The file |HA-prosper.cfg| generated from the code below contains the
% global configuration settings of \pf{HA-prosper}. We start with a small
% preamble.
%    \begin{macrocode}
%<*config>
%%
%% Global defaults of HA-prosper.
%% ==============================
%%
%% You can change this file but be careful since it will
%% affect all of your presentations. See for more information
%% the documentation of the HA-prosper package.
%%
\HAPsetup{%
%    \end{macrocode}
% Left footer.
%    \begin{macrocode}
  lf=,
%    \end{macrocode}
% Right footer.
%    \begin{macrocode}
  rf=,
%    \end{macrocode}
% Transition, using \pf{prosper} default for backward compatibility.
%    \begin{macrocode}
  trans=\@defaultTransition,
%    \end{macrocode}
% Template for parts.
%    \begin{macrocode}
  template=slide,
%    \end{macrocode}
% Starting overlay of stepping environments.
%    \begin{macrocode}
  sstart=1,
%    \end{macrocode}
% Type of stepping environment.
%    \begin{macrocode}
  stype=0,
%    \end{macrocode}
% Inactive color for stepping environments.
%    \begin{macrocode}
  iacolor=lightgray,
%    \end{macrocode}
% Title slide navigation.
%    \begin{macrocode}
  tsnav=FullScreen,
%    \end{macrocode}
% Normal slide navigation.
%    \begin{macrocode}
  nsnav=ShowBookmarks,
%    \end{macrocode}
% Slide number layout.
%    \begin{macrocode}
  sn={-~p.~\thepage\ifallPages/\totalpages\fi},
%    \end{macrocode}
% Counters that should be protected on overlays.
%    \begin{macrocode}
  counters=
}
%</config>
%    \end{macrocode}
% \Finale
\endinput