File: minitoc.sty

package info (click to toggle)
tetex-src 3.0.dfsg.2-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 122,292 kB
  • ctags: 2,709
  • sloc: makefile: 2,323; perl: 1,820; sh: 1,378; lisp: 448; python: 335; xml: 175; sed: 138; ansic: 138; yacc: 52
file content (3140 lines) | stat: -rw-r--r-- 123,928 bytes parent folder | download | duplicates (3)
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
\def\fileversion{v40}
\def\filedate{2004/12/20}
% minitoc.sty
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Jean-Pierre Drucbert
% ONERA/Toulouse/SRI
% Office national d'\'etudes et de recherches a\'erospatiales
% Centre de Toulouse
% Service r\'eseaux et informatique
% Complexe scientifique de Rangueil
% 2, Avenue \'Edouard Belin
% BP 4025
% F-31055 TOULOUSE CEDEX
% FRANCE
%
% Phone +33-62-25-25-15
%
% Email: drucbert@onecert.fr
%
% Please send me any (constructive) suggestions and comments.

% mtc31hyp.sty (version v31href): (renamed minitoc.sty, version 31 (JPFD))
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Patched by Heiko Oberdiek <oberdiek@ruf.uni-freiburg.de>
% to work with _and_ without hyperref.sty.
% The forth argument of hyperref's \contentsline
% is transparently passed through.
% It uses the patches of v30href (see below).
% Additions and changes are marked with %%HO.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% mtc30hyp.sty (version v30href):
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Patched by Heiko Oberdiek <oberdiek@ruf.uni-freiburg.de>
% to work with hyperref.sty.
% It uses the patches of v28href (see below).
% Additions and changes are marked with %%HO.
% Bug fix: \stepcounter{mtc} removed in
%          starchapter part of \PTC@contentsline.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% minitoc-hyper.sty (version v28href):
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Temporarily patched by Bernd Jaehne [Bernd.Jaehne@aeon.de]
% and Didier Verna [verna@inf.enst.fr] to
% work with hyperref.sty from s.rahtz@elsevier.co.uk
% using input from Tony Roberts [aroberts@usq.edu.au]
% For changes see comments %%BJ and %DV
%
% However: this patch works only when  hyperref.sty is used,
% otherwise errors occur. Thus it may be advisable to add code
% so that minitoc runs both in standard and hyperref mode.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% History (contains some obsolete things... it is NOT
% the REAL documentation)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% minitoc.sty --- redefines the \chapter command to display a
%  mini-table-of-contents at the beginning of every chapter.
%  Oct-90       Original version, by Nigel Ward.
%  Nov-91       Revised to reuse \chapter, \section, \subsection
%               commands transparently, generate toc-file-name
%               automatically,
%               assorted other cleanup.  Dan Jurafsky
%  Jun/Jul-93   New design, to avoid allocating a newwrite
%               for each chapter (!)
%               Added \chapterend to terminate the scope of a minitoc.
%               (IF YOU FORGOT PUTTING \chapterend at the end
%               of EACH chapter, an entry for the next chapter
%               will appear in each minitoc.) (Thanks to Yufan Hu).
%               Replaced ``minipage'' environnement by a ``verse''
%               environnement, to allow a minitoc split across pages.
%               All the layout of the minitoc is in the
%               \minitableofcontents command, so if someboby wants
%               to redefine that layout, he has just to
%               rewrite it (and only it).
%
%               You can inhibit the minitoc for the next chapter
%               by preceding it with \minitocno. (\minitocyes
%               is useless for the user: it is implicit AFTER
%               the \chapter* pseudo-chapters).
%
%               Problems: you MUST have \chapterend to terminate each
%               chapter with a minitoc.
%               How about avoiding this constraint?
%
%               The depth of the minitoc is user-adjustable with
%               the counter `minitocdepth' (as `tocdepth' for the table
%               of contents).
%               At least three passes (3!!!) of LaTeX are necessary to
%               get correct minitoc's (the first pass creates the
%               .mtcX files, the second uses them (but they may
%               contain wrong page numbers) and recreates them,
%               the third should be ok).
%
%               Works with \chapter[xxx]{yyy} and floating bodies.
%               Works with two columns (but the minitoc is composed in
%               one column; how to make it to spread over the two
%               column?)
%               Some mods added to work with xr.sty (external
%               references). xr.sty version 5 is much more tolerant.
%   05Jul93     Version 2
%               Added compatibility with hangcaption.sty (the option
%               hangcaption (if present) must be given BEFORE minitoc
%               option.)
%               BEWARE to options modifying \@caption
%               Version 3 not released (buggy)
%   09Jul93     Version 4
%               Added \if@realch to avoid contentslines from
%               pseudo-chapters to go into the toc!
%               The option file mtcoff.sty allows to use a latex
%               document with minitoc commands and to make them
%               transparent: just replace the minitoc option by
%               mtcoff.
%   13Jul93     Version 5
%               Added a selection mechanism to not write spurious
%               things in the minitoc's.
%   15Jul93     Version 6
%               Fixed problems about chapters in the toc,
%               removed obsolete \caption stuff (filters are better)
%               added compatibility with toch.sty
%               (toch.sty makes a table of chapters. If used,
%               must be loaded BEFORE minitoc.sty)
%   22Jul93     Version 7 (MAJOR DIFFERENCES)
%               Completely rewritten, using tricks from xr.sty
%               (the version 5, by David Carlisle). The info
%               for minitocs is directly stolen from the .toc
%               file.
%               \chapterend and \minitocno are suppressed
%               \minitoc, \dominitoc and \faketableofcontents added
%   29Jul93     Version 8
%               Spacing adjustements.
%   04Aug93     Version 9
%               Added mods for MS-DOS (search MS-DOS, uncomment;
%               search UNIX, comment out). MS-DOS allows only
%               3 characters for extensions in file names
%               (what a pity!).
%   05Aug93     Version 10
%               Works with appendices.
%               Detects obsolete versions of latex.tex.
%               (\@inputcheck or \reset@font not defined).
%   18Aug93     Version 11
%               Added \mtcSfont, font for section entries,
%               \mtcSSfont for subsection entries,
%               \mtcSSSfont for subsubsection entries,
%               \mtcPfont for paragraph entries,
%               \mtcSPfont for subparagraph entries.
%
%   16Dec93     Version 12
%               Use \kern's in place of \vspace*'s,
%               and added penalties (\nopagebreak) to
%               avoid a page break just before last \mtc@rule.
%               Also added a \samepage environnement.
%               Removed old commented out lines from
%               previous versions.
%
%   17Dec93     Version 13
%               Added minilof and minilot stuff.
%               For MS-DOS, uncomment the definition of \SHORTEXT.
%
%   03Jan94     Version 14
%               Corrected space under minitoc/lof/lot and added a
%               \raggedright to avoid ``underfull'' warnings.
%               Corrected some spacing problems (avoiding ~'s).
%               \mtifont changed from \normalsize\bf to
%               \large\bf.
%               Some mods suggested by Donald Arseneau (thanks):
%               \@newread becomes \newread, not outer
%               version of \newread.
%               \empty replaced by \relax in the spare definition
%               of \reset@font.
%               Removed \clubpenalty=10000 and \widowpenalty=10000
%               (done by \samepage), and \noindent.
%               Simplified processing of optional argument in
%               \minitoc, \minilof and \minilot.
%
%   27Jan94     Version 15
%               Added parttoc, partlof and partlot for books,
%               with commands and parameters parallel to
%               those for mini-things.
%
%               Added secttoc, sectlof and sectlot for articles,
%               with commands and parameters parallel to
%               those for mini-things.
%
%   02Feb94     Version 16
%               Bug fixes (typos).
%
%   23Jun94     Version 17
%               Keyword 'n' (null) synonym of 'e' (empty).
%               Compatibility with LaTeX ``2e''.
%               Thanks to Denis Roegel (who found
%               the problem) and Frank Mittelbach
%               (who gave the hints to solve).
%
%   26Jun94     Version 18
%               Make minitoc really compatible with latex2e
%               Introduce the language files as options
%               Thanks to Michel Goossens (via Frank Mittelbach)
%               who was inspired by the code of babel (Johannes Braams).
%
%   16Aug94     Version 19
%               Added stuff for numbering of chapters (parts,
%               sections) not starting at 1.
%               \firstchapteris etc. commands added.
%               \mtcrule, \nomtcrule etc. commands added.
%               Corrected a bug in \c@mti.
%               Corrected mtcswedish.sty (Jan Michel Rynning)
%               Corrected appendix in articles
%
%   25Aug94     Version 20
%               Corrected spacing before and after minitocs
%               and siblings.
%               Added \mtcpagenumbers and \nomtcpagenumbers
%               (and siblings) to make minitocs with/without
%               page numbers. Default: page numbers.
%               Corrected (difficult bug) appendix in articles.
%               Corrected vertical spacing.
%               Corrected a problem with chapters numbered
%               with (uppercase) roman numbers.
%
%   07Sep94     Version 21
%               Corrected typos in minitoc.sty and minitoc.tex.
%
%   10Oct94     Version 22
%               Corrected typos in minitoc.sty.
%
%   08Nov94     Version 23
%               Added a missing line in \sectlof@.
%               Works with document classes resetting
%               chapter (or section) number at each part.
%               (Thanks to Denis Roegel)
%               Removed stuff for \firstchapteris and co.
%               These commands are obsolete.
%               Removed appendix stuff.
%
%   21Dec94     Version 24
%               The \protect commands have been removed from
%               the .toc, .lot and .lot files, so some internal
%               macros have been corrected to be compatible
%               with the LaTeX2e release of December 1994.
%               Thanks to Denis Roegel who did the work.
%
%   13Sep96     Version 25
%               Updated mtcnorsk.sty and added mtcnynorsk.sty
%               on a suggestion from Dag Langmyhr (dag@ifi.uio.no).
%
%   14Nov96     Version 26
%               Language specific commands are now named <language>.mld
%               (in place of mtc<language>.sty) because they are not
%               packages and it makes shorter names.
%               Added breton, estonian, germanb, greek, irish,
%               russianb, scottish, lower and upper sorbian;
%               renamed esperanto by esperant like in Babel.
%
%   20Dec96     Version 27
%               Corrections for starred sectionning commands.
%               english.mld loaded as default language.
%               Added vietnam.mld.
%               Added arab.mld.
%               Renamed minitocoff.sty into mtcoff.sty to
%               keep the name short.
%
%   29Oct97     Version 28
%               Added afrikaan(s) language
%               Added brazil language
%               Added ethiopia(n) language
%               Added autoconfiguration of extensions
%               Added shortext option
%               Added COFFEE stuff
%               Added \addstarred stuff (for starchapter stuff)
%               Fixed bug in parttocs.
%
%   17Nov98     Version 28
%               15Jun98: a typo corrected by Donald Arseneau:
%                 {\let@dottedtocline\@undottedtocline}{}
%               should probably be
%                 {\let\@dottedtocline\@undottedtocline}{}
%                      ^
%                      |
%               Thanks to him.
%
%               Added the bahasa language
%
%   03Dec98     Version 28
%                Added the tight option
%
%   16Mar99     Version 29
%               Added the bicig, buryat, mongol and russianc languages
%   28Jun99     Added the armenian language (from ArmTeX)
%   23Jul99     Added the dotted/undotted options (default: dotted)
%   29Jul99     Added the lithuanian language
%
%   06Dec99     Version 30
%               Added the basque, ngermanb, serbian, ukraineb,
%               and welsh languages.
%               Corrected a bug on \sltname definition (mlt->slt).
%
%   04Avr2000   Version 31
%               Added compatibility with hyperref.sty,
%               thanks to Heiko Oberdiek <oberdiek@ruf.uni-freiburg.de>,
%               who has also simplified some code and fixed the
%               infamous \chapter* bug.
%
%   08Aug2000   Version 32
%               Added commands:
%                     \before|part|toc
%                     \after |    |lof
%                            |    |lot
%               and
%                     \thispagepart|toc|style
%                                  |lof|
%                                  |lot|
%
%               Documentation improved by Stefan Ulrich
%               <ulrich@cis.uni-muenchen.de>.
%
%               \nomtcrule corrected
%
%   07Dec2000   Version 33
%               Added commands:
%                     \mtcadd|chapter|[title]
%                            |section|
%                            |part|
%
%   These commands add stuff in the .toc, .lof and .lot files for
%   the \chapter* (\section* and \part*) problem. From a suggestion
%   by Karl F. Everitt (everitt@chem.skin1.chem.wisc.edu).
%
%   08Dec2000   Version 33
%               Corrected a feature in \mtcaddchapter & co.
%               with a blank optionnal argument.
%
%   13Dec2000b  Version 34
%
%   03Jan2001   Version 35
%   09Jan2001   Added macros to test if a file is ``empty''
%               (i.e. empty, blank or inexistent) or ``non
%               empty'' (i.e. useful).
%               I used some code from Stephan von Bechtolsheim.
%               Added the checkfiles/nocheckfiles options.
%               Replaced \The@chapter by \The@mtc.
%   26Feb2001   Added bulgarian.mld, hebrew.mld,
%               icelandic.mld, latin.mld, samin.mld.
%   09Mar2001   Added \mtcselectlanguage.
%   01Jun2001   Fixed estionian option (missing).
%   04Jul2001   Added interlingua language.
%
%   11Feb2002   Version 36
%   11Feb2002   Corrected an interaction with \tableofcontents
%               which creates a \chapter* or a \section*,
%               perturbing mtc/stc counters (problem signalled
%               by Frank Mittelbach).
%   18Feb2002   Corrected a spacing problem with empty titles
%               (problem signalled by Frank Mittelbach).
%               Workaround for the \parttoc-\chapter*
%               problem.
%   19Feb2002   Added \mtcskip and \mtcskipamount.
%   27Feb2002   Fixed test for empty files.
%   13Mar2002   Added bangla language.
%   15Mar2002   Reduced depth of \mtc@strutbox.
%
%   xxxxxxxxx   Version 37 canceled
%
%   24Jan2003   Version 38
%   24Jan2003   pt -> \p@ and 0pt -> \z@
%   24Jan2003   \hrule and \vrule replaced by \rule (latex)
%   24Jan2003   added \mtc@zrule for zero-dims rules 
%   28Jan2003   added frenchb language (synonym of french)
%   30Jan2003   changed test for empty titles
%   30Jan2003   added options flsection and flsectionb
%   31Jan2003   option tight applies to \parttoc
%               (Thomas Leonhardt leonhardt@informatik.tu-darmstadt.de)
%   07Feb2003   options flsection and flsectionb removed,
%   07Feb2003   replaced by insection option (=flsectionb).
%   11Feb2003   corrected numbering of SLF, SLT
%   20Feb2003   added frenchle and frenchpro languages (synonym of french)
%   20Feb2003   corrected secttocs, at least.
%   18Mar2003   corrected some vertical spacings and struts
%               (I added some mods by Frank Mittelbach, many
%               thanks to him.)
%               A lot of cleaning remains to do, but the
%               release seems to be needed now.

%   09Apr2003  Version 39
%   09Apr2003  modern font commands for
%   09Apr2003  compatibility with the memoir class
%   09Apr2003  \nomtcpagenumbers & memoir class
%   08Jun2004  added \@fileswfalse and \mtc@hook@beforeinputfile for the notoccite package
%              (asked for by Donald Arseneau)
%              added notoccite option (loads the notoccite package)
%   08Sep2004  added language options and .mld files for
%              dialects:
%                canadian (=english)
%                acadian, acadien, canadien (=french)
%                naustrian, ngerman (=ngermanb)
%              added comments in .mld files using special fonts.
%              corrections in the documentation
%              added a paragraph about making a TOC for
%                appendices, not listed in the main TOC.
%   17Sep2004  corrections in the documentation
%              corrections about rules

%   09Dec2004  Version 40
%   09Dec2004  Added japanese language
%   09Dec2004  Added castillan language
%   09Dec2004  Removed the test on the presence of the multicol
%   09Dec2004  package in minitoc.tex, because multicol is
%   09Dec2004  a required package.
%   09Dec2004  Added a figure in minitoc.tex about the need
%   09Dec2004  of 3 compilations.
%   09Dec2004  Added some infos in minitoc.bug.
%   09Dec2004  Added a paragraph about problem with the appendix package.
%   13Dec2004  Updated minitoc.bib.
%   14Dec2004  Added the hints option. This option is still experimental; you advice is welcome.
%   20Dec2004  Added fminitoc.pdf (french documentation in PDF format).
%
%   Jean-Pierre F. Drucbert
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\NeedsTeXFormat{LaTeX2e}[1996/06/01]%
%%% This file will not work with latex2.09
\ProvidesPackage{minitoc}[\filedate\space\fileversion\space
                        Package minitoc, compatible with hyperref]
\typeout{*** minitoc package, version 40 ***}%
%#39 \mtc@hook@beforeinputfile 
\newif\if@mtc@notoccite@ \@mtc@notoccite@false
\@ifundefined{mtc@hook@beforeinputfile}{\let\mtc@hook@beforeinputfile\relax}{}
%#39: look if the memoir class is loaded
\newif\if@mtc@memoirLoaded@ \@mtc@memoirLoaded@false
\@ifclassloaded{memoir}%
   {\@mtc@memoirLoaded@true\relax%
   \typeout{*** the memoir class is loaded: compatibility attempted ***}}%
   {\@mtc@memoirLoaded@false}
%%HO: <begin>
\typeout{*** compatible with hyperref ***}%
\newlength\mtcindent % indentation (left/right) of minitocs
\newskip\mtcskipamount % length of an \mtcskip     %v36-2002/02/19
\setlength{\mtcskipamount}{\bigskipamount}          %v36-2002/02/19
%\def\mtcskip{\removelastskip\vspace\mtcskipamount}  %v36-2002/02/19
\def\mtcskip{{\parskip=\z@\removelastskip\vspace\mtcskipamount}}  %v36-2002/02/22
\AtBeginDocument{%
  \@ifpackageloaded{hyperref}{%
    \def\toclevel@xpart{1000}%
    \def\toclevel@xchapter{1000}%
    \def\toclevel@xsect{1000}%
    \let\toclevel@starchapter\toclevel@chapter
    \let\toclevel@starsection\toclevel@section
    \let\toclevel@starsubsection\toclevel@subsection
    \let\toclevel@starsubsubsection\toclevel@subsubsection
    \let\toclevel@starparagraph\toclevel@paragraph
    \let\toclevel@starsubparagraph\toclevel@subparagraph
  }{}%
}
%%HO: <end>
\@ifundefined{part}{%
}{%
  \typeout{*** part level macros available ***}
  \let\mtc@svspart\@spart %28d
  \def\@spart{\stepcounter{ptc}\mtc@svspart} %28d
  \let\mtc@svpart\@part %23
  \def\@part{%
    \stepcounter{ptc}%
    \mtc@svpart
  }%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% v33 2000/12/08
% Some macros for testing an empty argument.            % v33 2000/12/08
% (from ifmtarg.sty, Peter R. Wilson and                % v33 2000/12/08
%  Donald Arseneau)                                     % v33 2000/12/08
\begingroup                                             % v33 2000/12/08
\catcode`\Q=3                                           % v33 2000/12/08
\long\gdef\mtc@ifmtarg#1{%                              % v33 2000/12/08
\mtc@xifmtarg#1QQ\@secondoftwo\@firstoftwo\@nil}        % v33 2000/12/08
\long\gdef\mtc@xifmtarg#1#2Q#3#4#5\@nil{#4}             % v33 2000/12/08
%\long\gdef\mtc@ifnotmtarg#1{%                          % v36 2002/02/15
%\mtc@xifmtarg#1QQ\@firstofone\@gobble\@nil}            % v36 2002/02/15
\endgroup                                               % v33 2000/12/08
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% v33 2000/12/08
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% v35 2000/01/09
% from while.tip by Stephan von Bechtolsheim           % v35 2000/01/09
% TeX in Practice Tome III p 408--410                  % v35 2000/01/09
% Springer-Verlag 1992   ISBN 3-540-97597-7            % v35 2000/01/09
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% v35 2000/01/09
\let\mtc@EndWhile = \fi                                % v35 2000/01/09
\def\mtc@While #1#2#3\mtc@EndWhile{%                   % v35 2000/01/09
   \def\mtc@WhilePreCondition{#1}%                     % v35 2000/01/09
   \def\mtc@WhileCondition{#2}%                        % v35 2000/01/09
   \def\mtc@WhileBody{#3}%                             % v35 2000/01/09
   \mtc@@While                                         % v35 2000/01/09
}                                                      % v35 2000/01/09
\def\mtc@@While{%                                      % v35 2000/01/09
   \mtc@WhilePreCondition                              % v35 2000/01/09
   \mtc@WhileCondition                                 % v35 2000/01/09
      \def\mtc@WhileNext{%                             % v35 2000/01/09
          \mtc@WhileBody                               % v35 2000/01/09
          \mtc@@While                                  % v35 2000/01/09
      }%                                               % v35 2000/01/09
   \else                                               % v35 2000/01/09
      \def\mtc@WhileNext{}%                            % v35 2000/01/09
   \fi                                                 % v35 2000/01/09
   \mtc@WhileNext                                      % v35 2000/01/09
}                                                      % v35 2000/01/09
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% v35 2000/01/09
% Some macros to test if a file is empty ou not:       % v35 2000/01/09
% \mtc@CkFile{file} returns \@mtc@FEtrue if file       % v35 2000/01/09
% is empty, @mtc@FEfalse if file not empty.            % v35 2000/01/09
% An inexistent file is empty.                         % v35 2000/01/09
% A file full of white space (space, tab, nl)          % v35 2000/01/09
% is empty. Comments are empty.                        % v35 2000/01/09
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% v35 2000/01/09
%\newread\rf\relax                                     % v35 2000/01/09
%Use \@inputcheck                                      % v35 2000/01/09
\newif\if@mtc@LI\@mtc@LItrue                           % v35 2000/01/09
\newif\if@mtc@FE\@mtc@FEtrue                           % v35 2000/01/09
\newif\if@mtc@checkfiles\@mtc@checkfilestrue           % v35 2000/01/09
\def\mtc@Body{\immediate\read\@inputcheck to           % v36 2002/02/27
                                   \mtc@Rline\relax    % v36 2002/02/27
  \ifeof\@inputcheck\relax\@mtc@LIfalse\fi             % v35 2000/01/09
  \expandafter\ifx\mtc@Rline\par\relax                 % v35 2000/01/09
     \def\mtc@Rline{}                                  % v35 2000/01/09
  \else                                                % v35 2000/01/09
     \ifeof\@inputcheck\relax\global\@mtc@LIfalse\fi   % v35 2000/01/09
     \mtc@ifmtarg{\mtc@Rline}{\relax}%                 % v35 2000/01/09
              {\@mtc@FEfalse\@mtc@LIfalse}             % v35 2000/01/09
  \fi                                                  % v35 2000/01/09
}                                                      % v35 2000/01/09
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% v35 2000/01/09
\def\mtc@CkFile#1{%                                    % v35 2000/01/09
\@mtc@LItrue\@mtc@FEtrue        % re-init!             % v36 2002/02/27
\if@mtc@checkfiles                                     % v35 2000/01/09
\IfFileExists{#1}{%                                    % v35 2000/01/09
\immediate\openin\@inputcheck #1\relax                 % v36 2002/02/27
\mtc@While{}{\if@mtc@LI\relax}%                        % v35 2000/01/09
   {\mtc@Body}%                                        % v35 2000/01/09
\mtc@EndWhile}%                                        % v35 2000/01/09
{\@mtc@FEtrue}%                                        % v35 2001/01/09
\else                                                  % v35 2001/01/09
\@mtc@FEfalse%                                         % v35 2001/01/09
\fi}                                                   % v35 2000/01/09
\closein\@inputcheck\relax                             % v35 2000/01/09
% Note: on a big empty file, this loop may be          % v35 2000/01/09
% time consuming, but not an eternity (33s for         % v35 2000/01/09
% 1000000 lines on my computer), and the first         % v35 2000/01/09
% no-empty line stops the loop.                        % v35 2000/01/09
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% v35 2000/01/09
\def\mtc@CkStr#1{%                                     % v38 2003/01/30
\immediate\openout\tf@mtc \jobname.bmt                 % v38 2003/01/30
\immediate\write\tf@mtc{#1}%                           % v38 2003/01/30
\immediate\closeout\tf@mtc                             % v38 2003/01/30
\mtc@CkFile{\jobname.bmt}}                             % v38 2003/01/30

\def\mtc@onebackpart{\addtocounter{ptc}{-1}}    % v36-2002/02/11
\def\mtc@onebackchap{\addtocounter{mtc}{-1}}    % v36-2002/02/11
\def\mtc@onebacksect{\addtocounter{stc}{-1}}    % v36-2002/02/11

% Add a \part* and its title in the toc         % v33 2000/12/07
\newcommand{\mtcaddpart}[1][]{%                 % v33 2000/12/07
    \mtc@ifmtarg{#1}{%                          % v33 2000/12/08
    \addcontentsline{toc}{xpart}{}%             % v33 2000/12/07
    }{%                                         % v33 2000/12/08
    \addcontentsline{toc}{part}{#1}%            % v33 2000/12/07
    }                                           % v33 2000/12/08
    \addcontentsline{lof}{xpart}{}%             % v33 2000/12/07
    \addcontentsline{lot}{xpart}{}%             % v33 2000/12/07
    \adjustptc%                                 % v33 2000/12/07
}                                               % v33 2000/12/07
} %23
\@ifundefined{chapter}{%
  \@ifundefined{section}{%
    \typeout{*** no section or chapter level macros available ***}%
    \typeout{*** PLEASE VERIFY YOUR MAIN DOCUMENT CLASS ***}%
  }{%
    \typeout{*** section level macros available ***}%
    % tocs are section*, apply a correction     % v36-2002/02/11
    \let\mtcsv@tableofcontents\tableofcontents  % v36-2002/02/11
    \let\mtcsv@listoffigures\listoffigures      % v38-2003/02/10
    \let\mtcsv@listoftables\listoftables        % v38-2003/02/10
    \def\tableofcontents{\mtcsv@tableofcontents\mtc@onebacksect} % v36
    \def\listoffigures{\mtcsv@listoffigures\mtc@onebacksect} % v38
    \def\listoftables{\mtcsv@listoftables\mtc@onebacksect} % v38
    \let\mtc@svsection\section %23
    \def\section{\stepcounter{stc}\mtc@svsection} %23
    \let\mtc@svss\@ssect %23
%v25 \def\@ssect{\addtocounter{stc}{-1}\mtc@svss} %23
% Add a \section* and its title in the toc      % v33 2000/12/07
\newcommand{\mtcaddsection}[1][]{%              % v33 2000/12/07
    \mtc@ifmtarg{#1}{%                          % v33 2000/12/08
    \addcontentsline{toc}{xsection}{}%          % v33 2000/12/08
    }{%                                         % v33 2000/12/08
    \addcontentsline{toc}{section}{#1}%         % v33 2000/12/07
    }%                                          % v33 2000/12/08
    \addcontentsline{lof}{xsection}{}%          % v33 2000/12/07
    \addcontentsline{lot}{xsection}{}%          % v33 2000/12/07
    \adjuststc%                                 % v33 2000/12/07
}                                               % v33 2000/12/07
  }%
}{%
  \typeout{*** chapter level macros available ***}
%    % tocs are chapter*, apply a correction     % v36-2002/02/11
%    \let\mtcsv@tableofcontents\tableofcontents  % v36-2002/02/11
%    \def\tableofcontents{\mtcsv@tableofcontents\mtc@onebackchap} % v36
  \let\mtc@svchapter\@chapter %23
  \def\@chapter{\stepcounter{mtc}\mtc@svchapter} %23
% Add a \chapter* and its title in the toc      % v33 2000/12/07
\newcommand{\mtcaddchapter}[1][]{%              % v33 2000/12/07
    \mtc@ifmtarg{#1}{%                          % v33 2000/12/08
    \addcontentsline{toc}{xchapter}{}%          % v33 2000/12/07
    }{%                                         % v33 2000/12/08
    \addcontentsline{toc}{chapter}{#1}%         % v33 2000/12/07
    }%                                          % v33 2000/12/08
    \addcontentsline{lof}{xchapter}{}%          % v33 2000/12/07
    \addcontentsline{lot}{xchapter}{}%          % v33 2000/12/07
    \adjustmtc%                                 % v33 2000/12/07
}                                               % v33 2000/12/07
}
\newwrite\tf@mtc  % a file descriptor to write minitocs
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% AUTOCONFIG (v28)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\typeout{*** Autoconfiguration of extensions ***}
\newif\if@longextensions\@longextensionsfalse

%---------------------------------
%The order of the writes is vital!
%---------------------------------
\immediate\openout\tf@mtc \jobname.mtc1
\immediate\write\tf@mtc{\string\@longextensionstrue}
\immediate\closeout\tf@mtc

\immediate\openout\tf@mtc \jobname.mtc
\immediate\write\tf@mtc{\string\@longextensionsfalse}
\immediate\closeout\tf@mtc

\input{\jobname.mtc1}

% Cover our tracks (scratch the files!):
\immediate\openout\tf@mtc \jobname.mtc
\immediate\closeout\tf@mtc

\immediate\openout\tf@mtc \jobname.mtc1
\immediate\closeout\tf@mtc


\if@longextensions
\typeout{*** Long extensions (Unix-like) will be used ***}
\else
\typeout{*** Short extensions (MSDOS-like) will be used ***sight***}
\fi
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% v27 : claim the type of system!
\if@longextensions%
\typeout%
{==> this version is configured for UNIX-like (long extensions) file names.}%
\else
\typeout{==> this version is configured for MSDOS-like (8+3) file names.}
\fi
%
% Option tight: the flag (1998/12/03)
\newif\iftightmtc \tightmtcfalse
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%not outer version of \newread
\def\newread{\alloc@6\read\chardef\sixt@@n}
\@ifundefined{@inputcheck}%
  {\typeout{Your version of latex.tex is obsolete.}%
  \typeout{Trying to continue...}\newread\@inputcheck\relax}{}
\@ifundefined{reset@font}%
  {\typeout{Your version of latex.tex is very obsolete.}%
  \typeout{Trying to continue... crossing fingers.}%
  \let\reset@font\relax}{}

\newtoks\mtc@toks
\def\mtc@string{\relax}
\newbox\mtc@strutbox
% \rule[raise]{W}{H}
%\setbox\mtc@strutbox=\hbox{\rule[1.3ex]{\z@}{2.0ex}}           %v38-2003/01/24
\setbox\mtc@strutbox=\hbox{\rule[1.8ex]{\z@}{2.5ex}}           %v38-2003/01/24
%\setbox\mtc@strutbox=\hbox{\rule[2.1ex]{\z@}{2.8ex}}           %v38-2003/01/24
\def\mtc@strut{\relax\ifmmode\copy\mtc@strutbox\else\unhcopy\mtc@strutbox\fi}
%ESSAISTRUT%\def\mtc@strut{\@finalstrut\@arstrutbox}
\def\mtc@v{\leavevmode%
     \mtc@strut}%ESSAISTRUT%\vphantom{Lp$^{l^l}_{p_p}$}}  % a pseudo-strut ?
\def\mtc@zrule{\rule[\z@]{\z@}{\z@}} % rule with zero depth, width and height %v38-2003/01/24
% \mtc@BBR discourages page breaks
\def\mtc@BBR{\unpenalty\nopagebreak[4]}
% Modified version to ignore the dots and the page number.              % 17b
\def\@undottedtocline#1#2#3#4#5{\ifnum #1>\c@tocdepth \else             % 17b
  \vskip \z@ plus.2\p@                                                  % 17b
  {\leftskip #2\relax \rightskip \@tocrmarg \parfillskip -\rightskip    % 17b
    \parindent #2\relax\@afterindenttrue                                % 17b
   \interlinepenalty\@M                                                 % 17b
   \leavevmode                                                          % 17b
   \@tempdima #3\relax \advance\leftskip \@tempdima \hbox{}%            % 17b
   \hskip -\leftskip                                                    % 17b
    #4\nobreak\hfill \nobreak                                           % 17b
           \null\par}
	   % 17b
	   \fi}                                               % 17b
%%
%
% PB page numbers
%%%%%%%%%
\if@mtc@memoirLoaded@
% if the memoir class is loaded, the definitions are different (#v39)
\def\mtcpagenumbers{%
  \cftpagenumberson{section}
  \cftpagenumberson{subsection}
  \cftpagenumberson{subsubsection}
  \cftpagenumberson{paragraph}
  \cftpagenumberson{subparagraph}}
\def\nomtcpagenumbers{%
  \cftpagenumbersoff{section}
  \cftpagenumbersoff{subsection}
  \cftpagenumbersoff{subsubsection}
  \cftpagenumbersoff{paragraph}
  \cftpagenumbersoff{subparagraph}}
\def\mtcpagenumbers{%
  \cftpagenumberson{section}
  \cftpagenumberson{subsection}
  \cftpagenumberson{subsubsection}
  \cftpagenumberson{paragraph}
  \cftpagenumberson{subparagraph}}
\def\nomtcpagenumbers{%
  \cftpagenumbersoff{section}
  \cftpagenumbersoff{subsection}
  \cftpagenumbersoff{subsubsection}
  \cftpagenumbersoff{paragraph}
  \cftpagenumbersoff{subparagraph}}
%
\def\stcpagenumbers{%
  \cftpagenumberson{subsection}
  \cftpagenumberson{subsubsection}
  \cftpagenumberson{paragraph}
  \cftpagenumberson{subparagraph}}
\def\nostcpagenumbers{%
  \cftpagenumbersoff{subsection}
  \cftpagenumbersoff{subsubsection}
  \cftpagenumbersoff{paragraph}
  \cftpagenumbersoff{subparagraph}}
%
\def\ptcpagenumbers{%
  \cftpagenumberson{chapter}
  \cftpagenumberson{section}
  \cftpagenumberson{subsection}
  \cftpagenumberson{subsubsection}
  \cftpagenumberson{paragraph}
  \cftpagenumberson{subparagraph}}
\def\noptcpagenumbers{%
  \cftpagenumbersoff{chapter}
  \cftpagenumbersoff{section}
  \cftpagenumbersoff{subsection}
  \cftpagenumbersoff{subsubsection}
  \cftpagenumbersoff{paragraph}
  \cftpagenumbersoff{subparagraph}}
%
  \def\mlfpagenumbers{\cftpagenumberson{figure}}
  \def\nomlfpagenumbers{\cftpagenumbersoff{figure}}
  \def\slfpagenumbers{\cftpagenumberson{figure}}
  \def\noslfpagenumbers{\cftpagenumbersoff{figure}}
  \def\plfpagenumbers{\cftpagenumberson{figure}}
  \def\noplfpagenumbers{\cftpagenumbersoff{figure}}
%
  \def\mltpagenumbers{\cftpagenumberson{table}}
  \def\nomltpagenumbers{\cftpagenumbersoff{table}}
  \def\sltpagenumbers{\cftpagenumberson{table}}
  \def\nosltpagenumbers{\cftpagenumbersoff{table}}
  \def\pltpagenumbers{\cftpagenumberson{table}}
  \def\nopltpagenumbers{\cftpagenumbersoff{table}}
\else
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%17b
\def\mtcpagenumbers{\let\mtc@pgno\null}         %17b
\def\nomtcpagenumbers{\let\mtc@pgno\relax}      %17b
\def\stcpagenumbers{\let\stc@pgno\null}         %17b
\def\nostcpagenumbers{\let\stc@pgno\relax}      %17b
\def\ptcpagenumbers{\let\ptc@pgno\null}         %17b
\def\noptcpagenumbers{\let\ptc@pgno\relax}      %17b
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%17b
\def\mlfpagenumbers{\let\mlf@pgno\null}         %17b
\def\nomlfpagenumbers{\let\mlf@pgno\relax}      %17b
\def\slfpagenumbers{\let\slf@pgno\null}         %17b
\def\noslfpagenumbers{\let\slf@pgno\relax}      %17b
\def\plfpagenumbers{\let\plf@pgno\null}         %17b
\def\noplfpagenumbers{\let\plf@pgno\relax}      %17b
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%17b
\def\mltpagenumbers{\let\mlt@pgno\null}         %17b
\def\nomltpagenumbers{\let\mlt@pgno\relax}      %17b
\def\sltpagenumbers{\let\slt@pgno\null}         %17b
\def\nosltpagenumbers{\let\slt@pgno\relax}      %17b
\def\pltpagenumbers{\let\plt@pgno\null}         %17b
\def\nopltpagenumbers{\let\plt@pgno\relax}      %17b
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%17b
\fi
\mtcpagenumbers %default                        %17b
\stcpagenumbers %default                        %17b
\ptcpagenumbers %default                        %17b
\mlfpagenumbers %default                        %17b
\slfpagenumbers %default                        %17b
\plfpagenumbers %default                        %17b
\mltpagenumbers %default                        %17b
\sltpagenumbers %default                        %17b
\pltpagenumbers %default                        %17b
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%32
\let\beforeparttoc\cleardoublepage              %32
\let\beforepartlof\cleardoublepage              %32
\let\beforepartlot\cleardoublepage              %32
\let\afterparttoc\cleardoublepage               %32
\let\afterpartlof\cleardoublepage               %32
\let\afterpartlot\cleardoublepage               %32
\def\thispageparttocstyle{\thispagestyle{empty}}%32
\def\thispagepartlofstyle{\thispagestyle{empty}}%32
\def\thispagepartlotstyle{\thispagestyle{empty}}%32
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%32
% if you don't want a table of contents, but want minitocs,
% you need to create the .toc file, without inputing it
% into your document. This command is a stripped off version
% of \tableofcontents
\def\faketableofcontents{\fake@starttoc{toc}}
% idem for list of figures
\def\fakelistoffigures{\fake@starttoc{lof}}
% idem for list of tables
\def\fakelistoftables{\fake@starttoc{lot}}
\def\fake@starttoc#1{\begingroup
  \makeatletter
  \if@filesw \expandafter\newwrite\csname tf@#1\endcsname
             \immediate\openout \csname tf@#1\endcsname \jobname.#1\relax
  \fi \global\@nobreakfalse \endgroup%
  \@ifundefined{c@stc}{}{\setcounter{stc}{0}}% v38-20030207
  }
%%
\global\let\mtc@markboth\markboth
\global\let\@mkboth\markboth
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%v30 starchapters
\def\addst@rred#1#2{%
  \addcontentsline{toc}{star#1}{#2}%
  \@ifundefined{c@ptc}{}{%
    \expandafter\ifx\csname #1\endcsname\part
      \stepcounter{ptc}%
    \fi
  }%
  \@ifundefined{c@mtc}{}{%
    \expandafter\ifx\csname #1\endcsname\chapter
      \stepcounter{mtc}%
    \fi
  }%
  \@ifundefined{c@stc}{}{%
    \expandafter\ifx\csname #1\endcsname\section
      \@ifundefined{chapter}{\stepcounter{stc}}{}%
    \fi
  }%
%%%<ESSAI
%  \@ifundefined{c@mtc}{}{%
%    \expandafter\ifx\csname #1\endcsname\starchapter
%      \stepcounter{mtc}%
%    \fi
%  }%
%  \@ifundefined{c@stc}{}{%
%    \expandafter\ifx\csname #1\endcsname\starsection
%      \@ifundefined{chapter}{\stepcounter{stc}}{}%
%    \fi
%  }%
%%%>ESSAI
}
\@ifundefined{chapter}{%
\gdef\addstarredsection#1{\addst@rred{section}{#1}}
}{%
\def\The@mtc{\arabic{mtc}} %v23 % v35 rename
\def\firstchapteris#1%
  {\typeout{^^JWARNING*** \string\firstchapteris}%
   \typeout{ is an obsolete command^^J}}
\newcounter{mtc}  % counter of minitocs
\setcounter{mtc}{0}
\def\adjustmtc{\stepcounter{mtc}}  %32
\gdef\themtc{\arabic{mtc}}
\newcounter{minitocdepth} % analog to tocdepth, but for minitocs
\setcounter{minitocdepth}{2} % default value
%\def\mtc@rule{\rule[3\p@]{\columnwidth}{.4\p@}\vspace*{2.6\p@}} % the \hrule is .4pt high %v38-2003/01/24 %kern->vspace* v39-2004/09/09
\def\mtc@rule{\kern-3\p@ \hrule \@width\columnwidth \kern2.6\p@} %the \hrule is .4pt high %v39-2004/09/17
%v39-2004/09/17 use \hrule to stay in vmode for the final \kern

\mtcindent=24\p@      % defaut value 
% redefined in #39
% \def\mtcfont{\small\rm}    % font for the minitoc
% \def\mtcSfont{\small\bf}   % font for the minitoc (sections)
% \def\mtcSSfont{\mtcfont}   % font for the minitoc (subsections)
% \def\mtcSSSfont{\mtcfont}  % font for the minitoc (subsubsections)
% \def\mtcPfont{\mtcfont}    % font for the minitoc (paragraphs)
% \def\mtcSPfont{\mtcfont}   % font for the minitoc (subparagraphs)
% \def\mlffont{\mtcfont}     % font for the minilof (figures)
% \def\mltfont{\mtcfont}     % font for the minilot (tables)
% \def\mtifont{\large\bf}    % font for titles
% \def\coffeefont{\small\sl} % font for COFFEE breaks
% in version #39, fonts are fully described, with NFSS:
\def\mtcfont{\small\rmfamily\upshape\mdseries}    % font for the minitoc
\def\mtcSfont{\small\rmfamily\upshape\bfseries}   % font for the minitoc (sections)
\let\mtcSSfont\mtcfont     % font for the minitoc (subsections)
\let\mtcSSSfont\mtcfont    % font for the minitoc (subsubsections)
\let\mtcPfont\mtcfont      % font for the minitoc (paragraphs)
\let\mtcSPfont\mtcfont     % font for the minitoc (subparagraphs)
\let\mlffont\mtcfont       % font for the minilof (figures)
\let\mltfont\mtcfont       % font for the minilot (tables)
\def\mtifont{\large\rmfamily\upshape\bfseries}    % font for titles
\def\coffeefont{\small\rmfamily\slshape\mdseries} % font for COFFEE breaks

% Centering, flushleft, flushright or empty titles.
\def\c@mti#1{\null\hfill #1\hfill\null}
\def\l@mti#1{\null #1\hfill\null}
\def\r@mti#1{\null\hfill #1\null}
% these ones do not work! % v36-2002/02/11
%\def\e@mti#1{\relax}
%\def\n@mti#1{\relax}
% v36-2002/02/11 avoid an ugly blank space (from FMi)
\def\e@mti#1{\vspace{-\baselineskip}} % v36-2002/02/11
\def\n@mti#1{\vspace{-\baselineskip}} % v36-2002/02/11

% Default: titles on left
\let\do@mtitc\l@mti
\let\df@mtitc\l@mti
\let\do@mtilf\l@mti
\let\df@mtilf\l@mti
\let\do@mtilt\l@mti
\let\df@mtilt\l@mti

\def\mtc@verse{\let\\=\@centercr
  \list{}{\itemsep\z@\itemindent \z@\listparindent \itemindent
	  \partopsep\z@ \topsep\z@
  \iftightmtc
          \parsep\z@ % 19981203
  \fi
	  \topsep=1ex % 20030317
          \leftmargin\mtcindent
          \rightmargin\leftmargin}\item[]}
\def\endmtc@verse{\nopagebreak[4]\endlist}

% this command must be used after \chapter
% if you need a minitoc (no automatic minitoc)
\def\minitoc{\@ifnextchar[{\minitoc@}{\minitoc@[d]}}

\def\minitoc@[#1]{%
\if@longextensions
\def\@tocfile{mtc\The@mtc}%  % UNIX
\else
\def\@tocfile{M\The@mtc}%    % MS-DOS
\fi
        \mtc@CkFile{\jobname.\@tocfile}               % v35 2001/01/09
        \if@mtc@FE                                    % v35 2001/01/09
        \typeout{\jobname.\@tocfile\space is empty}   % v35 2001/01/09
        \else                                         % v35 2001/01/09
        \relax\begin{samepage}% we begin a local group here, using samepage
        \if #1e\let\do@mtitc\e@mti
        \else\if #1n\let\do@mtitc\n@mti
        \else\if #1c\let\do@mtitc\c@mti
        \else\if #1l\let\do@mtitc\l@mti
        \else\if #1r\let\do@mtitc\r@mti
        \else\if #1d\let\do@mtitc\df@mtitc
        \fi\fi\fi\fi\fi\fi
%-v36-2002/03/15 We test the emptyness of \mtctitle % DOES NOT WORK YET
% \mtc@ifmtarg{\mtctitle}{\let\do@mtitc\e@mti\relax}{} %-v36-2002/03/15
        \mtc@CkStr{\mtctitle}\if@mtc@FE \let\do@mtitc\e@mti\relax\fi %v38 2003/01/30
        \raggedright % added #14
        \parskip=\z@%
        \reset@font\mtcfont%
        \parindent=\z@%
        \nopagebreak[4]%
        \kern-0.8\baselineskip\nopagebreak[4]%
        \par\noindent %%
        \ifx\mtc@rule\relax
        \begin{tabular}{@{}p{\columnwidth}@{}}
        \reset@font\mtifont\do@mtitc{\mtc@v\mtctitle}\\
        \end{tabular}%
	\else
        \begin{tabular}{@{}p{\columnwidth}@{}}
        \reset@font\mtifont\do@mtitc{\mtc@v\mtctitle}\\\hline
        \end{tabular}%
	\fi
        \nopagebreak[4]\null\leavevmode\mtc@zrule\\\mtc@BBR%
        \leftmargin\mtcindent
        \rightmargin\mtcindent
        \itemindent=\z@\labelwidth=\z@%
        \labelsep=\z@\listparindent=\z@%
        \begin{mtc@verse}\c@tocdepth=\c@minitocdepth%
        \leavevmode\\\mtc@BBR% this blank line is necessary to avoid
                % a wild negative indentation
        \vskip -.5\baselineskip
\begingroup
  \makeatletter
  \@ifundefined{mtc@pgno}%
  {\let\@dottedtocline\@undottedtocline}{}
  \@fileswfalse\mtc@hook@beforeinputfile\@input{\jobname.\@tocfile}
  % v36-2002/02/11 % adjust space under minitocs
  \vspace{-1ex} \vspace{-\baselineskip} % v36-2002/02/11
  \leavevmode\mtc@strut                 % v36-2002/02/11
  \global\@nobreakfalse\endgroup
        \end{mtc@verse}%
%        \kern-1.\baselineskip%
        \kern0.\baselineskip%
        \nopagebreak[4]\mtc@bottom@rule\null\leavevmode\\%
        \vskip-1.0\baselineskip\mtc@zrule
        \end{samepage}% %## the \\ is essential
        \par\pagebreak[1]\vspace*{-1ex}\fi}% %\fi for v35-2001/01/29
\def\mtc@bottom@rule{%\kern-3\p@%
  \ifx\mtc@rule\relax\relax\else  % 2000/08/08 v32 pb \nomtcrule
	\vskip -2.5ex%v38-2003/01/24
        \rule[2.4\p@]{\columnwidth}{.4\p@}\vspace*{2.6\p@}\fi} %v38-2003/01/24 %kern->vspace* v39-2004/09/09
        % some space under the minitoc

% Added in version #13
% this command must be used after \chapter
% if you need a minilof (no automatic minilof)
\def\minilof{\@ifnextchar[{\minilof@}{\minilof@[d]}}

\def\minilof@[#1]{%
\if@longextensions%
\def\@tocfile{mlf\The@mtc}%  % UNIX
\else
\def\@tocfile{F\The@mtc}%    % MS-DOS
\fi
        \mtc@CkFile{\jobname.\@tocfile}               % v35 2001/01/09
        \if@mtc@FE                                    % v35 2001/01/09
        \typeout{\jobname.\@tocfile\space is empty}   % v35 2001/01/09
        \else                                         % v35 2001/01/09
        \relax\begin{samepage}% we begin a local group here, using samepage
        \if #1e\let\do@mtilf\e@mti
        \else\if #1n\let\do@mtilf\n@mti
        \else\if #1c\let\do@mtilf\c@mti
        \else\if #1l\let\do@mtilf\l@mti
        \else\if #1r\let\do@mtilf\r@mti
        \else\if #1d\let\do@mtilf\df@mtilf
        \fi\fi\fi\fi\fi\fi
%-v36-2002/02/15 If \mlftitle is empty, acts like \minilof[e]
%-v36-2002/03/15 We test the emptyness of \mlftitle
%	\mtc@ifmtarg{\mlftitle}{\let\do@mtilf\e@mti\relax}{} %-v36-2002/03/15
        \mtc@CkStr{\mlftitle}\if@mtc@FE \let\do@mtilf\e@mti\relax\fi %v38 2003/01/30
        \raggedright % added #14
        \parskip=\z@%
        \reset@font\mlffont%
        \parindent=\z@%
        \nopagebreak[4]%
        \kern-0.8\baselineskip\nopagebreak[4]%
        \par\noindent
        \ifx\mtc@rule\relax
        \begin{tabular}{@{}p{\columnwidth}@{}}
        \reset@font\mtifont\do@mtilf{\mtc@v\mlftitle}\\
        \end{tabular}%
	\else
        \begin{tabular}{@{}p{\columnwidth}@{}}
        \reset@font\mtifont\do@mtilf{\mtc@v\mlftitle}\\\hline
        \end{tabular}%
	\fi
        \nopagebreak[4]\null\leavevmode\mtc@zrule\\\mtc@BBR%
        \leftmargin\mtcindent
        \rightmargin\mtcindent
        \itemindent=\z@\labelwidth=\z@%
        \labelsep=\z@\listparindent=\z@%
        % depth does not matter for minilof
        \begin{mtc@verse}%\c@tocdepth=\c@minitocdepth%
        \leavevmode\\\mtc@BBR% this blank line is necessary to avoid
                % a wild negative indentation
        \vskip -.5\baselineskip
\begingroup
  \makeatletter
  \@ifundefined{mlf@pgno}%
  {\let\@dottedtocline\@undottedtocline}{}
  \@fileswfalse\mtc@hook@beforeinputfile\@input{\jobname.\@tocfile}
  % v36-2002/02/11 % adjust space under minitocs
  \vspace{-1ex} \vspace{-\baselineskip} % v36-2002/02/11
  \leavevmode\mtc@strut                 % v36-2002/02/11
  \global\@nobreakfalse\endgroup
        \end{mtc@verse}%
        \kern-1.\baselineskip%
%        \kern0.\baselineskip%
        \nopagebreak[4]\mtc@rule\null\leavevmode\\%
        \vskip-1.0\baselineskip\mtc@zrule\end{samepage}% %## the \\ is essential
        \par\pagebreak[1]\vspace*{-1ex}\fi}% %\fi v35-2001/01/09
        % some space under the minilof

% Added in version #13
% this command must be used after \chapter
% if you need a minilot (no automatic minilot)
\def\minilot{\@ifnextchar[{\minilot@}{\minilot@[d]}}

\def\minilot@[#1]{%
\if@longextensions%
\def\@tocfile{mlt\The@mtc}%  % UNIX
\else
\def\@tocfile{T\The@mtc}%    % MS-DOS
\fi
        \mtc@CkFile{\jobname.\@tocfile}               % v35 2001/01/09
        \if@mtc@FE                                    % v35 2001/01/09
        \typeout{\jobname.\@tocfile\space is empty}   % v35 2001/01/09
        \else                                         % v35 2001/01/09
        \relax\begin{samepage}% we begin a local group here, using samepage
        \if #1e\let\do@mtilt\e@mti
        \else\if #1n\let\do@mtilt\n@mti
        \else\if #1c\let\do@mtilt\c@mti
        \else\if #1l\let\do@mtilt\l@mti
        \else\if #1r\let\do@mtilt\r@mti
        \else\if #1d\let\do@mtilt\df@mtilt
        \fi\fi\fi\fi\fi\fi
%-v36-2002/02/15 If \mlttitle is empty, acts like \minilot[e]
%-v36-2002/03/15 We test the emptyness of \mlttitle
%	\mtc@ifmtarg{\mlttitle}{\let\do@mtilt\e@mti\relax}{} %-v36-2002/03/15
        \mtc@CkStr{\mlttitle}\if@mtc@FE \let\do@mtilt\e@mti\relax\fi %v38 2003/01/30
        \raggedright % added #14
        \parskip=\z@%
        \reset@font\mltfont%
        \parindent=\z@%
        \nopagebreak[4]%
        \kern-0.8\baselineskip\nopagebreak[4]%
        \par\noindent
        \ifx\mtc@rule\relax
        \begin{tabular}{@{}p{\columnwidth}@{}}
        \reset@font\mtifont\do@mtilt{\mtc@v\mlttitle}\\
        \end{tabular}%
	\else
        \begin{tabular}{@{}p{\columnwidth}@{}}
        \reset@font\mtifont\do@mtilt{\mtc@v\mlttitle}\\\hline
        \end{tabular}%
	\fi
        \nopagebreak[4]\null\leavevmode\mtc@zrule\\\mtc@BBR%
        \leftmargin\mtcindent
        \rightmargin\mtcindent
        \itemindent=\z@\labelwidth=\z@%
        \labelsep=\z@\listparindent=\z@%
        % depth does not matter for minilot
        \begin{mtc@verse}%\c@tocdepth=\c@minitocdepth%
        \leavevmode\\\mtc@BBR% this blank line is necessary to avoid
                % a wild negative indentation
        \vskip -.5\baselineskip
\begingroup
  \makeatletter
  \@ifundefined{mlt@pgno}%
  {\let\@dottedtocline\@undottedtocline}{}
  \@fileswfalse\mtc@hook@beforeinputfile\@input{\jobname.\@tocfile}
  % v36-2002/02/11 % adjust space under minitocs
  \vspace{-1ex} \vspace{-\baselineskip} % v36-2002/02/11
  \leavevmode\mtc@strut                 % v36-2002/02/11
  \global\@nobreakfalse\endgroup
        \end{mtc@verse}%
        \kern-1.\baselineskip%
%        \kern0.\baselineskip%
        \nopagebreak[4]\mtc@rule\null\leavevmode\\%
        \vskip-1.0\baselineskip\mtc@zrule\end{samepage}% %## the \\ is essential
        \par\pagebreak[1]\vspace*{-1ex}\fi}% %\fi v35-2001/01/09
        % some space under the minilot

% I use a depth of 10000 to inhibit the printing of
% that contentsline.
\def\l@xchapter{\@dottedtocline{\@M}{1em}{2.3em}}
\def\xchapter{xchapter}

\let\sv@chapter\@chapter
\def\@chapter[#1]#2{\sv@chapter[{#1}]{#2}\relax%
\addcontentsline{lof}{xchapter}{#1}%
\addcontentsline{lot}{xchapter}{#1}%
\ignorespaces% %% Added 2000/05/02 (Adam Lewenberg <ahl@uakron.edu>)
}

% tricky code to deal with \chapter*
\let\mtc@schapter\@schapter
\def\@schapter{%
\addtocontents{toc}{\protect\chapterend}\mtc@schapter%
}
\def\@schapter{%
\addtocontents{@@@}{\protect\chapterbegin}\mtc@schapter%
}
\let\chapterend\relax
\let\chapterbegin\relax

%v28b
\@ifundefined{chapter}%
{\@ifundefined{section}{}{\def\addstarredsection#1{\addst@rred{section}{#1}}}}
{\def\addstarredchapter#1{\addst@rred{chapter}{#1}}}
\@ifundefined{part}{}%
{\def\addstarredpart#1{\addst@rred{part}{#1}}}

% for havlick COFFEE
\def\addcoffeeline#1#2#3{%
  \addtocontents{#1}{\protect\coffeeline{#2}{#3}{\null}}}
\def\coffeeline#1{\csname l@#1\endcsname}
\newcommand*\l@coffee{\@Undottedtocline{1}{1.5em}{2.3em}}
\def\@Undottedtocline#1#2#3#4#5{%
  \ifnum #1>\c@tocdepth \else
    \vskip \z@ \@plus.2\p@
    {\leftskip #2\relax \rightskip \@tocrmarg \parfillskip -\rightskip
     \parindent #2\relax\@afterindenttrue
     \interlinepenalty\@M
     \leavevmode
     \@tempdima #3\relax
     \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
     {\coffeefont #4}\nobreak
%     \leaders\hbox{$\m@th
%        \mkern \@dotsep mu\hbox{.}\mkern \@dotsep
%        mu$}%
%        \hfill
     \nobreak\null
%     \hb@xt@\@pnumwidth{\hfil\normalfont \normalcolor #5}%
     \par}%
  \fi}

% The same but with the page number
%

\def\@Undottedtoclinep#1#2#3#4#5{%
  \ifnum #1>\c@tocdepth \else
    \vskip \z@ \@plus.2\p@
    {\leftskip #2\relax \rightskip \@tocrmarg \parfillskip -\rightskip
     \parindent #2\relax\@afterindenttrue
     \interlinepenalty\@M
     \leavevmode
     \@tempdima #3\relax
     \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
     {#4}\nobreak
%     \leaders\hbox{$\m@th
%        \mkern \@dotsep mu\hbox{.}\mkern \@dotsep
%        mu$}%
        \hfill
     \nobreak\null
     \hb@xt@\@pnumwidth{\hfil\normalfont \normalcolor #5}%
     \par}%
  \fi}

\let\appendixmtc\relax

%
% Hacks to remove the dots in the minitocs
% Bug fixed 2000/04/26 v31
% about optional argument
%

\newif\ifundottedmtc\undottedmtcfalse
\@ifundefined{chapter}{}{%
\let\sv@minitoc@\minitoc@
\def\minitoc@[#1]{{\ifundottedmtc\let\@dottedtocline\@Undottedtoclinep\fi
\sv@minitoc@[#1]}}
\let\sv@minilof@\minilof@
\def\minilof@[#1]{{\ifundottedmtc\let\@dottedtocline\@Undottedtoclinep\fi
\sv@minilof@[#1]}}
\let\sv@minilot@\minilot@
\def\minilot@[#1]{{\ifundottedmtc\let\@dottedtocline\@Undottedtoclinep\fi
\sv@minilot@[#1]}}}

\@ifundefined{part}{}{%
\let\sv@parttoc@\parttoc@
\def\parttoc@[#1]{{\ifundottedmtc\let\@dottedtocline\@Undottedtoclinep\fi
\sv@parttoc@[#1]}}
\let\sv@partlof@\partlof@
\def\partlof@[#1]{{\ifundottedmtc\let\@dottedtocline\@Undottedtoclinep\fi
\sv@partlof@[#1]}}
\let\sv@partlot@\partlot@
\def\partlot@[#1]{{\ifundottedmtc\let\@dottedtocline\@Undottedtoclinep\fi
\sv@partlot@[#1]}}}


\@ifundefined{chapter}{%
\@ifundefined{section}{}{%
\let\sv@secttoc@\secttoc@
\def\secttoc@[#1]{{\ifundottedmtc\let\@dottedtocline\@Undottedtoclinep\fi
\sv@secttoc@[#1]}}
\let\sv@sectlof@\sectlof@
\def\sectlof@[#1]{{\ifundottedmtc\let\@dottedtocline\@Undottedtoclinep\fi
\sv@sectlof@[#1]}}
\let\sv@sectlot@\sectlot@
\def\sectlot@[#1]{{\ifundottedmtc\let\@dottedtocline\@Undottedtoclinep\fi
\sv@sectlot@[#1]}}}}{}


% this command extracts info from the .toc file
% and create the .mtcN files (.mtc -> .M on MS-DOS)
\def\@dominitoc#1{{%
  \makeatletter
  \setcounter{mtc}{0} % START VALUE
  \MTC@next#1.toc\relax\\}\setcounter{mtc}{0}} %23: raz
% this command extracts info from the .lof file
% and create the .mlfN files (.mlf -> .F on MS-DOS)
\def\@dominilof#1{{%
  \makeatletter
  \setcounter{mtc}{0} % START VALUE
  \MLF@next#1.lof\relax\\}\setcounter{mtc}{0}} %23: raz
% this command extracts info from the .lot file
% and create the .mltN files (.mlt -> .T on MS-DOS)
\def\@dominilot#1{{%
  \makeatletter
  \setcounter{mtc}{0} % START VALUE
  \MLT@next#1.lot\relax\\}\setcounter{mtc}{0}} %23: raz

\def\dominitoc{\@ifnextchar[{\dominitoc@}{\dominitoc@[l]}}
\def\dominilof{\@ifnextchar[{\dominilof@}{\dominilof@[l]}}
\def\dominilot{\@ifnextchar[{\dominilot@}{\dominilot@[l]}}

\def\dominitoc@[#1]{%
\if #1e\let\df@mtitc\e@mti%
\else\if #1n\let\df@mtitc\n@mti%
\else\if #1c\let\df@mtitc\c@mti%
\else\if #1l\let\df@mtitc\l@mti%
\else\if #1r\let\df@mtitc\r@mti%
\fi\fi\fi\fi\fi%
\@@dominitoc}

\def\dominilof@[#1]{%
\if #1e\let\df@mtilf\e@mti%
\else\if #1n\let\df@mtilf\n@mti%
\else\if #1c\let\df@mtilf\c@mti%
\else\if #1l\let\df@mtilf\l@mti%
\else\if #1r\let\df@mtilf\r@mti%
\fi\fi\fi\fi\fi%
\@@dominilof}

\def\dominilot@[#1]{%
\if #1e\let\df@mtilt\e@mti%
\else\if #1n\let\df@mtilt\n@mti%
\else\if #1c\let\df@mtilt\c@mti%
\else\if #1l\let\df@mtilt\l@mti%
\else\if #1r\let\df@mtilt\r@mti%
\fi\fi\fi\fi\fi%
\@@dominilot}

\def\@@dominitoc{\@dominitoc{\jobname}\immediate\closeout\tf@mtc}
\def\@@dominilof{\@dominilof{\jobname}\immediate\closeout\tf@mtc}
\def\@@dominilot{\@dominilot{\jobname}\immediate\closeout\tf@mtc}

\def\MTC@next#1\relax#2\\{%
  \edef\MTC@list{#2}%
  \MTC@loop{#1}%
}
\def\MTC@toc{%
  \ifx\MTC@list\@empty\else\expandafter\MTC@explist\fi
}


\def\MTC@contentsline#1#2#3#4{% %%HO/BJ: 4 instead of 3 parameters
  \gdef\themtc{\arabic{mtc}}% %%HO: space removed
  \expandafter\ifx\csname #1\endcsname\chapter
    \stepcounter{mtc}% % the mtc counter simulates the chapter counter
    \if@longextensions%
      \typeout{Writing\space\jobname.mtc\themtc}%     % UNIX
      \def\mtcname{\jobname.mtc\themtc}%              % UNIX
    \else
      \typeout{Writing\space\jobname.M\themtc}%       % MS-DOS
      \def\mtcname{\jobname.M\themtc}%                % MS-DOS
    \fi
    \immediate\closeout\tf@mtc % close current .mtcN .mtc->.M on MS-DOS
    \immediate\openout\tf@mtc=\mtcname % open next .mtcN (.mtc->.M if MS-DOS)
  \fi
  \mtc@toks{\noexpand\leavevmode #2}%
% extracts and writes info for sections, etc.
  \expandafter\ifx\csname #1\endcsname\section
    \MTC@WriteContentsline{#1}{mtcS}{#3}{#4}%
  \fi
  \expandafter\ifx\csname #1\endcsname\coffee
    \MTC@WriteCoffeeline{#1}{#3}%
  \fi
  \expandafter\ifx\csname #1\endcsname\subsection
    \MTC@WriteContentsline{#1}{mtcSS}{#3}{#4}%
  \fi
  \expandafter\ifx\csname #1\endcsname\subsubsection
    \MTC@WriteContentsline{#1}{mtcSSS}{#3}{#4}%
  \fi
  \expandafter\ifx\csname #1\endcsname\paragraph
    \MTC@WriteContentsline{#1}{mtcP}{#3}{#4}%
  \fi
  \expandafter\ifx\csname #1\endcsname\subparagraph
    \MTC@WriteContentsline{#1}{mtcSP}{#3}{#4}%
  \fi
% Added v25: \starchapter and co.
% extracts and writes info for sections, etc.
  \expandafter\ifx\csname #1\endcsname\starchapter
    \stepcounter{mtc}% % the mtc counter simulates the chapter counter
    \if@longextensions
      \typeout{Writing\space\jobname.mtc\themtc}%     % UNIX
      \def\mtcname{\jobname.mtc\themtc}%              % UNIX
    \else
      \typeout{Writing\space\jobname.M\themtc}%       % MS-DOS
      \def\mtcname{\jobname.M\themtc}%                % MS-DOS
    \fi
    \immediate\closeout\tf@mtc % close current .mtcN .mtc->.M on MS-DOS
    \immediate\openout\tf@mtc=\mtcname % open next .mtcN (.mtc->.M if MS-DOS)
  \fi
% extracts and writes info for sections, etc.
  \expandafter\ifx\csname #1\endcsname\starsection
    \MTC@WriteContentsline{#1}{mtcS}{#3}{#4}%
  \fi
  \expandafter\ifx\csname #1\endcsname\starsubsection
    \MTC@WriteContentsline{#1}{mtcSS}{#3}{#4}%
  \fi
  \expandafter\ifx\csname #1\endcsname\starsubsubsection
    \MTC@WriteContentsline{#1}{mtcSSS}{#3}{#4}%
  \fi
  \expandafter\ifx\csname #1\endcsname\starparagraph
    \MTC@WriteContentsline{#1}{mtcP}{#3}{#4}%
  \fi
  \expandafter\ifx\csname #1\endcsname\starsubparagraph
    \MTC@WriteContentsline{#1}{mtcSP}{#3}{#4}%
  \fi
}

\def\MTC@explist{\expandafter\MTC@next\MTC@list\\}
\def\MTC@loop#1{\openin\@inputcheck#1\relax
  \ifeof\@inputcheck
    \typeout{^^JNo file #1^^JMINITOCS NOT PREPARED.^^J}%
    \expandafter\MTC@toc
  \else
    \typeout{PREPARING MINITOCS FROM #1}%
    \expandafter\MTC@read
  \fi
}
\def\MTC@read{%
  \read\@inputcheck to\MTC@line
  \expandafter\MTC@test\MTC@line.....\MTC@% %%HO: . added
}%
%%HO/BJ: now patch \MTC@test,
%%HO/BJ: call \MTC@contentsline with 4 instead of 3 parameters
\long\def\MTC@test#1#2#3#4#5#6\MTC@{% %%HO: #6 added
  \ifx#1\contentsline
    \let\mtc@string\string
    \MTC@contentsline{#2}{#3}{#4}{#5}%
    %%HO/BJ: 4. parameter added by Tony Roberts
    \let\mtc@string\relax
  \else\ifx#1\@input
    \edef\MTC@list{\MTC@list#2\relax}%
  \else\ifx#1\chapterend % \chapter* closes .mtcN (.mtc->.M on MS-DOS)
    \immediate\closeout\tf@mtc
    \immediate\openout\tf@mtc=\jobname.bmt % and opens a scratch file
  \else\ifx#1\chapterbegin
    \addtocounter{mtc}{-1}% % \chapter* has done a parasite increment
  \fi\fi\fi\fi
  \ifeof\@inputcheck
    \expandafter\MTC@toc
  \else
    \expandafter\MTC@read
  \fi
}%

\def\MLF@next#1\relax#2\\{%
  \edef\MLF@list{#2}%
  \MLF@loop{#1}}
\def\MLF@lof{%
  \ifx\MLF@list\@empty\else\expandafter\MLF@explist\fi}

\def\MLF@contentsline#1#2#3#4{% %%HO: added #4
  \gdef\themtc{\arabic{mtc}}% %%HO: space removed
  \expandafter\ifx\csname #1\endcsname\xchapter
    \stepcounter{mtc}% % the mtc counter simulates the chapter counter
    \if@longextensions%
      \typeout{Writing\space\jobname.mlf\themtc}%     % UNIX
      \def\mlfname{\jobname.mlf\themtc}%              % UNIX
    \else
      \typeout{Writing\space\jobname.F\themtc}%       % MS-DOS
      \def\mlfname{\jobname.F\themtc}%                % MS-DOS
    \fi
    \immediate\closeout\tf@mtc % close current .mlfN .mlf->.F on MS-DOS
    \immediate\openout\tf@mtc=\mlfname % open next .mlfN (.mlf->.F if MS-DOS)
  \fi
  % extracts and writes info for sections, etc.
  \expandafter\ifx\csname #1\endcsname\figure
    \mtc@toks{\noexpand\leavevmode#2}%
    \MTC@WriteContentsline{#1}{mlf}{#3}{#4}%
  \fi
}

\def\MLF@explist{\expandafter\MLF@next\MLF@list\\}
\def\MLF@loop#1{\openin\@inputcheck#1\relax
  \ifeof\@inputcheck
    \typeout{^^JNo file #1^^JMINILOFS NOT PREPARED.^^J}%
    \expandafter\MLF@lof
  \else
    \typeout{PREPARING MINILOFS FROM #1}%
    \expandafter\MLF@read\fi}
\def\MLF@read{%
  \read\@inputcheck to\MLF@line
  \expandafter\MLF@test\MLF@line.....\MLF@% %%HO: . added
  }%
\long\def\MLF@test#1#2#3#4#5#6\MLF@{% %%HO: #6 added
  \ifx#1\contentsline
    \let\mtc@string\string
    \MLF@contentsline{#2}{#3}{#4}{#5}% %%HO: #4 added
    \let\mtc@string\relax
  \else\ifx#1\@input
     \edef\MLF@list{\MLF@list#2\relax}%
  \else\ifx#1\chapterend % \chapter* closes .mlfN (.mlf->.F on MS-DOS)
     \immediate\closeout\tf@mtc
     \immediate\openout\tf@mtc=\jobname.bmt % and opens a scratch file
  \else\ifx#1\chapterbegin
    \addtocounter{mtc}{-1}% % \chapter* has done a parasite increment
  \fi\fi\fi\fi
  \ifeof\@inputcheck\expandafter\MLF@lof
  \else\expandafter\MLF@read\fi}%

\def\MLT@next#1\relax#2\\{%
  \edef\MLT@list{#2}%
  \MLT@loop{#1}}
\def\MLT@lot{%
  \ifx\MLT@list\@empty\else\expandafter\MLT@explist\fi}

\def\MLT@contentsline#1#2#3#4{% %%HO: #4 added
  \gdef\themtc{\arabic{mtc}}% %%HO: space removed
  \expandafter\ifx\csname #1\endcsname\xchapter
    \stepcounter{mtc}% % the mtc counter simulates the chapter counter
    \if@longextensions%
      \typeout{Writing\space\jobname.mlt\themtc}%     % UNIX
      \def\mltname{\jobname.mlt\themtc}%              % UNIX
    \else
      \typeout{Writing\space\jobname.T\themtc}%       % MS-DOS
      \def\mltname{\jobname.T\themtc}%                % MS-DOS
    \fi
    \immediate\closeout\tf@mtc % close current .mltN .mlt->.T on MS-DOS
    \immediate\openout\tf@mtc=\mltname % open next .mltN (.mlt->.T if MS-DOS)
  \fi
% extracts and writes info for sections, etc.
  \expandafter\ifx\csname #1\endcsname\table
     \mtc@toks{\noexpand\leavevmode#2}%
     \MTC@WriteContentsline{#1}{mlt}{#3}{#4}%
  \fi
}

\def\MLT@explist{\expandafter\MLT@next\MLT@list\\}
\def\MLT@loop#1{\openin\@inputcheck#1\relax
  \ifeof\@inputcheck
    \typeout{^^JNo file #1^^JMINILOTS NOT PREPARED.^^J}%
    \expandafter\MLT@lot
  \else
    \typeout{PREPARING MINILOTS FROM #1}%
    \expandafter\MLT@read\fi}
\def\MLT@read{%
  \read\@inputcheck to\MLT@line
  \expandafter\MLT@test\MLT@line.....\MLT@% %%HO: . added
  }%
\long\def\MLT@test#1#2#3#4#5#6\MLT@{% %%HO: #6 added
  \ifx#1\contentsline
    \let\mtc@string\string
    \MLT@contentsline{#2}{#3}{#4}{#5}% %%HO: #4 added
    \let\mtc@string\relax
  \else\ifx#1\@input
     \edef\MLT@list{\MLT@list#2\relax}%
  \else\ifx#1\chapterend % \chapter* closes .mltN (.mlt->.T on MS-DOS)
     \immediate\closeout\tf@mtc
     \immediate\openout\tf@mtc=\jobname.bmt % and opens a scratch file
  \else\ifx#1\chapterbegin
        \addtocounter{mtc}{-1}% % \chapter* has done a parasite increment
  \fi\fi\fi\fi
  \ifeof\@inputcheck\expandafter\MLT@lot
  \else\expandafter\MLT@read\fi}%
} % end of chapter level

%%HO: new \MTC@WriteContentsline:
%%HO: * makes definition of \MTC@contentsline shorter
%%HO: * extra \edef level removed.
\def\mtc@dot{.}
\def\MTC@WriteContentsline#1#2#3#4{%
  % #1: #1 of \MTC@contentsline
  % #2: font shorthand ==> \csname #2font\endcsname
  % #3: #3 of \MTC@contentsline
  % #4: #4 of \MTC@contentsline
  \def\mtc@param{#4}%
   \immediate\write\tf@mtc{%
    {%
      \string\reset@font
      \expandafter\string\csname #2font\endcsname
      \string\mtc@string
      \string\contentsline{#1}%
      {\the\mtc@toks}%
      {%
        \string\reset@font
        \expandafter\string\csname #2font\endcsname
        \space #3%
      }%
      \ifx\mtc@dot\mtc@param
      \else
        {#4}% %%HO/BJ: #4 is hyperlink
      \fi
    }%
  }%
}
\def\MTC@WriteCoffeeline#1#2#3{%
  % #1: #1 of \MTC@contentsline
  % #2: #3 of \MTC@contentsline
  \immediate\write\tf@mtc{%
    {%
      \string\reset@font
      \string\coffeefont
      \string\mtc@string
%COFFEE \string\textbf{#1}%
      {\the\mtc@toks}%
      {%
        \string\reset@font
        \string\coffeefont
        \space #3%
      }%
    }%
  }%
}

%%%%%%%%%%%%%%%%%%%%%%%%%
%%
% If \part is defined (book or article-like document),
% the following macros are allowed
% Sometimes, we need to make a difference between book and
% article (is \chapter defined?), to have a different layout.
\@ifundefined{part}{}%
{%
\def\xpart{xpart}
\def\ypart{ypart}
\def\Thepart{\arabic{ptc}} %v28c ; that \arabic{part}
\def\firstpartis#1%
  {\typeout{^^JWARNING*** \string\firstpartis}%
   \typeout{ is an obsolete command^^J}}
\newcounter{ptc}  % counter of parttocs
\setcounter{ptc}{0}
\def\adjustptc{\stepcounter{ptc}}  %32
\def\theptc{\arabic{ptc}}
\newcounter{parttocdepth} % analog to tocdepth, but for parttocs
\setcounter{parttocdepth}{2}

\@ifundefined{chapter}{%
\def\ptc@rule{\rule[3\p@]{\columnwidth}{.4\p@}\vspace*{2.6\p@}}% the \hrule is .4pt high  %kern->vspace* v39-2004/09/09
}{\let\ptc@rule\relax} % no rule before/after parttoc/partlof/partlot
                       % for books % declare \ptcrule if you wnat these rules

\newlength\ptcindent % indentation (left/right) of parttocs
\@ifundefined{chapter}{\ptcindent=24\p@}{\ptcindent=\z@} % defaut value

\@ifundefined{chapter}{%
%#v39
\def\ptcfont{\small\rmfamily\upshape\mdseries}    % font for the parttoc
\def\ptcSfont{\small\rmfamily\upshape\bfseries}   % font for the parttoc (sections)
\let\ptcSSfont\ptcfont     % font for the parttoc (subsections)
\let\ptcSSSfont\ptcfont    % font for the parttoc (subsubsections)
\let\ptcPfont\ptcfont      % font for the parttoc (paragraphs)
\let\ptcSPfont\ptcfont     % font for the parttoc (subparagraphs)
\let\plffont\ptcfont       % font for the partlof (figures)
\let\pltfont\ptcfont       % font for the partlot (tables)
\def\ptifont{\Large\rmfamily\upshape\bfseries}    % font for titles
}{%
\def\ptcfont{\normalsize\rmfamily\upshape\mdseries}    % font for the parttoc
\def\ptcCfont{\normalsize\rmfamily\upshape\bfseries}   % font for the parttoc (chapters)
\def\ptcSfont{\normalsize\rmfamily\upshape\mdseries}   % font for the parttoc (sections)
\let\ptcSSfont\ptcfont     % font for the parttoc (subsections)
\let\ptcSSSfont\ptcfont    % font for the parttoc (subsubsections)
\let\ptcPfont\ptcfont      % font for the parttoc (paragraphs)
\let\ptcSPfont\ptcfont     % font for the parttoc (subparagraphs)
\let\plffont\ptcfont       % font for the partlof (figures)
\let\pltfont\ptcfont       % font for the partlot (tables)
\def\ptifont{\Huge\rmfamily\upshape\bfseries}     % font for titles
}

% Centering, flushleft, flushright or empty titles.
\@ifundefined{chapter}{%
\def\c@pti#1{\null\hfill #1\hfill\null}
\def\l@pti#1{\null #1\hfill\null}
\def\r@pti#1{\null\hfill #1\null}
%\def\e@pti#1{\relax}
%\def\n@pti#1{\relax}
% v36-2002/02/11 avoid an ugly blank space (from FMi)
\def\e@pti#1{\vspace{-\baselineskip}} % v36-2002/02/11
\def\n@pti#1{\vspace{-\baselineskip}} % v36-2002/02/11
}{%
%\def\e@pti#1{\relax}
%\def\n@pti#1{\relax}
% v36-2002/02/11 avoid an ugly blank space (from FMi)
\def\e@pti#1{\vspace{-\baselineskip}} % v36-2002/02/11
\def\n@pti#1{\vspace{-\baselineskip}} % v36-2002/02/11
\def\l@pti#1{\if@twocolumn
    \@topnewpage[\@makephead@l{#1}]%
    \else
    \@makephead@l{#1}%
    \@afterheading
    \fi}
\def\@makephead@l#1{%
    \vspace*{50\p@}%
    {\parindent \z@ \raggedright
     \ptifont
     #1\par
     \nobreak
     \vskip 40\p@
    }}
\def\r@pti#1{\if@twocolumn
    \@topnewpage[\@makephead@r{#1}]%
    \else
    \@makephead@r{#1}%
    \@afterheading
    \fi}
\def\@makephead@r#1{%
    \vspace*{50\p@}%
    {\parindent \z@ \raggedleft
     \ptifont
     #1\par
     \nobreak
     \vskip 40\p@
    }}
\def\c@pti#1{\if@twocolumn
    \@topnewpage[\@makephead@c{#1}]%
    \else
    \@makephead@c{#1}%
    \@afterheading
    \fi}
\def\@makephead@c#1{%
    \vspace*{50\p@}%
    {\parindent \z@ \centering
     \ptifont
     #1\par
     \nobreak
     \vskip 40\p@
    }}%
}

% Default: titles on left
\let\do@ptitc\l@pti
\let\df@ptitc\l@pti
\let\do@ptilf\l@pti
\let\df@ptilf\l@pti
\let\do@ptilt\l@pti
\let\df@ptilt\l@pti

\def\ptc@verse{\let\\=\@centercr
  \list{}{\itemsep\z@\itemindent \z@\listparindent \itemindent
  \iftightmtc
	    \parsep\z@ % v38-20030131  % <<<<<<<<<<<<<<< CHANGED
  \fi
          \topsep=1ex % 20030317
          \leftmargin\ptcindent
          \rightmargin\leftmargin}\item[]}
\def\endptc@verse{\nopagebreak[4]\endlist}

% this command must be used after \part
% if you need a parttoc (no automatic parttoc)
\def\parttoc{\@ifnextchar[{\parttoc@}{\parttoc@[d]}}

\def\parttoc@[#1]{%
\if@longextensions%
\def\@tocfile{ptc\Thepart}%  % UNIX
\else
\def\@tocfile{P\Thepart}%    % MS-DOS
\fi
        \mtc@CkFile{\jobname.\@tocfile}               % v35 2001/01/09
        \if@mtc@FE                                    % v35 2001/01/09
        \typeout{\jobname.\@tocfile\space is empty}   % v35 2001/01/09
        \else                                         % v35 2001/01/09
        \@ifundefined{chapter}{}{\beforeparttoc %32 Yannick Michou (corr. typo)
        \global\let\mtc@markboth\markboth
        \global\let\@mkboth\markboth
%        \thispagestyle{empty}
        \thispageparttocstyle %32
        \mtc@markboth{\uppercase{\ptctitle}}{\uppercase{\ptctitle}}%
        }%
        \relax\begin{samepage}% we begin a local group here, using samepage
        \if #1e\let\do@ptitc\e@pti
        \else\if #1n\let\do@ptitc\n@pti
        \else\if #1c\let\do@ptitc\c@pti
        \else\if #1l\let\do@ptitc\l@pti
        \else\if #1r\let\do@ptitc\r@pti
        \else\if #1d\let\do@ptitc\df@ptitc
        \fi\fi\fi\fi\fi\fi
%-v36-2002/02/15 If \ptctitle is empty, acts like \parttoc[e]
%-v36-2002/03/15 We test the emptyness of \ptctitle
%	\mtc@ifmtarg{\ptctitle}{\let\do@ptitc\e@pti\relax}{} %-v36-2002/03/15
        \mtc@CkStr{\ptctitle}\if@mtc@FE \let\do@ptitc\e@pti\relax\fi %v38 2003/01/30
        \raggedright % added #14
        \parskip=\z@%
        \reset@font\ptcfont%
        \parindent=\z@%
        \nopagebreak[4]%
        \kern-0.8\baselineskip\nopagebreak[4]%
        \par\noindent
        \nopagebreak[4]%
        \ifx\ptc@rule\relax
        \begin{tabular}{@{}p{\columnwidth}@{}}
        \reset@font\ptifont\do@ptitc{\mtc@v\ptctitle}\\
        \end{tabular}%
	\else
        \begin{tabular}{@{}p{\columnwidth}@{}}
        \reset@font\ptifont\do@ptitc{\mtc@v\ptctitle}\\\hline
        \end{tabular}%
	\fi
        \nopagebreak[4]\null\leavevmode\mtc@zrule\\\mtc@BBR%
        \leftmargin\ptcindent
        \rightmargin\ptcindent
        \itemindent=\z@\labelwidth=\z@%
        \labelsep=\z@\listparindent=\z@%
        \begin{ptc@verse}\c@tocdepth=\c@parttocdepth%
        \leavevmode\\\mtc@BBR% this blank line is necessary to avoid
                % a wild negative indentation
        \vskip -.5\baselineskip
\begingroup
  \makeatletter
  \@ifundefined{ptc@pgno}%
  {\let\@dottedtocline\@undottedtocline}{}
  \@fileswfalse\mtc@hook@beforeinputfile\@input{\jobname.\@tocfile}
  % v36-2002/02/11 % adjust space under minitocs
  \vspace{-1ex} \vspace{-\baselineskip} % v36-2002/02/11
  \leavevmode\mtc@strut                 % v36-2002/02/11
  \global\@nobreakfalse\endgroup
        \end{ptc@verse}%
        \kern-1.\baselineskip%
%        \kern0.\baselineskip%
        \nopagebreak[4]\ptc@rule\null\leavevmode\\%
        \vskip-1.0\baselineskip\mtc@zrule\end{samepage}% %## the \\ is essential
        \par\@ifundefined{chapter}{\pagebreak[1]\vspace*{-1ex}}%
        {\afterparttoc}\fi}                  %32 %\fi v35-2001/01/09

% this command must be used after \part
% if you need a partlof (no automatic partlof)
\def\partlof{\@ifnextchar[{\partlof@}{\partlof@[d]}}

\def\partlof@[#1]{%
\if@longextensions%
\def\@tocfile{plf\Thepart}%  % UNIX
\else
\def\@tocfile{G\Thepart}%    % MS-DOS
\fi
        \mtc@CkFile{\jobname.\@tocfile}               % v35 2001/01.09
        \if@mtc@FE                                    % v35 2001/01/09
        \typeout{\jobname.\@tocfile\space is empty}   % v35 2001/01/09
        \else                                         % v35 2001/01/09
        \@ifundefined{chapter}{}{\beforepartlof %32
        \global\let\mtc@markboth\markboth
        \global\let\@mkboth\markboth
%        \thispagestyle{empty}
        \thispagepartlofstyle                   %32
        \mtc@markboth{\uppercase{\plftitle}}{\uppercase{\plftitle}}%
        }%
        \relax\begin{samepage}% we begin a local group here, using samepage
        \if #1e\let\do@ptilf\e@pti
        \else\if #1n\let\do@ptilf\n@pti
        \else\if #1c\let\do@ptilf\c@pti
        \else\if #1l\let\do@ptilf\l@pti
        \else\if #1r\let\do@ptilf\r@pti
        \else\if #1d\let\do@ptilf\df@ptilf
        \fi\fi\fi\fi\fi\fi
%-v36-2002/02/15 If \plftitle is empty, acts like \partlof[e]
%-v36-2002/03/15 We test the emptyness of \plftitle
%	\mtc@ifmtarg{\plftitlel}{\let\do@ptilf\e@pti\relax}{} %-v36-2002/03/15
        \mtc@CkStr{\plftitle}\if@mtc@FE \let\do@ptilf\e@pti\relax\fi %v38 2003/01/30
        \raggedright % added #14
        \parskip=\z@%
        \reset@font\plffont%
        \parindent=\z@%
        \nopagebreak[4]%
        \kern-0.8\baselineskip\nopagebreak[4]%
        \par\noindent
        \ifx\ptc@rule\relax
        \begin{tabular}{@{}p{\columnwidth}@{}}
        \reset@font\ptifont\do@ptilf{\mtc@v\plftitle}\\
        \end{tabular}%
	\else
        \begin{tabular}{@{}p{\columnwidth}@{}}
        \reset@font\ptifont\do@ptilf{\mtc@v\plftitle}\\
        \@ifundefined{chapter}{\hline}{}
        \end{tabular}%
	\fi
        \nopagebreak[4]\null\leavevmode\mtc@zrule\\\mtc@BBR%
        \leftmargin\ptcindent
        \rightmargin\ptcindent
        \itemindent=\z@\labelwidth=\z@%
        \labelsep=\z@\listparindent=\z@%
        % depth does not matter for partlof
        \begin{ptc@verse}%\c@tocdepth=\c@parttocdepth%
        \leavevmode\\\mtc@BBR% this blank line is necessary to avoid
                % a wild negative indentation
        \vskip -.5\baselineskip
\begingroup
  \makeatletter
  \@ifundefined{plf@pgno}%
  {\let\@dottedtocline\@undottedtocline}{}
  \@fileswfalse\mtc@hook@beforeinputfile\@input{\jobname.\@tocfile}
  \global\@nobreakfalse\endgroup
        \end{ptc@verse}%
        \kern-1.\baselineskip%
%        \kern0.\baselineskip%
        \nopagebreak[4]\ptc@rule\null\leavevmode\\%
        \vskip-1.0\baselineskip\mtc@zrule\end{samepage}% %## the \\ is essential
        \par\@ifundefined{chapter}{\pagebreak[1]\vspace*{-1ex}}%
        {\afterpartlof}\fi}                   %32 %\fi v35-2001/01/09

% Added in version #13
% this command must be used after \part
% if you need a minilot (no automatic partlot)
\def\partlot{\@ifnextchar[{\partlot@}{\partlot@[d]}}

\def\partlot@[#1]{%
\if@longextensions%
\def\@tocfile{plt\Thepart}%  % UNIX
\else
\def\@tocfile{U\Thepart}%    % MS-DOS
\fi
        \mtc@CkFile{\jobname.\@tocfile}               % v35 2001/01.09
        \if@mtc@FE                                    % v35 2001/01/09
        \typeout{\jobname.\@tocfile\space is empty}   % v35 2001/01/09
        \else                                         % v35 2001/01/09
        \@ifundefined{chapter}{}{\beforepartlot   %32
        \global\let\mtc@markboth\markboth
        \global\let\@mkboth\markboth
%        \thispagestyle{empty}
        \thispagepartlotstyle                     %32
        \mtc@markboth{\uppercase{\plttitle}}{\uppercase{\plttitle}}%
        }%
        \relax\begin{samepage}% we begin a local group here, using samepage
        \if #1e\let\do@ptilt\e@pti
        \else\if #1n\let\do@ptilt\n@pti
        \else\if #1c\let\do@ptilt\c@pti
        \else\if #1l\let\do@ptilt\l@pti
        \else\if #1r\let\do@ptilt\r@pti
        \else\if #1d\let\do@ptilt\df@ptilt
        \fi\fi\fi\fi\fi\fi
%-v36-2002/02/15 If \plttitle is empty, acts like \partlot[e]
%-v36-2002/03/15 We test the emptyness of \plttitle
%	\mtc@ifmtarg{\plttitle}{\let\do@ptilt\e@pti\relax}{} %-v36-2002/03/15
        \mtc@CkStr{\plttitle}\if@mtc@FE \let\do@ptilt\e@pti\relax\fi %v38 2003/01/30
        \raggedright % added #14
        \parskip=\z@%
        \reset@font\pltfont%
        \parindent=\z@%
        \nopagebreak[4]%
        \kern-0.8\baselineskip\nopagebreak[4]%
        \par\noindent
        \ifx\ptc@rule\relax
        \begin{tabular}{@{}p{\columnwidth}@{}}
        \reset@font\ptifont\do@ptilt{\mtc@v\plttitle}\\
        \end{tabular}%
	\else
        \begin{tabular}{@{}p{\columnwidth}@{}}
        \reset@font\ptifont\do@ptilt{\mtc@v\plttitle}\\
        \@ifundefined{chapter}{\hline}{}
        \end{tabular}%
	\fi
        \nopagebreak[4]\null\leavevmode\mtc@zrule\\\mtc@BBR%
        \leftmargin\ptcindent
        \rightmargin\ptcindent
        \itemindent=\z@\labelwidth=\z@%
        \labelsep=\z@\listparindent=\z@%
        % depth does not matter for partlot
        \begin{ptc@verse}%\c@tocdepth=\c@parttocdepth%
        \leavevmode\\\mtc@BBR% this blank line is necessary to avoid
                % a wild negative indentation
        \vskip -.5\baselineskip
\begingroup
  \makeatletter
  \@ifundefined{plt@pgno}%
  {\let\@dottedtocline\@undottedtocline}{}
  \@fileswfalse\mtc@hook@beforeinputfile\@input{\jobname.\@tocfile}
  \global\@nobreakfalse\endgroup
        \end{ptc@verse}%
        \kern-1.\baselineskip%
%        \kern0.\baselineskip%
        \nopagebreak[4]\ptc@rule\null\leavevmode\\%
        \vskip-1.0\baselineskip\mtc@zrule\end{samepage}% %## the \\ is essential
        \par\@ifundefined{chapter}{\pagebreak[1]\vspace*{-1ex}}%
        {\afterpartlot}\fi}                     %32 %\fi v35-2001/01/09

% I use a depth of 10000 to inhibit the printing of
% that contentsline.
\def\l@xpart{\@dottedtocline{\@M}{1.0em}{2.3em}}
\def\l@ypart{\@dottedtocline{0}{1.0em}{2.3em}}
\def\l@pchapter{\@dottedtocline{1}{1.0em}{2.3em}}
\def\l@psection{\@dottedtocline{2}{1.0em}{2.3em}}

\def\pchapter{pchapter}
\def\psection{psection}

%v28d \let\sv@part\@part
\let\sv@part\mtc@svpart %28d
\def\@part[#1]#2{\sv@part[{#1}]{#2}\relax%
\addcontentsline{lof}{xpart}{#1}%
\addcontentsline{lot}{xpart}{#1}%
\addcontentsline{toc}{xpart}{#1}%v28c
\stepcounter{ptc}%
}

%v28d
%\let\sv@spart\mtc@svspart
\let\sv@spart\@spart
\def\@spart{\stepcounter{ptc}\sv@spart}

% tricky code to deal with \part*
\let\ptc@spart\@spart
\def\@spart{%
\addtocontents{toc}{\protect\partend}\ptc@spart%
}
\def\@spart{%
\addtocontents{toc}{\protect\partbegin}\ptc@spart%
}
\let\partend\relax
\let\partbegin\relax

\let\appendixmtc\relax

% this command extracts info from the .toc file
% and create the .ptcN files (.ptc -> .P on MS-DOS)
\def\@doparttoc#1{{%
  \makeatletter
  \setcounter{ptc}{0} % START VALUE
  \PTC@next#1.toc\relax\\}\setcounter{ptc}{0}} %23; raz
% this command extracts info from the .lof file
% and create the .plfN files (.plf -> .G on MS-DOS)
\def\@dopartlof#1{{%
  \makeatletter
  \setcounter{ptc}{0} % START VALUE
  \PLF@next#1.lof\relax\\}\setcounter{ptc}{0}} %23: raz
% this command extracts info from the .lot file
% and create the .pltN files (.plt -> .U on MS-DOS)
\def\@dopartlot#1{{%
  \setcounter{ptc}{0} % START VALUE
  \makeatletter
  \PLT@next#1.lot\relax\\}\setcounter{ptc}{0}} %23: raz

\def\doparttoc{\@ifnextchar[{\doparttoc@}{\doparttoc@[l]}}
\def\dopartlof{\@ifnextchar[{\dopartlof@}{\dopartlof@[l]}}
\def\dopartlot{\@ifnextchar[{\dopartlot@}{\dopartlot@[l]}}

\def\doparttoc@[#1]{%
\if #1e\let\df@ptitc\e@pti%
\else\if #1n\let\df@ptitc\n@pti%
\else\if #1c\let\df@ptitc\c@pti%
\else\if #1l\let\df@ptitc\l@pti%
\else\if #1r\let\df@ptitc\r@pti%
\fi\fi\fi\fi\fi%
\@@doparttoc}

\def\dopartlof@[#1]{%
\if #1e\let\df@ptilf\e@pti%
\else\if #1n\let\df@ptilf\n@pti%
\else\if #1c\let\df@ptilf\c@pti%
\else\if #1l\let\df@ptilf\l@pti%
\else\if #1r\let\df@ptilf\r@pti%
\fi\fi\fi\fi\fi%
\@@dopartlof}

\def\dopartlot@[#1]{%
\if #1e\let\df@ptilt\e@pti%
\else\if #1n\let\df@ptilt\n@pti%
\else\if #1c\let\df@ptilt\c@pti%
\else\if #1l\let\df@ptilt\l@pti%
\else\if #1r\let\df@ptilt\r@pti%
\fi\fi\fi\fi\fi%
\@@dopartlot}

\def\@@doparttoc{\@doparttoc{\jobname}\immediate\closeout\tf@mtc}
\def\@@dopartlof{\@dopartlof{\jobname}\immediate\closeout\tf@mtc}
\def\@@dopartlot{\@dopartlot{\jobname}\immediate\closeout\tf@mtc}

\def\PTC@next#1\relax#2\\{%
  \edef\PTC@list{#2}%
  \PTC@loop{#1}}
\def\PTC@toc{%
  \ifx\PTC@list\@empty\else\expandafter\PTC@explist\fi}

\def\PTC@contentsline#1#2#3#4{% %%HO/DV: 4 instead of 3 parameters
  \expandafter\ifx\csname #1\endcsname\part
    \stepcounter{ptc}% % the ptc counter simulates the part counter
    \if@longextensions%
      \typeout{Writing\space\jobname.ptc\theptc}%     % UNIX
      \def\ptcname{\jobname.ptc\theptc}%              % UNIX
    \else
      \typeout{Writing\space\jobname.P\theptc}%       % MS-DOS
      \def\ptcname{\jobname.P\theptc}%                % MS-DOS
    \fi
    \immediate\closeout\tf@mtc % close current .ptcN .ptc->.P on MS-DOS
    \immediate\openout\tf@mtc=\ptcname % open next .ptcN (.ptc->.P if MS-DOS)
  \fi
%%%%%%%%%%%%%%%%%%%%%%
% v28c: starpart added
%%%%%%%%%%%%%%%%%%%%%%
  \expandafter\ifx\csname #1\endcsname\starpart\relax
    \stepcounter{ptc}% % the ptc counter simulates the part counter
    \if@longextensions%
      \typeout{Writing\space\jobname.ptc\theptc}%     % UNIX
      \def\ptcname{\jobname.ptc\theptc}%              % UNIX
    \else
      \typeout{Writing\space\jobname.P\theptc}%       % MS-DOS
      \def\ptcname{\jobname.P\theptc}%                % MS-DOS
    \fi
    \immediate\closeout\tf@mtc % close current .ptcN .ptc->.P on MS-DOS
    \immediate\openout\tf@mtc=\ptcname % open next .ptcN (.ptc->.P if MS-DOS)
  \fi
%%%%%%%%%%%%%%%%%%%%%%
  \mtc@toks{\noexpand\leavevmode #2}%
% extracts and writes info for chapters, sections, etc.
  \expandafter\ifx\csname #1\endcsname\chapter
    \MTC@WriteContentsline{#1}{ptcC}{#3}{#4}%
  \fi
%19990316
  \expandafter\ifx\csname #1\endcsname\pchapter
    \MTC@WriteContentsline{#1}{ptcC}{#3}{#4}%
  \fi
  \expandafter\ifx\csname #1\endcsname\section
    \MTC@WriteContentsline{#1}{ptcS}{#3}{#4}%
  \fi
  \expandafter\ifx\csname #1\endcsname\coffee
    \MTC@WriteCoffeeline{#1}{#3}%
  \fi
  \expandafter\ifx\csname #1\endcsname\subsection
    \MTC@WriteContentsline{#1}{ptcSS}{#3}{#4}%
  \fi
  \expandafter\ifx\csname #1\endcsname\subsubsection
    \MTC@WriteContentsline{#1}{ptcSSS}{#3}{#4}%
  \fi
  \expandafter\ifx\csname #1\endcsname\paragraph
    \MTC@WriteContentsline{#1}{ptcP}{#3}{#4}%
  \fi
  \expandafter\ifx\csname #1\endcsname\subparagraph
    \MTC@WriteContentsline{#1}{ptcSP}{#3}{#4}%
  \fi
% Added v25: \starchapter & co.
% extracts and writes info for chapters, sections, etc.
% v28a 960123
  \expandafter\ifx\csname #1\endcsname\starchapter
%%HO: the following line should be disabled:
%%    \stepcounter{mtc}% % the mtc counter simulates the chapter counter
    \MTC@WriteContentsline{#1}{ptcC}{#3}{#4}%
  \fi
  \expandafter\ifx\csname #1\endcsname\starsection
    \MTC@WriteContentsline{#1}{ptcS}{#3}{#4}%
  \fi
  \expandafter\ifx\csname #1\endcsname\starsubsection
    \MTC@WriteContentsline{#1}{ptcSS}{#3}{#4}%
  \fi
  \expandafter\ifx\csname #1\endcsname\starsubsubsection
    \MTC@WriteContentsline{#1}{ptcSSS}{#3}{#4}%
  \fi
  \expandafter\ifx\csname #1\endcsname\starparagraph
    \MTC@WriteContentsline{#1}{ptcP}{#3}{#4}%
  \fi
  \expandafter\ifx\csname #1\endcsname\starsubparagraph
    \MTC@WriteContentsline{#1}{ptcSP}{#3}{#4}%
  \fi
}

\def\PTC@explist{\expandafter\PTC@next\PTC@list\\}
\def\PTC@loop#1{\openin\@inputcheck#1\relax
  \ifeof\@inputcheck
    \typeout{^^JNo file #1^^JPARTTOCS NOT PREPARED.^^J}%
    \expandafter\PTC@toc
  \else
    \typeout{PREPARING PARTTOCS FROM #1}%
    \expandafter\PTC@read\fi}
\def\PTC@read{%
  \read\@inputcheck to\PTC@line
  \expandafter\PTC@test\PTC@line.....\PTC@% %%HO: . added
  }%
\long\def\PTC@test#1#2#3#4#5#6\PTC@{% %%HO: #6 added
  \ifx#1\contentsline
    \let\mtc@string\string
    \PTC@contentsline{#2}{#3}{#4}{#5}%
    %%HO/DV: 4 instead of 3 parameters
    \let\mtc@string\relax
  \else\ifx#1\@input
     \edef\PTC@list{\PTC@list#2\relax}%
  \else\ifx#1\partend % \part* closes .ptcN (.ptc->.P on MS-DOS)
     \immediate\closeout\tf@mtc
     \immediate\openout\tf@mtc=\jobname.bmt % and opens a scratch file
  \else\ifx#1\partbegin
     \addtocounter{ptc}{-1}% % \part* has done a parasite increment
  \fi\fi\fi\fi
  \ifeof\@inputcheck\expandafter\PTC@toc
  \else\expandafter\PTC@read\fi}%

\def\PLF@next#1\relax#2\\{%
  \edef\PLF@list{#2}%
  \PLF@loop{#1}}
\def\PLF@lof{%
  \ifx\PLF@list\@empty\else\expandafter\PLF@explist\fi}

\def\PLF@contentsline#1#2#3#4{% %%HO: #4 added
  \expandafter\ifx\csname #1\endcsname\xpart
    \stepcounter{ptc}% % the ptc counter simulates the part counter
    \if@longextensions%
      \typeout{Writing\space\jobname.plf\theptc}%     % UNIX
      \def\plfname{\jobname.plf\theptc}%              % UNIX
    \else
      \typeout{Writing\space\jobname.G\theptc}%       % MS-DOS
      \def\plfname{\jobname.G\theptc}%                % MS-DOS
    \fi
    \immediate\closeout\tf@mtc % close current .plfN .plf->.G on MS-DOS
    \immediate\openout\tf@mtc=\plfname % open next .plfN (.plf->.G if MS-DOS)
  \fi
  \expandafter\ifx\csname #1\endcsname\ypart
    \stepcounter{ptc}% % the ptc counter simulates the part counter
    \if@longextensions%
      \typeout{Writing\space\jobname.plf\theptc}%     % UNIX
      \def\plfname{\jobname.plf\theptc}%              % UNIX
    \else
      \typeout{Writing\space\jobname.G\theptc}%       % MS-DOS
      \def\plfname{\jobname.G\theptc}%                % MS-DOS
    \fi
    \immediate\closeout\tf@mtc % close current .plfN .plf->.G on MS-DOS
    \immediate\openout\tf@mtc=\plfname % open next .plfN (.plf->.G if MS-DOS)
  \fi
% extracts and writes info for sections, etc.
  \expandafter\ifx\csname #1\endcsname\figure
    \mtc@toks{\noexpand\leavevmode#2}%
    \MTC@WriteContentsline{#1}{plf}{#3}{#4}%
  \fi
}

\def\PLF@explist{\expandafter\PLF@next\PLF@list\\}
\def\PLF@loop#1{\openin\@inputcheck#1\relax
  \ifeof\@inputcheck
    \typeout{^^JNo file #1^^JPARTLOFS NOT PREPARED.^^J}%
    \expandafter\PLF@lof
  \else
    \typeout{PREPARING PARTLOFS FROM #1}%
    \expandafter\PLF@read\fi}
\def\PLF@read{%
  \read\@inputcheck to\PLF@line
  \expandafter\PLF@test\PLF@line.....\PLF@% %%HO: . added
  }%
\long\def\PLF@test#1#2#3#4#5#6\PLF@{% %%HO: #6 added
  \ifx#1\contentsline
    \let\mtc@string\string
    \PLF@contentsline{#2}{#3}{#4}{#5}% %%HO: #4 added
    \let\mtc@string\relax
  \else\ifx#1\@input
     \edef\PLF@list{\PLF@list#2\relax}%
  \else\ifx#1\partend % \part* closes .plfN (.plf->.G on MS-DOS)
     \immediate\closeout\tf@mtc
     \immediate\openout\tf@mtc=\jobname.bmt % and opens a scratch file
  \else\ifx#1\partbegin
     \addtocounter{ptc}{-1}% % \part* has done a parasite increment
  \fi\fi\fi\fi
  \ifeof\@inputcheck\expandafter\PLF@lof
  \else\expandafter\PLF@read\fi}%

\def\PLT@next#1\relax#2\\{%
  \edef\PLT@list{#2}%
  \PLT@loop{#1}}
\def\PLT@lot{%
  \ifx\PLT@list\@empty\else\expandafter\PLT@explist\fi}

\def\PLT@contentsline#1#2#3#4{% %%HO: #4 added
  \expandafter\ifx\csname #1\endcsname\xpart
    \stepcounter{ptc}% % the ptc counter simulates the part counter
    \if@longextensions%
      \typeout{Writing\space\jobname.plt\theptc}%     % UNIX
      \def\pltname{\jobname.plt\theptc}%              % UNIX
    \else
      \typeout{Writing\space\jobname.U\theptc}%       % MS-DOS
      \def\pltname{\jobname.U\theptc}%                % MS-DOS
    \fi
    \immediate\closeout\tf@mtc % close current .pltN .plt->.U on MS-DOS
    \immediate\openout\tf@mtc=\pltname % open next .pltN (.plt->.U if MS-DOS)
  \fi
  \expandafter\ifx\csname #1\endcsname\ypart
    \stepcounter{ptc}% % the ptc counter simulates the part counter
    \if@longextensions%
      \typeout{Writing\space\jobname.plt\theptc}%     % UNIX
      \def\pltname{\jobname.plt\theptc}%              % UNIX
    \else
      \typeout{Writing\space\jobname.U\theptc}%       % MS-DOS
      \def\pltname{\jobname.U\theptc}%                % MS-DOS
    \fi
    \immediate\closeout\tf@mtc % close current .pltN .plt->.U on MS-DOS
    \immediate\openout\tf@mtc=\pltname % open next .pltN (.plt->.U if MS-DOS)
  \fi
% extracts and writes info for chapters, sections, etc.
  \expandafter\ifx\csname #1\endcsname\table
    \mtc@toks{\noexpand\leavevmode#2}%
    \MTC@WriteContentsline{#1}{plt}{#3}{#4}%
  \fi
}

\def\PLT@explist{\expandafter\PLT@next\PLT@list\\}
\def\PLT@loop#1{\openin\@inputcheck#1\relax
  \ifeof\@inputcheck
    \typeout{^^JNo file #1^^JPARTLOTS NOT PREPARED.^^J}%
    \expandafter\PLT@lot
  \else
    \typeout{PREPARING PARTLOTS FROM #1}%
    \expandafter\PLT@read\fi}
\def\PLT@read{%
  \read\@inputcheck to\PLT@line
  \expandafter\PLT@test\PLT@line.....\PLT@% %%HO: . added
  }%
\long\def\PLT@test#1#2#3#4#5#6\PLT@{% %%HO: #6 added
  \ifx#1\contentsline
    \let\mtc@string\string
    \PLT@contentsline{#2}{#3}{#4}{#5}% %%HO: #4 added
    \let\mtc@string\relax
  \else\ifx#1\@input
     \edef\PLT@list{\PLT@list#2\relax}%
  \else\ifx#1\partend % \part* closes .pltN (.plt->.U on MS-DOS)
     \immediate\closeout\tf@mtc
     \immediate\openout\tf@mtc=\jobname.bmt % and opens a scratch file
  \else\ifx#1\partbegin
     \addtocounter{ptc}{-1}% % \part* has done a parasite increment
  \fi\fi\fi\fi
  \ifeof\@inputcheck\expandafter\PLT@lot
  \else\expandafter\PLT@read\fi}%
} % end of part stuff

%%%%%%%%%%%%%%%%%%%%%%%
%%% If \chapter is not defined but \section is, then
%%% the following macros are available (for article-like documents).
%%% Braces are inscrutable!
\@ifundefined{chapter}%
{% CAS \chapter inconnu
\@ifundefined{section}{}{%
\def\firstsectionis#1%
  {\typeout{^^JWARNING*** \string\firstsectionis}%
   \typeout{ is an obsolete command^^J}}
\newcounter{stc}  % counter of secttocs
\setcounter{stc}{0}
\def\adjuststc{\stepcounter{stc}}  %32
\newcounter{secttocdepth} % analog to tocdepth, but for secttocs
\setcounter{secttocdepth}{2}

% rule before/after secttoc/sectlof/sectlot
\def\stc@rule{\rule[3\p@]{\columnwidth}{.4\p@}\vspave*{2.6\p@}} % the \hrule is .4pt high  %kern->vspace* v39-2004/09/09

\newlength\stcindent % indentation (left/right) of secttocs
\stcindent=24\p@      % defaut value
%#v39: NFSS fonts
\def\stcfont{\small\rmfamily\upshape\mdseries}    % font for the secttoc
\def\stcSSfont{\small\rmfamily\upshape\bfseries}  % font for the secttoc (subsections)
\let\stcSSSfont\stcfont    % font for the secttoc (subsubsections)
\let\stcPfont\stcfont      % font for the secttoc (paragraphs)
\let\stcSPfont\stcfont     % font for the secttoc (subparagraphs)
\let\slffont\stcfont       % font for the sectlof (figures)
\let\sltfont\stcfont       % font for the sectlot (tables)
\def\stifont{\large\rmfamily\upshape\bfseries}    % font for titles

% Centering, flushleft, flushright or empty titles.
\def\c@sti#1{\null\hfill #1\hfill\null}
\def\l@sti#1{\null #1\hfill\null}
\def\r@sti#1{\null\hfill #1\null}
%\def\e@sti#1{\relax}
%\def\n@sti#1{\relax}
% v36-2002/02/11 avoid an ugly blank space (from FMi)
\def\e@sti#1{\vspace{-\baselineskip}} % v36-2002/02/11
\def\n@sti#1{\vspace{-\baselineskip}} % v36-2002/02/11

% Default: titles on left
\let\do@stitc\l@sti
\let\df@stitc\l@sti
\let\do@stilf\l@sti
\let\df@stilf\l@sti
\let\do@stilt\l@sti
\let\df@stilt\l@sti

\def\stc@verse{\let\\=\@centercr
  \list{}{\itemsep\z@\itemindent \z@\listparindent \itemindent
          \leftmargin\stcindent
          \rightmargin\leftmargin}\item[]}
\def\endstc@verse{\nopagebreak[4]\endlist}

% this command must be used after \section
% if you need a secttoc (no automatic secttoc)
\def\secttoc{\@ifnextchar[{\secttoc@}{\secttoc@[d]}}

\def\secttoc@[#1]{%
\if@longextensions%
\def\@tocfile{stc\thestc}%  % UNIX
\else
\def\@tocfile{S\thestc}%    % MS-DOS
\fi
        \mtc@CkFile{\jobname.\@tocfile}               % v35 2001/01/09
        \if@mtc@FE                                    % v35 2001/01/09
        \typeout{\jobname.\@tocfile\space is empty}   % v35 2001/01/09
        \else                                         % v35 2001/01/09
        \relax\begin{samepage}% we begin a local group here, using samepage
        \if #1e\let\do@stitc\e@sti
        \else\if #1n\let\do@stitc\n@sti
        \else\if #1c\let\do@stitc\c@sti
        \else\if #1l\let\do@stitc\l@sti
        \else\if #1r\let\do@stitc\r@sti
        \else\if #1d\let\do@stitc\df@stitc
        \fi\fi\fi\fi\fi\fi
%-v36-2002/02/15 If \stctitle is empty, acts like \secttoc[e]
%-v36-2002/03/15 We test the emptyness of \stctitle
%	\mtc@ifmtarg{\stctitle}{\let\do@stitc\e@sti\relax}{} %-v36-2002/03/15
        \mtc@CkStr{\stctitle}\if@mtc@FE \let\do@stitc\e@sti\relax\fi %v38 2003/01/30
        \raggedright % added #14
        \parskip=\z@%
        \reset@font\stcfont%
        \parindent=\z@%
        \nopagebreak[4]%
        \kern-0.8\baselineskip\nopagebreak[4]%
        \par\noindent
        \nopagebreak[4]%
        \ifx\stc@rule\relax
        \begin{tabular}{@{}p{\columnwidth}@{}}
        \reset@font\stifont\do@stitc{\mtc@v\stctitle}\\
        \end{tabular}%
	\else
        \begin{tabular}{@{}p{\columnwidth}@{}}
        \reset@font\stifont\do@stitc{\mtc@v\stctitle}\\\hline
        \end{tabular}%
	\fi
        \nopagebreak[4]\null\leavevmode\mtc@zrule\\\mtc@BBR%
        \leftmargin\stcindent
        \rightmargin\stcindent
        \itemindent=\z@\labelwidth=\z@%
        \labelsep=\z@\listparindent=\z@%
        \begin{stc@verse}\c@tocdepth=\c@secttocdepth%
        \leavevmode\\\mtc@BBR% this blank line is necessary to avoid
                % a wild negative indentation
        \vskip -.5\baselineskip
\begingroup
  \makeatletter
  \@ifundefined{stc@pgno}%
  {\let\@dottedtocline\@undottedtocline}{}
%   \gdef\thestc{\arabic{stc}} %23
  \@fileswfalse\mtc@hook@beforeinputfile\@input{\jobname.\@tocfile}
  % v36-2002/02/11 % adjust space under minitocs
  \vspace{-1ex} \vspace{-\baselineskip} % v36-2002/02/11
  \leavevmode\mtc@strut                 % v36-2002/02/11
  \global\@nobreakfalse\endgroup
        \end{stc@verse}%
        \kern-1.\baselineskip%
%        \kern0.\baselineskip%
        \nopagebreak[4]\stc@rule\null\leavevmode\\%
        \vskip-1.0\baselineskip\mtc@zrule\end{samepage}% %## the \\ is essential
        \par\pagebreak[1]\vspace*{-1ex}\fi}% %\fi v35-2001/01/09
        % some space under the secttoc

% this command must be used after \section
% if you need a sectlof (no automatic sectlof)
\def\sectlof{\@ifnextchar[{\sectlof@}{\sectlof@[d]}}

\def\sectlof@[#1]{%
\if@longextensions%
\def\@tocfile{slf\thestc}%  % UNIX
\else
\def\@tocfile{H\thestc}%    % MS-DOS
\fi
        \mtc@CkFile{\jobname.\@tocfile}               % v35 2001/01/09
        \if@mtc@FE                                    % v35 2001/01/09
        \typeout{\jobname.\@tocfile\space is empty}   % v35 2001/01/09
        \else                                         % v35 2001/01/09
        \relax\begin{samepage}% we begin a local group here, using samepage
        \if #1e\let\do@stilf\e@sti
        \else\if #1n\let\do@stilf\n@sti
        \else\if #1c\let\do@stilf\c@sti
        \else\if #1l\let\do@stilf\l@sti
        \else\if #1r\let\do@stilf\r@sti
        \else\if #1d\let\do@stilf\df@stilf
        \fi\fi\fi\fi\fi\fi
%-v36-2002/02/15 If \slftitle is empty, acts like \sectlof[e]
%-v36-2002/03/15 We test the emptyness of \slftitle
%	\mtc@ifmtarg{\slftitle}{\let\do@stilf\e@sti\relax}{} %-v36-2002/03/15
        \mtc@CkStr{\slftitle}\if@mtc@FE \let\do@stilf\e@sti\relax\fi %v38 2003/01/30
        \raggedright % added #14
        \parskip=\z@%
        \reset@font\slffont%
        \parindent=\z@%
        \nopagebreak[4]%
        \kern-0.8\baselineskip\nopagebreak[4]%
        \par\noindent
        \ifx\stc@rule\relax % correction 07Nov94 v23
        \begin{tabular}{@{}p{\columnwidth}@{}}
        \reset@font\stifont\do@stilf{\mtc@v\slftitle}\\
        \end{tabular}%
	\else
        \begin{tabular}{@{}p{\columnwidth}@{}}
        \reset@font\stifont\do@stilf{\mtc@v\slftitle}\\\hline
        \end{tabular}%
	\fi
        \nopagebreak[4]\null\leavevmode\mtc@zrule\\\mtc@BBR%
        \leftmargin\stcindent
        \rightmargin\stcindent
        \itemindent=\z@\labelwidth=\z@%
        \labelsep=\z@\listparindent=\z@%
        % depth does not matter for sectlof
        \begin{stc@verse}%\c@tocdepth=\c@secttocdepth%
        \leavevmode\\\mtc@BBR% this blank line is necessary to avoid
                % a wild negative indentation
        \vskip -.5\baselineskip
\begingroup
  \makeatletter
  \@ifundefined{slf@pgno}%
  {\let\@dottedtocline\@undottedtocline}{}
%   \gdef\thestc{\arabic{stc}} %23
  \@fileswfalse\mtc@hook@beforeinputfile\@input{\jobname.\@tocfile}
  \global\@nobreakfalse\endgroup
        \end{stc@verse}%
        \kern-1.\baselineskip%
%        \kern0.\baselineskip%
        \nopagebreak[4]\stc@rule\null\leavevmode\\%
        \vskip-1.0\baselineskip\mtc@zrule\end{samepage}% %## the \\ is essential
        \par\pagebreak[1]\vspace*{-1ex}\fi}% %\fi v35-2001/01/09
        % some space under the secttoc

% Added in version #13
% this command must be used after \section
% if you need a sectlot (no automatic sectlot)
\def\sectlot{\@ifnextchar[{\sectlot@}{\sectlot@[d]}}

\def\sectlot@[#1]{%
\if@longextensions%
\def\@tocfile{slt\thestc}%  % UNIX
\else
\def\@tocfile{I\thestc}%    % MS-DOS
\fi
        \mtc@CkFile{\jobname.\@tocfile}               % v35 2001/01/09
        \if@mtc@FE                                    % v35 2001/01/09
        \typeout{\jobname.\@tocfile\space is empty}   % v35 2001/01/09
        \else                                         % v35 2001/01/09
        \relax\begin{samepage}% we begin a local group here, using samepage
        \if #1e\let\do@stilt\e@sti
        \else\if #1n\let\do@stilt\n@sti
        \else\if #1c\let\do@stilt\c@sti
        \else\if #1l\let\do@stilt\l@sti
        \else\if #1r\let\do@stilt\r@sti
        \else\if #1d\let\do@stilt\df@stilt
        \fi\fi\fi\fi\fi\fi
%-v36-2002/02/15 If \slttitle is empty, acts like \sectlot[e]
%-v36-2002/03/15 We test the emptyness of \slttitle
%	\mtc@ifmtarg{\slttitle}{\let\do@stilt\e@sti\relax}{} %-v36-2002/03/15
        \mtc@CkStr{\slttitle}\if@mtc@FE \let\do@stilt\e@sti\relax\fi %v38 2003/01/30
        \raggedright % added #14
        \parskip=\z@%
        \reset@font\sltfont%
        \parindent=\z@%
        \nopagebreak[4]%
        \kern-0.8\baselineskip\nopagebreak[4]%
        \par\noindent
        \ifx\stc@rule\relax % correction 07Nov94 v23
        \begin{tabular}{@{}p{\columnwidth}@{}}
        \reset@font\stifont\do@stilt{\mtc@v\slttitle}\\
        \end{tabular}%
	\else
        \begin{tabular}{@{}p{\columnwidth}@{}}
        \reset@font\stifont\do@stilt{\mtc@v\slttitle}\\\hline
        \end{tabular}%
	\fi
        \nopagebreak[4]\null\leavevmode\mtc@zrule\\\mtc@BBR%
        \leftmargin\stcindent
        \rightmargin\stcindent
        \itemindent=\z@\labelwidth=\z@%
        \labelsep=\z@\listparindent=\z@%
        % depth does not matter for sectlot
        \begin{stc@verse}%\c@tocdepth=\c@secttocdepth%
        \leavevmode\\\mtc@BBR% this blank line is necessary to avoid
                % a wild negative indentation
        \vskip -.5\baselineskip
\begingroup
  \makeatletter
  \@ifundefined{slt@pgno}%
  {\let\@dottedtocline\@undottedtocline}{}
   \gdef\thestc{\arabic{stc}} %23
  \@fileswfalse\mtc@hook@beforeinputfile\@input{\jobname.\@tocfile}
  \global\@nobreakfalse\endgroup
        \end{stc@verse}%
        \kern-1.\baselineskip%
%        \kern0.\baselineskip%
        \nopagebreak[4]\stc@rule\null\leavevmode\\%
        \vskip-1.0\baselineskip\mtc@zrule\end{samepage}% %## the \\ is essential
        \par\pagebreak[1]\vspace*{-1ex}\fi}% %\fi v35-2001/01/09
        % some space under the secttoc

% I use a depth of 10000 to inhibit the printing of
% that contentsline.
\def\l@xsect{\@dottedtocline{\@M}{1.0em}{2.3em}}
\def\l@schapter{\@dottedtocline{1}{1.0em}{2.3em}}

\def\xsect{xsect}
\def\schapter{schapter}

%\typeout{DEBUG: altering section ****************}
\let\sv@sect\@sect
\gdef\@sect#1#2#3#4#5#6[#7]#8{%
\ifnum #2=1
\addcontentsline{lof}{xsect}{#7}%
\addcontentsline{lot}{xsect}{#7}%
\fi
\sv@sect{#1}{#2}{#3}{#4}{#4}{#5}{#6}[{#7}]{#8}}

\def\@sect#1#2#3#4#5#6[#7]#8{
\expandafter
\ifx\csname #1\endcsname\section\relax % ADDED
\addcontentsline{lof}{xsect}{#7}%        ADDED
\addcontentsline{lot}{xsect}{#7}%        ADDED
\fi                             %        ADDED
\ifx\csname #1\endcsname\starsection\relax % ADDED v25
\addcontentsline{lof}{xsect}{#7}%        ADDED v25
\addcontentsline{lot}{xsect}{#7}%        ADDED v25
\fi                             %        ADDED v25
\ifnum #2>\c@secnumdepth
     \let\@svsec\@empty\else
     \refstepcounter{#1}\edef\@svsec{\csname the#1\endcsname\hskip 1em}\fi
     \@tempskipa #5\relax
      \ifdim \@tempskipa>\z@
        \begingroup #6\relax
          \@hangfrom{\hskip #3\relax\@svsec}{\interlinepenalty \@M #8\par}%
        \endgroup
       \csname #1mark\endcsname{#7}\addcontentsline
         {toc}{#1}{\ifnum #2>\c@secnumdepth \else
                      \protect\numberline{\csname the#1\endcsname}\fi
                    #7}\else
        \def\@svsechd{#6\hskip #3\relax  %% \relax added 2 May 90
                   \@svsec #8\csname #1mark\endcsname
                      {#7}\addcontentsline
                           {toc}{#1}{\ifnum #2>\c@secnumdepth \else
                             \protect\numberline{\csname the#1\endcsname}\fi
                       #7}}\fi
     \@xsect{#5}}
%
% tricky code to deal with \section*
\let\stc@ssect\@ssect
\def\@ssect{%
\addtocontents{toc}{\protect\sectend}\stc@ssect%
}
\def\@ssect{%
\addtocontents{toc}{\protect\sectbegin}\stc@ssect%
}
\let\sectend\relax
\let\sectbegin\relax
\let\appendixmtc\relax

% this command extracts info from the .toc file
% and create the .stcN files (.stc -> .S on MS-DOS)
\def\@dosecttoc#1{{%
  \makeatletter
  \setcounter{stc}{0} % START VALUE
  \STC@next#1.toc\relax\\}\setcounter{stc}{0}} %23: raz

% this command extracts info from the .lof file
% and create the .slfN files (.slf -> .H on MS-DOS)
\def\@dosectlof#1{{%
  \makeatletter
  \setcounter{stc}{0} % START VALUE
  \SLF@next#1.lof\relax\\}\setcounter{stc}{0}} %23: raz

% this command extracts info from the .lot file
% and create the .sltN files (.slt -> .V on MS-DOS)
\def\@dosectlot#1{{%
  \makeatletter
  \setcounter{stc}{0} % START VALUE
  \SLT@next#1.lot\relax\\}\setcounter{stc}{0}} %23: raz

\def\dosecttoc{\@ifnextchar[{\dosecttoc@}{\dosecttoc@[l]}}
\def\dosectlof{\@ifnextchar[{\dosectlof@}{\dosectlof@[l]}}
\def\dosectlot{\@ifnextchar[{\dosectlot@}{\dosectlot@[l]}}

\def\dosecttoc@[#1]{%
\if #1e\let\df@stitc\e@sti%
\else\if #1n\let\df@stitc\n@sti%
\else\if #1c\let\df@stitc\c@sti%
\else\if #1l\let\df@stitc\l@sti%
\else\if #1r\let\df@stitc\r@sti%
\fi\fi\fi\fi\fi%
\@@dosecttoc}

\def\dosectlof@[#1]{%
\if #1e\let\df@stilf\e@sti%
\else\if #1n\let\df@stilf\n@sti%
\else\if #1c\let\df@stilf\c@sti%
\else\if #1l\let\df@stilf\l@sti%
\else\if #1r\let\df@stilf\r@sti%
\fi\fi\fi\fi\fi%
\@@dosectlof}

\def\dosectlot@[#1]{%
\if #1e\let\df@stilt\e@sti%
\else\if #1n\let\df@stilt\n@sti%
\else\if #1c\let\df@stilt\c@sti%
\else\if #1l\let\df@stilt\l@sti%
\else\if #1r\let\df@stilt\r@sti%
\fi\fi\fi\fi\fi%
\@@dosectlot}

\def\@@dosecttoc{\@dosecttoc{\jobname}\immediate\closeout\tf@mtc}
\def\@@dosectlof{\@dosectlof{\jobname}\immediate\closeout\tf@mtc}
\def\@@dosectlot{\@dosectlot{\jobname}\immediate\closeout\tf@mtc}

\def\STC@next#1\relax#2\\{%
  \edef\STC@list{#2}%
  \STC@loop{#1}}
\def\STC@toc{%
  \ifx\STC@list\@empty\else\expandafter\STC@explist\fi}

\def\STC@contentsline#1#2#3#4{% %%HO: #4 added
  \gdef\thestc{\arabic{stc}}% %%HO: space removed
  \expandafter\ifx\csname #1\endcsname\section
    \stepcounter{stc}% % the stc counter simulates the section counter
    \def\thestc{\arabic{stc}} %% HO: removed
    \if@longextensions%
      \typeout{Writing\space\jobname.stc\thestc}%     % UNIX
      \def\stcname{\jobname.stc\thestc}%              % UNIX
    \else
      \typeout{Writing\space\jobname.S\thestc}%       % MS-DOS
      \def\stcname{\jobname.S\thestc}%                % MS-DOS
    \fi
    \immediate\closeout\tf@mtc % close current .stcN .stc->.S on MS-DOS
    \immediate\openout\tf@mtc=\stcname % open next .stcN (.stc->.S if MS-DOS)
  \fi
  %%%
  \mtc@toks{\noexpand\leavevmode #2}%
% COFFEE
  \expandafter\ifx\csname #1\endcsname\coffee
    \MTC@WriteCoffeeline{#1}{#3}%
  \fi
  \expandafter\ifx\csname #1\endcsname\subsection
    \MTC@WriteContentsline{#1}{stcSS}{#3}{#4}%
  \fi
  \expandafter\ifx\csname #1\endcsname\subsubsection
    \MTC@WriteContentsline{#1}{stcSSS}{#3}{#4}%
  \fi
  \expandafter\ifx\csname #1\endcsname\paragraph
    \MTC@WriteContentsline{#1}{stcP}{#3}{#4}%
  \fi
  \expandafter\ifx\csname #1\endcsname\subparagraph
    \MTC@WriteContentsline{#1}{stcSP}{#3}{#4}%
  \fi
% Added v25: \starsection and co.
  \ifx\csname #1\endcsname\starsection
    \stepcounter{stc}% % the stc counter simulates the section counter
    \gdef\thestc{\arabic{stc}}
    \if@longextensions%
      \typeout{Writing\space\jobname.stc\thestc}%     % UNIX
      \def\stcname{\jobname.stc\thestc}%              % UNIX
    \else
      \typeout{Writing\space\jobname.S\thestc}%       % MS-DOS
      \def\stcname{\jobname.S\thestc}%                % MS-DOS
    \fi
    \immediate\closeout\tf@mtc % close current .stcN .stc->.S on MS-DOS
    \immediate\openout\tf@mtc=\stcname % open next .stcN (.stc->.S if MS-DOS)
  \fi
  \expandafter\ifx\csname #1\endcsname\starsubsection
    \MTC@WriteContentsline{#1}{stcSS}{#3}{#4}%
  \fi
  \expandafter\ifx\csname #1\endcsname\starsubsubsection
    \MTC@WriteContentsline{#1}{stcSSS}{#3}{#4}%
  \fi
  \expandafter\ifx\csname #1\endcsname\starparagraph
    \MTC@WriteContentsline{#1}{stcP}{#3}{#4}%
  \fi
  \expandafter\ifx\csname #1\endcsname\starsubparagraph
    \MTC@WriteContentsline{#1}{stcSP}{#3}{#4}%
  \fi
}

\def\STC@explist{\expandafter\STC@next\STC@list\\}
\def\STC@loop#1{\openin\@inputcheck#1\relax
  \ifeof\@inputcheck
    \typeout{^^JNo file #1^^JSECTTOCS NOT PREPARED.^^J}%
    \expandafter\STC@toc
  \else
    \typeout{PREPARING SECTTOCS FROM #1}%
    \expandafter\STC@read\fi}
\def\STC@read{%
  \read\@inputcheck to\STC@line
  \expandafter\STC@test\STC@line.....\STC@% %%HO: . added
  }%
\long\def\STC@test#1#2#3#4#5#6\STC@{% %%HO: #6 added
  \ifx#1\contentsline
    \let\mtc@string\string
    \STC@contentsline{#2}{#3}{#4}{#5}% %%HO: #4 added
    \let\mtc@string\relax
  \else\ifx#1\@input
     \edef\STC@list{\STC@list#2\relax}%
  \else\ifx#1\sectend % \section* closes .stcN (.stc->.S on MS-DOS)
     \immediate\closeout\tf@mtc
     \immediate\openout\tf@mtc=\jobname.bmt % and opens a scratch file
  \else\ifx#1\sectbegin
     \addtocounter{stc}{-1}% % \section* has done a parasite increment
  \fi\fi\fi\fi
  \ifeof\@inputcheck\expandafter\STC@toc
  \else\expandafter\STC@read\fi}%

\def\SLF@next#1\relax#2\\{%
  \edef\SLF@list{#2}%
  \SLF@loop{#1}}
\def\SLF@lof{%
  \ifx\SLF@list\@empty\else\expandafter\SLF@explist\fi}

\def\SLF@contentsline#1#2#3#4{% %%HO: #4 added
  \gdef\thestc{\arabic{stc}}% %%HO: space removed
  \expandafter\ifx\csname #1\endcsname\xsect
    \stepcounter{stc}% % the stc counter simulates the section counter
%%    \gdef\thestc{\arabic{stc}} %%HO: removed
    \if@longextensions%
      \typeout{Writing\space\jobname.slf\thestc}%     % UNIX
      \def\slfname{\jobname.slf\thestc}%              % UNIX
    \else
      \typeout{Writing\space\jobname.G\thestc}%       % MS-DOS
      \def\slfname{\jobname.H\thestc}%                % MS-DOS
    \fi
    \immediate\closeout\tf@mtc % close current .slfN .slf->.H on MS-DOS
%    \stepcounter{stc}% % the stc counter simulates the section counter
    \immediate\openout\tf@mtc=\slfname % open next .slfN (.slf->.H if MS-DOS)
  \fi
  \mtc@toks{\noexpand\leavevmode #2}%
% extracts and writes info for sections, etc.
  \expandafter\ifx\csname #1\endcsname\figure
    \MTC@WriteContentsline{#1}{slf}{#3}{#4}%
  \fi
}

\def\SLF@explist{\expandafter\SLF@next\SLF@list\\}
\def\SLF@loop#1{\openin\@inputcheck#1\relax
  \ifeof\@inputcheck
    \typeout{^^JNo file #1^^JSECTLOFS NOT PREPARED.^^J}%
    \expandafter\SLF@lof
  \else
    \typeout{PREPARING SECTLOFS FROM #1}%
    \expandafter\SLF@read\fi}
\def\SLF@read{%
  \read\@inputcheck to\SLF@line
  \expandafter\SLF@test\SLF@line.....\SLF@% %%HO: . added
  }%
\long\def\SLF@test#1#2#3#4#5#6\SLF@{% %%HO: #6 added
  \ifx#1\contentsline
    \let\mtc@string\string
    \SLF@contentsline{#2}{#3}{#4}{#5}% %%HO: #4 added
    \let\mtc@string\relax
  \else\ifx#1\@input
     \edef\SLF@list{\SLF@list#2\relax}%
  \else\ifx#1\sectend % \section* closes .slfN (.slf->.H on MS-DOS)
     \immediate\closeout\tf@mtc
     \immediate\openout\tf@mtc=\jobname.bmt % and opens a scratch file
  \else\ifx#1\sectbegin
     \addtocounter{stc}{-1}% % \section* has done a parasite increment
  \fi\fi\fi\fi
  \ifeof\@inputcheck\expandafter\SLF@lof
  \else\expandafter\SLF@read\fi}%

\def\SLT@next#1\relax#2\\{%
  \edef\SLT@list{#2}%
  \SLT@loop{#1}}
\def\SLT@lot{%
  \ifx\SLT@list\@empty\else\expandafter\SLT@explist\fi}

\def\SLT@contentsline#1#2#3#4{% %%HO: #4 added
  \gdef\thestc{\arabic{stc}}% %%HO: space removed
  \expandafter\ifx\csname #1\endcsname\xsect
    \stepcounter{stc}% % the stc counter simulates the section counter
%%    \gdef\thestc{\arabic{stc}} %%HO: removed
    \if@longextensions%
      \typeout{Writing\space\jobname.slt\thestc}%     % UNIX
      \def\sltname{\jobname.slt\thestc}%              % UNIX %bug mlt->slt
    \else
      \typeout{Writing\space\jobname.V\thestc}%       % MS-DOS
      \def\sltname{\jobname.V\thestc}%                % MS-DOS
    \fi
    \immediate\closeout\tf@mtc % close current .sltN .slt->.V on MS-DOS
%    \stepcounter{stc}% % the stc counter simulates the section counter
    \immediate\openout\tf@mtc=\sltname % open next .sltN (.slt->.V if MS-DOS)
  \fi
  \mtc@toks{\noexpand\leavevmode #2}%
% extracts and writes info for subsections, etc.
  \expandafter\ifx\csname #1\endcsname\table
    \MTC@WriteContentsline{#1}{slt}{#3}{#4}%
  \fi
}

\def\SLT@explist{\expandafter\SLT@next\SLT@list\\}
\def\SLT@loop#1{\openin\@inputcheck#1\relax
  \ifeof\@inputcheck
    \typeout{^^JNo file #1^^JSECTLOTS NOT PREPARED.^^J}%
    \expandafter\SLT@lot
  \else
    \typeout{PREPARING SECTLOTS FROM #1}%
    \expandafter\SLT@read\fi}
\def\SLT@read{%
  \read\@inputcheck to\SLT@line
  \expandafter\SLT@test\SLT@line.....\SLT@% %%HO: . added
  }%
\long\def\SLT@test#1#2#3#4#5#6\SLT@{% %%HO: #6 added
  \ifx#1\contentsline
    \let\mtc@string\string
    \SLT@contentsline{#2}{#3}{#4}{#5}% %%HO: #4 added
    \let\mtc@string\relax
  \else\ifx#1\@input
     \edef\SLT@list{\SLT@list#2\relax}%
  \else\ifx#1\sectend % \section* closes .sltN (.slt->.V on MS-DOS)
     \immediate\closeout\tf@mtc
     \immediate\openout\tf@mtc=\jobname.bmt % and opens a scratch file
  \else\ifx#1\sectbegin
     \addtocounter{stc}{-1}% % \section* has done a parasite increment
  \fi\fi\fi\fi
  \ifeof\@inputcheck\expandafter\SLT@lot
  \else\expandafter\SLT@read\fi}%
}%
}% FIN CAS \chapter inconnu: \secttoc &co. permis
{} % CAS \chapter connu: pas de \secttoc & co.

\@ifundefined{section}{}{\let\l@listof\l@section} %v27
\@ifundefined{chapter}{}{\let\l@listof\l@chapter} %v27
\@ifundefined{part}{}{\let\l@starpart\l@part}
\@ifundefined{chapter}{}{\let\l@starchapter\l@chapter}
\@ifundefined{section}{}{\let\l@starsection\l@section}
\@ifundefined{subsection}{}{\let\l@starsubsection\l@subsection}
\@ifundefined{subsubsection}{}{\let\l@starsubsubsection\l@subsubsection}
\@ifundefined{paragraph}{}{\let\l@starparagraph\l@paragraph}
\@ifundefined{subparagraph}{}{\let\l@starsubparagraph\l@subparagraph}

\def\noptcrule{\let\ptc@rule\relax}
\def\nomtcrule{\let\mtc@rule\relax}
\def\nostcrule{\let\stc@rule\relax}
\def\ptcrule{\def\ptc@rule{\kern-3\p@%
  \hrule width \columnwidth \kern2.6\p@}} % the \hrule is .4pt high
\def\mtcrule{\def\mtc@rule{\kern-3\p@%
  \hrule width \columnwidth \kern2.6\p@}} % the \hrule is .4pt high
\def\stcrule{\def\stc@rule{\kern-3\p@%
  \hrule width \columnwidth \kern2.6\p@}} % the \hrule is .4pt high
\def\ptc@rule{\rule[3\p@]{\columnwidth}{.4\p@}\vspace*{2.6\p@}}
%kern->vspace* v39-2004/09/09
\def\mtc@rule{\rule[3\p@]{\columnwidth}{.4\p@}\vspace*{2.6\p@}}
%kern->vspace* v39-2004/09/09
\def\stc@rule{\rule[3\p@]{\columnwidth}{.4\p@}\vspace*{2.6\p@}}
%kern->vspace* v39-2004/09/09

%v28b
% init counters
\AtBeginDocument{%
\@ifundefined{c@ptc}{}{\setcounter{ptc}{0}}
\@ifundefined{c@mtc}{}{\setcounter{mtc}{0}}
\@ifundefined{c@stc}{}{\setcounter{stc}{0}}}

%%% tight option
\DeclareOption{tight}{\tightmtctrue}
\DeclareOption{loose}{\tightmtcfalse} % default
%%% checkfiles/nocheckfiles option                  % v35 2001/01/09
\DeclareOption{checkfiles}{\@mtc@checkfilestrue}    % v35 2001/01/09
\DeclareOption{nocheckfiles}{\@mtc@checkfilesfalse} % v35 2001/01/09

%%% undotted option
\DeclareOption{undotted}{\undottedmtctrue}
\DeclareOption{dotted}{\undottedmtcfalse} % default

%%% notoccite option
\DeclareOption{notoccite}{\@mtc@notoccite@true}

%%% options for secttocs % v38 2003/01/30
\newif\if@mtc@ss@insection@ \@mtc@ss@insection@false
\@ifundefined{chapter}{%
\@ifundefined{section}{}%
{%
%\typeout{*** option insection available ***}
\DeclareOption{insection}{%
\@mtc@ss@insection@true}%
%\typeout{*** option insection invoked ***}\relax
}}{}

%%%% Language dependent part
\def\mtcselectlanguage#1{%                          % v35 2001/03/09
     \IfFileExists{#1.mld}%
       {\@input{#1.mld}\PackageWarning{minitoc}{#1 language selected.%
         \MessageBreak}}%
        {\PackageError{minitoc}{%
         #1 is not a known language,
         \MessageBreak #1.mld not found.
         \MessageBreak Command ignored}{Press return.%
         \MessageBreak Correct the source using a valid language name.%
         \MessageBreak}}%
}
\DeclareOption{acadian}{\input{french.mld}} %v39
\DeclareOption{acadien}{\input{french.mld}} %v39
\DeclareOption{afrikaan}{\input{afrikaan.mld}} %v28
\DeclareOption{afrikaans}{\input{afrikaan.mld}} %v28
\DeclareOption{american}{\input{english.mld}}
\DeclareOption{arab}{\input{arab.mld}}   %v27
\DeclareOption{arabic}{\input{arab.mld}}   %v27
\DeclareOption{armenian}{\input{armenian.mld}} %v29
\DeclareOption{austrian}{\input{german.mld}}
\DeclareOption{bahasa}{\input{bahasa.mld}} %v28
\DeclareOption{bangla}{\input{bangla.mld}} %v36
\DeclareOption{basque}{\input{basque.mld}} %v30
\DeclareOption{brazil}{\input{brazil.mld}} %v28
\DeclareOption{bicig}{\input{bicig.mld}} %v29
\DeclareOption{breton}{\input{breton.mld}} %v26
\DeclareOption{bulgarian}{\input{bulgarian.mld}} %v35
\DeclareOption{buryat}{\input{buryat.mld}} %v29
\DeclareOption{canadian}{\input{english.mld}} %v39
\DeclareOption{canadien}{\input{french.mld}} %v39
\DeclareOption{castillan}{\input{castillan.mld}} %v40
\DeclareOption{catalan}{\input{catalan.mld}}
\DeclareOption{croatian}{\input{croatian.mld}}
\DeclareOption{czech}{\input{czech.mld}}
\DeclareOption{danish}{\input{danish.mld}}
\DeclareOption{dutch}{\input{dutch.mld}}
\DeclareOption{english}{\input{english.mld}}
\DeclareOption{esperant}{\input{esperant.mld}} %v26
\DeclareOption{esperanto}{\input{esperant.mld}} %v26
\DeclareOption{estonian}{\input{estonian.mld}} %v35
\DeclareOption{ethiopia}{\input{ethiopia.mld}} %v28
\DeclareOption{ethiopian}{\input{ethiopia.mld}} %v28
\DeclareOption{finnish}{\input{finnish.mld}}
\DeclareOption{francais}{\input{french.mld}}
\DeclareOption{french}{\input{french.mld}}
\DeclareOption{frenchb}{\input{french.mld}}
\DeclareOption{frenchle}{\input{french.mld}}
\DeclareOption{frenchpro}{\input{french.mld}}
\DeclareOption{galician}{\input{galician.mld}}
\DeclareOption{german}{\input{german.mld}}
\DeclareOption{germanb}{\input{germanb.mld}} %v26
\DeclareOption{greek}{\input{greek.mld}} %v26
\DeclareOption{hebrew}{\input{hebrew.mld}} %v35
\DeclareOption{hungarian}{\input{magyar.mld}}
\DeclareOption{icelandic}{\input{icelandic.mld}} %v35
\DeclareOption{interlingua}{\input{interlingua.mld}} %v35
\DeclareOption{irish}{\input{irish.mld}} %v26
\DeclareOption{italian}{\input{italian.mld}}
\DeclareOption{japanese}{\input{japanese.mld}} %v40
\DeclareOption{latin}{\input{latin.mld}} %v35
\DeclareOption{lithuanian}{\input{lithuanian.mld}} %v29
\DeclareOption{lsorbian}{\input{lsorbian.mld}} %v26
\DeclareOption{magyar}{\input{magyar.mld}}
\DeclareOption{mongol}{\input{mongol.mld}} %v29
\DeclareOption{naustrian}{\input{ngermanb.mld}} %v39
\DeclareOption{ngerman}{\input{ngermanb.mld}} %v39
\DeclareOption{ngermanb}{\input{ngermanb.mld}} %v30
\DeclareOption{norsk}{\input{norsk.mld}}
\DeclareOption{nynorsk}{\input{nynorsk.mld}} %v25
\DeclareOption{polish}{\input{polish.mld}}
\DeclareOption{portuges}{\input{portuges.mld}}
\DeclareOption{romanian}{\input{romanian.mld}}
%%%%russian not supported \DeclareOption{russian}{\input{russian.mld}}
\DeclareOption{russianb}{\input{russianb.mld}} %v26
\DeclareOption{russianc}{\input{russianc.mld}} %v29
\DeclareOption{samin}{\input{samin.mld}} %v35
\DeclareOption{scottish}{\input{scottish.mld}} %v26
\DeclareOption{serbian}{\input{serbian.mld}} %v30
\DeclareOption{slovak}{\input{slovak.mld}}
\DeclareOption{slovene}{\input{slovene.mld}}
\DeclareOption{spanish}{\input{spanish.mld}}
\DeclareOption{swedish}{\input{swedish.mld}}
\DeclareOption{turkish}{\input{turkish.mld}}
\DeclareOption{ukraineb}{\input{ukraineb.mld}} %v30
\DeclareOption{usorbian}{\input{usorbian.mld}} %v26
\DeclareOption{vietnam}{\input{vietnam.mld}}   %v27
\DeclareOption{vietnamese}{\input{vietnam.mld}}   %v27
\DeclareOption{welsh}{\input{welsh.mld}}   %v30
%%%%%%%%%
\DeclareOption{shortext}{\@longextensionsfalse %v28
\typeout{*** You have forced the use of short extensions ***}}
%%%%%%%%%
%v40 options hints/nohints (default: nohints).
\newif\if@mtc@hints@ \@mtc@hints@false
\newif\if@mtc@hints@w@ \@mtc@hints@w@false
\DeclareOption{hints}{\@mtc@hints@true}
\DeclareOption{nohints}{\@mtc@hints@false}

% %v40 This command detects potential problems.
\newif\if@mtc@hints@given@ \@mtc@hints@given@false
\def\mtc@hints@begindoc{%
\PackageInfo{minitoc}{***** You  requested the hints option *****\@gobble}%
\PackageInfo{minitoc}{***** Some hints are eventually given below *****\@gobble}%
\@ifpackageloaded{appendix}{%
\@mtc@hints@given@true
\PackageInfo{minitoc}{--- The appendix package is loaded. \MessageBreak
See minitoc.pdf for specific precautions\@gobble}}{}%
\@ifpackageloaded{tocbibind}{%
\@mtc@hints@given@true
\PackageInfo{minitoc}{--- The tocbibind package is loaded. \MessageBreak
See minitoc.pdf for specific precautions\@gobble}}{}%
\@ifpackageloaded{tocloft}{%
\@mtc@hints@given@true
\PackageInfo{minitoc}{--- The tocloft package is loaded. \MessageBreak
See minitoc.pdf for specific precautions\@gobble}}{}%
\@ifpackageloaded{titletoc}{%
\@mtc@hints@given@true
\PackageWarning{minitoc}{--- The titletoc package is loaded. \MessageBreak
It is incompatible with the minitoc package\@gobble}}{}%
\@ifpackageloaded{placeins}{%
\if@mtc@ss@insection@
\@ifpackagewith{placeins}{section,below}{}{%
\@mtc@hints@given@true
\PackageWarning{minitoc}{--- The placeins package is loaded without section and below options. \MessageBreak
but minitoc used the insection option which implies them. \MessageBreak
Try to inverse the loading order and use coherent options. \MessageBreak
You may have got a message ! LaTeX Error: Option clash for package placeins\@gobble}%
}%
\fi
}{}%
%MEMOIR
\@ifclassloaded{memoir}{%
\@mtc@hints@given@true
\PackageInfo{minitoc}{--- The memoir class is loaded. \MessageBreak
See minitoc.pdf for specific precautions\@gobble}{}%
}{}%
% Comparaisons
\@mtc@hints@w@false
\@ifundefined{chapter}{}{\ifx\chapter\mtc@hints@chapter\relax\else\@mtc@hints@w@true\fi}
\@ifundefined{chapter}{}{\ifx\@chapter\mtc@hints@@chapter\relax\else\@mtc@hints@w@true\fi}
\@ifundefined{chapter}{}{\ifx\@schapter\mtc@hints@@schapter\relax\else\@mtc@hints@w@true\fi}
\if@mtc@hints@w@\@mtc@hints@given@true%
  \PackageWarning{minitoc}{--- The \string\chapter\space command is altered after minitoc\@gobble}\fi
\@mtc@hints@w@false
\@ifundefined{part}{}{\ifx\part\mtc@hints@part\relax\else\@mtc@hints@w@true\fi}
\@ifundefined{part}{}{\ifx\@part\mtc@hints@@part\relax\else\@mtc@hints@w@true\fi}
\@ifundefined{part}{}{\ifx\@spart\mtc@hints@@spart\relax\else\@mtc@hints@w@true\fi}
\if@mtc@hints@w@\@mtc@hints@given@true%
  \PackageWarning{minitoc}{--- The \string\part\space command is altered after minitoc\@gobble}\fi
\@mtc@hints@w@false
\@ifundefined{chapter}{%
\@ifundefined{section}{}{\ifx\chapter\mtc@hints@section\relax\else\@mtc@hints@w@true\fi}
\@ifundefined{section}{}{\ifx\@sect\mtc@hints@@sect\relax\else\@mtc@hints@w@true\fi}
\@ifundefined{section}{}{\ifx\@ssect\mtc@hints@@ssect\relax\else\@mtc@hints@w@true\fi}
\if@mtc@hints@w@\@mtc@hints@given@true%
  \PackageWarning{minitoc}{--- The \string\section\space command is altered after minitoc\@gobble}\relax\else\fi}{}%
} % end of \mtc@hints@begindoc%
\def\mtc@hints@enddoc{%
\if@mtc@hints@given@\PackageWarning{minitoc}{***** Some hints have been written in the \jobname.log file. *****\@gobble}\else
\PackageWarning{minitoc}{***** No hints have been written in the \jobname.log file. *****\@gobble}\fi
}
%%%%%%%%%

\ExecuteOptions{english} %v27 % default
\ProcessOptions*
\if@mtc@ss@insection@%\typeout{*** option insection used ***}%
\RequirePackage[section,below]{placeins}[2002/06/27]\fi
\if@mtc@notoccite@%
\RequirePackage{notoccite}\fi
%v40 Apply the hints option
\if@mtc@hints@\AtBeginDocument{\mtc@hints@begindoc}\AtEndDocument{\mtc@hints@enddoc}%
\@ifundefined{chapter}{}{\let\mtc@hints@chapter\chapter
			 \let\mtc@hints@@chapter\@chapter
			 \let\mtc@hints@@schapter\@schapter}
\@ifundefined{part}{}{\let\mtc@hints@part\part
			 \let\mtc@hints@@part\@part
			 \let\mtc@hints@@spart\@spart}
\@ifundefined{section}{}{\let\mtc@hints@section\section
			 \let\mtc@hints@@sect\@sect
			 \let\mtc@hints@@ssect\@ssect}
\fi

\endinput
%%
%% \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         \~}
%%
%% End of file `minitoc.sty'.