summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/pageslts/pageslts.dtx
blob: b70a5ce6891ffff54cedbffba174f6098e8ac9a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
% \iffalse meta-comment
%
% File: pageslts.dtx
% Version: 2015/12/21 v1.2f
%
% Copyright (C) 2010 - 2015 by
%    H.-Martin M"unch <Martin dot Muench at Uni-Bonn dot de>
% Portions of code copyrighted by other people as marked.
%
% This package first started as a revision of the lastpage
% package of Jeffrey P. Goldberg (jeffrey+news at goldmark dot org),
% but it became obvious that a replacement was needed.
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either
% version 1.3c of this license or (at your option) any later
% version. This version of this license is in
%    http://www.latex-project.org/lppl/lppl-1-3c.txt
% and the latest version of this license is in
%    http://www.latex-project.org/lppl.txt
% and version 1.3c or later is part of all distributions of
% LaTeX version 2005/12/01 or later.
%
% This work has the LPPL maintenance status "maintained".
%
% The Current Maintainer of this work is H.-Martin Muench.
%
% This work consists of the main source file pageslts.dtx,
% the README, and the derived files
%    pageslts.sty, pageslts.pdf,
%    pageslts.ins, pageslts.drv,
%    pageslts-example.tex, pageslts-example.pdf.
%
% 'pageslts' is available on CTAN:
% https://www.ctan.org/pkg/pageslts
%
% Also a TDS.ZIP file is provided that contains all the files
% already sorted in a TDS tree:
% http://mirrors.ctan.org/install/macros/latex/contrib/pageslts.tds.zip
%
%<*ignore>
\begingroup
  \catcode123=1 %
  \catcode125=2 %
  \def\x{LaTeX2e}%
\expandafter\endgroup
\ifcase 0\ifx\install y1\fi\expandafter
         \ifx\csname processbatchFile\endcsname\relax\else1\fi
         \ifx\fmtname\x\else 1\fi\relax
\else\csname fi\endcsname
%</ignore>
%<*install>
\input docstrip.tex
\Msg{*********************************************************************************}
\Msg{* Installation}
\Msg{* Package: pageslts 2015/12/21 v1.2f Refers to special pages' numbers/names (HMM)}
\Msg{*********************************************************************************}

\keepsilent
\askforoverwritefalse

\let\MetaPrefix\relax
\preamble

This is a generated file.

Project: pageslts
Version: 2015/12/21 v1.2f

Copyright (C) 2010 - 2015 by
    H.-Martin M"unch <Martin dot Muench at Uni-Bonn dot de>
Portions of code copyrighted by other people as marked.

IMPORTANT NOTICE:
On the first page backslash pagenumbering should be called
(with the appropriate argument out of e.g.
 * roman    - Lowercase Roman numerals: i, ii, iii, iv,...
 * Roman    - Uppercase Roman numerals: I, II, III, IV,...
 * arabic   - Arabic numerals: 1, 2, 3, 4,...
 * alph     - Lowercase letters: a, b, c, d,...
 * Alph     - Uppercase letters: A, B, C, D,...
 * fnsymbol - Footnote symbols: *, † (ddagger), ‡ (dddagger),
                                 § (mathsection),...
). The command backslash pagenumbering is renewed, but no change
should be visible to the output text, because only labels are added.
backslash OrigPagenumbering can be used to get the original meaning
of backslash pagenumbering, but in that case this package does not
see the change in the page numbering scheme and will make mistakes.
The package takes options.

The usual disclaimer applies:
If it doesn't work right that's your problem.
(Nevertheless, send an e-mail to the maintainer
 when you find an error in this package.)

This work may be distributed and/or modified under the
conditions of the LaTeX Project Public License, either
version 1.3c of this license or (at your option) any later
version. This version of this license is in
   http://www.latex-project.org/lppl/lppl-1-3c.txt
and the latest version of this license is in
   http://www.latex-project.org/lppl.txt
and version 1.3c or later is part of all distributions of
LaTeX version 2005/12/01 or later.

This work has the LPPL maintenance status "maintained".

The Current Maintainer of this work is H.-Martin Muench.

This package first started as a revision of the lastpage
package of Jeffrey P. Goldberg (jeffrey+news at goldmark dot org),
but it became obvious that a replacement was needed.

This work consists of the main source file pageslts.dtx,
the README, and the derived files
   pageslts.sty, pageslts.pdf,
   pageslts.ins, pageslts.drv,
   pageslts-example.tex, pageslts-example.pdf.

In memoriam
 Claudia Simone Barth + 1996/01/30
 Tommy Muench + 2014/01/02
 Hans-Klaus Muench + 2014/08/24

\endpreamble
\let\MetaPrefix\DoubleperCent

\generate{%
  \file{pageslts.ins}{\from{pageslts.dtx}{install}}%
  \file{pageslts.drv}{\from{pageslts.dtx}{driver}}%
  \usedir{tex/latex/pageslts}%
  \file{pageslts.sty}{\from{pageslts.dtx}{package}}%
  \usedir{doc/latex/pageslts}%
  \file{pageslts-example.tex}{\from{pageslts.dtx}{example}}%
}

\catcode32=13\relax% active space
\let =\space%
\Msg{************************************************************************}
\Msg{*}
\Msg{* To finish the installation you have to move the following}
\Msg{* file into a directory searched by TeX:}
\Msg{*}
\Msg{*  pageslts.sty}
\Msg{*}
\Msg{* To produce the documentation run the file `pageslts.drv'}
\Msg{* through (pdf)LaTeX, e.g.}
\Msg{*  pdflatex pageslts.drv}
\Msg{*  makeindex -s gind.ist pageslts.idx}
\Msg{*  pdflatex pageslts.drv}
\Msg{*  makeindex -s gind.ist pageslts.idx}
\Msg{*  pdflatex pageslts.drv}
\Msg{*}
\Msg{* At least three runs are necessary e. g. to get the}
\Msg{*  references right!}
\Msg{*}
\Msg{* Happy TeXing!}
\Msg{*}
\Msg{************************************************************************}

\endbatchfile
%</install>
%<*ignore>
\fi
%</ignore>
%
% \section{The documentation driver file}
%
% The next bit of code contains the documentation driver file for
% \TeX , i.\,e., the file that will produce the documentation you
% are currently reading. It will be extracted from this file by the
% \texttt{docstrip} programme. That is, run \LaTeX{} on \texttt{docstrip}
% and specify the \texttt{driver} option when \texttt{docstrip}
% asks for options.
%
%    \begin{macrocode}
%<*driver>
\NeedsTeXFormat{LaTeX2e}[2015/01/01]
\ProvidesFile{pageslts.drv}[2015/12/21 v1.2f
            Refers to special pages' numbers/names (HMM)]
\documentclass[landscape]{ltxdoc}[2015/03/26]% v2.0w
\usepackage{geometry}[2010/09/12]%             v5.6
\usepackage{holtxdoc}[2012/03/21]%             v0.24
%% pageslts may work with earlier versions of LaTeX2e and those
%% class and packages, but this was not tested.
%% Please consider updating your LaTeX, class, and packages
%% to the most recent version (if they are not already the most
%% recent version).
\hypersetup{%
 pdfsubject={Refers to special pages' numbers/names (HMM)},%
 pdfkeywords={LaTeX, pageslts, pagesLTS, lastpage, page number, page name, H.-Martin Muench},%
 pdfencoding=auto,%
 pdflang={en},%
 breaklinks=true,%
 linktoc=all,%
 pdfstartview=FitH,%
 pdfpagelayout=OneColumn,%
 bookmarksnumbered=true,%
 bookmarksopen=true,%
 bookmarksopenlevel=2,%
 pdfmenubar=true,%
 pdftoolbar=true,%
 pdfwindowui=true,%
 pdfnewwindow=true%
}
\usepackage{ulem}[2012/05/18]% no version is given in the ulem.sty file
\CodelineIndex
\hyphenation{created every-thing ignored}
\gdef\unit#1{\mathord{\thinspace\mathrm{#1}}}
\makeatletter
\@ifundefined{eTeX}{\gdef\eTeX{$\m@th \varepsilon $-\TeX }}{% else \relax
}
\makeatother
\begin{document}
  \DocInput{pageslts.dtx}%
\end{document}
%</driver>
%    \end{macrocode}
%
% \fi
%
% \CheckSum{1790}
%
% \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         \~}
%
% \GetFileInfo{pageslts.drv}
%
% \begingroup
%   \def\x{\#,\$,\^,\_,\~,\ ,\&,\{,\},\%}%
%   \makeatletter
%   \@onelevel@sanitize\x
% \expandafter\endgroup
% \expandafter\DoNotIndex\expandafter{\x}
% \expandafter\DoNotIndex\expandafter{\string\ }
% \begingroup
%   \makeatletter
%     \lccode`9=32\relax
%     \lowercase{%^^A
%       \edef\x{\noexpand\DoNotIndex{\@backslashchar9}}%^^A
%     }%^^A
%   \expandafter\endgroup\x
%
% \DoNotIndex{\",\-,\,,\\,\noindent}
% \DoNotIndex{\documentclass,\usepackage,\ProvidesPackage}
% \DoNotIndex{\NeedsTeXFormat,\TeX,\LaTeX}
% \DoNotIndex{\ldots,\thinspace,\textbackslash}
% \DoNotIndex{\begin,\end}
% \DoNotIndex{\textbf,\textit,\textquotedblleft,\textquotedblright,\textsc,\textsf,\texttt,\underline}
% \DoNotIndex{\ifx,\ifnum,\ifodd,\enduremath}
% \DoNotIndex{\newpage,\pagebreak,\clearpage,\newline,\linebreak,\nolinebreak}
% \DoNotIndex{\lipsum,\MessageBreak,\pageref,\protect}
% \DoNotIndex{\smallskip,\medskip,\bigskip,\hskip,\space,\hline}
% \DoNotIndex{\advance,\@ne}
% \DoNotIndex{\item}
% \DoNotIndex{\@PackageInfoNoLine,\@bsphack,\@esphack,\@ehc,\@ehd,\@ifundefined,%
%  \addcontentsline,\arabic,\enddocument,\endinput,\href,\makeatletter,\makeatother,%
%  \section,\subsection,\tableofcontents,\verb}
%
% \title{The \xpackage{pageslts} package}
% \date{2015/12/21 v1.2f}
% \author{H.-Martin M\"{u}nch\\\xemail{Martin.Muench at Uni-Bonn.de}}
%
% \maketitle
%
% \begin{abstract}
%  \noindent This \LaTeX{} package puts the labels \texttt{LastPage}
%  (|\AtEndDocument|) and \texttt{VeryLastPage} (|\AfterLastShipout|)
%  into the \xfile{.aux} file, allowing the user to refer
%  to the (very) last page of a document. This might be
%  particularly useful in places like headers or footers.
%  When more than one page numbering scheme is used,
%  these references do not give the total \textit{number} of pages.
%  For this case the label \texttt{LastPages} is introduced.
%  Additionally, at the last page of each page numbering
%  scheme a label \texttt{pagesLTS.<numbering scheme>} is
%  placed, where \texttt{<numbering scheme>} is e.\,g.
%  arabic, roman, Roman, alph, or Alph. For fnsymbol
%  please use |\lastpageref{pagesLTS.fnsymbol}|
%  instead of |\pageref{pagesLTS.fnsymbol}|.
%  When the same numbering scheme is used twice,
%  the page numbers are either reset to one or continued
%  automatically, depending on the option given when the package
%  is called. The command |\theCurrentPage|
%  prints the current total/absolute page number -- in contrast to
%  |\thepage|, which gives only the page
%  \textit{name} in the current page numbering scheme.
%  |\theCurrentPageLocal| gives the current
%  number of pages in the current page numbering scheme.
%  |\thepage| and |\theCurrentPageLocal| are different e.\,g.
%  when |\addtocounter{page}{|\ldots|}| or
%  |\setcounter{page}{|\ldots|}| were used.
%  At the first page of the document a label \texttt{pagesLTS.0} is
%  created. This label can be referred to, too.
%  Further labels are provided for special cases.\\
%  The \xpackage{alphalph} package is supported, i.\,e.
%  page numbers alph or Alph $>26$ and fnsymbol $>9$
%  can be used (with according options set). Even zero
%  and negative page numbers can be used with \texttt{arabic},
%  \texttt{alph}, \texttt{Alph}, \texttt{roman}, \texttt{Roman},
%  and \texttt{fnsymbol} page numbering (with \xpackage{alphalph} package
%  and according options).\\
%  |\pageref*| and |\lastpageref*|, for using \xpackage{hyperref}
%  but suppressing links, are supported.
% \end{abstract}
%
% \noindent \textbf{Please make sure to first deinstall the obsolete
% \xpackage{pagesLTS} package before installing this \xpackage{pageslts}
% package!}\\
% (There is at least one operating system which otherwise automatically
% renames \xfile{pageslts} to \xfile{pagesLTS}.)
%
% \noindent Right after |\begin{document}| a |\pagenumbering{|\ldots|}| should
% be called -- with the appropriate argument out of e.\,g.\\
% arabic (Arabic numerals: 1, 2, 3, 4,\ldots),\\
% roman (Lowercase Roman numerals: i, ii, iii, iv,\ldots),
% Roman (Uppercase Roman numerals: I, II, III, IV,\ldots),\\
% alph (Lowercase letters: a, b, c, d,\ldots),
% Alph (Uppercase letters: A, B, C, D,\ldots),\\
% fnsymbol (Footnote symbols: $*$, $\dagger $, $\ddagger $, $\mathsection $,\ldots).
%
% \noindent This package first started as a revision of the
% \xpackage{lastpage} package of \textbf{Jeffrey P. Goldberg} (Thanks!),
% but then it became obvious that a replacement was needed.
%
% \noindent Disclaimer for web links: The author is not responsible for any contents
% referred to in this work unless he has full knowledge of illegal contents.
% If any damage occurs by the use of information presented there, only the
% author of the respective pages might be liable, not the one who has referred
% to these pages.
%
% \noindent Save per page about $200\unit{ml}$ water,
% $2\unit{g}$ CO$_{2}$ and $2\unit{g}$ wood:
% Therefore please print only if this is really necessary.
%
% \bigskip
%
% \tableofcontents
%
% \newpage
%
% \section{Introduction}
%
% \indent This package puts the labels \texttt{LastPage}
% (|\AtEndDocument|) (same as my \xpackage{LastPage} package, invented by
% \textsc{Jeffrey P. Goldberg}) and \texttt{VeryLastPage} (|\AfterLastShipout|)
% into the \xfile{.aux} file, allowing the user to refer to the (very)
% last page of a document via |\lastpageref{LastPage}| and
% |\lastpageref{VeryLastPage}|. This might be particularly useful in
% places like headers or footers. When more than one page numbering scheme
% is used, these references do not give the total \textit{number} of pages.
% For this case the label \texttt{LastPages} is introduced (similar to the
% label \texttt{TotPages} of the \xpackage{TotPages} package, but
% the label \texttt{LastPages} is set later in the document).
% Additionally, at the last page of each page numbering scheme a label
% \texttt{pagesLTS.<}\textit{numbering scheme}\texttt{>} is placed,
% where \texttt{<}\textit{numbering scheme}\texttt{>} is e.\,g.
% arabic, roman, Roman, alph, or Alph. For fnsymbol please use
% |\lastpageref{pagesLTS.fnsymbol}| instead of |\pageref{pagesLTS.fnsymbol}|.
% When the same numbering scheme is used twice, the page numbers are
% either reset to one or continued automatically, depending on the option
% given when the package is called. The command |\theCurrentPage| prints
% the current total/absolute page number - in contrast to |\thepage|,
% which gives only the page \textit{name} in the current page numbering
% scheme. |\theCurrentPageLocal| gives the current number of pages
% in the current page numbering scheme. |\thepage| and |\theCurrentPageLocal|
% are different e.\,g. when |\addtocounter{page}{|\ldots|}| or
% |\setcounter{page}{|\ldots|}| were used. (See also \LaTeX\ bug~3421:
% 3rd~page is even (twoside, titlepage, abstract),
% \url{http://www.latex-project.org/cgi-bin/ltxbugs2html?category=LaTeX&responsible=anyone&state=anything&keyword=pagenumber&pr=latex%2F3421&search=}.)
% At the first page of the document a label \texttt{pagesLTS.0} is
% created. This label can be referred to, too. Further labels are
% provided for special cases.\\
% The \xpackage{alphalph} package is supported, i.\,e. page numbers
% \texttt{alph} or \texttt{Alph} $>26$ and \texttt{fnsymbol} $>9$ can
% be used (with the according options set). Even zero or negative page
% numbers can be used with \texttt{arabic}, \texttt{alph}, \texttt{Alph}, and
% \texttt{fnsymbol} page numbering (with \xpackage{alphalph} package
% and according options), and zero \texttt{roman} and \texttt{Roman} pages,
% too.
%
% \bigskip
% \noindent Right after |\begin{document}| a |\pagenumbering{|\ldots|}|
% should be called -- with the appropriate argument out of e.\,g.\\
% arabic (Arabic numerals: 1, 2, 3, 4,\ldots),\\
% roman (Lowercase Roman numerals: i, ii, iii, iv,\ldots),
% Roman (Uppercase Roman numerals: I, II, III, IV,\ldots),\\
% alph (Lowercase letters: a, b, c, d,\ldots),
% Alph (Uppercase letters: A, B, C, D,\ldots),\\
% fnsymbol (Footnote symbols: $*$, $\dagger $, $\ddagger $, $\mathsection $,\ldots).
%
% \bigskip
% \noindent This package first started as a revision of the
% \xpackage{lastpage} package of \textsc{Jeffrey P. Goldberg} (Thanks!),
% but then it became obvious that a replacement was needed to accomplish
% what this package does.
%
% \bigskip
% \noindent \textbf{Trademarks} appear throughout this documentation
% without any trademark symbol; they are the property of their respective
% trademark owner. There is no intention of infringement; the usage is
% to the benefit of the trademark owner.
%
% \bigskip
% \phantomsection
% \DescribeMacro{logical page numbers}
% \noindent \textbf{Tip}: For the display of the \xfile{pdf}~file use
% \textbf{logical page numbers} together with \xpackage{hyperref}!
% \label{logical page numbers}
% \begin{description}
% \item [-] In Adobe Reader DC 2015.008.20082 enable:\\
% Edit $>$ Preferences $>$ Categories: Page Display $>$
% Page Content and Information: Use logical page numbers
%
% \item[-] Use the \xpackage{hyperref} package with option |plainpages=false|\,.
% \end{description}
% The display will be e.\,g.\ \textquotedblleft 7~(7~of~9)\textquotedblright,
% or, in case of Roman instead of arabic numbers,
% \textquotedblleft VII~(7~of~9)\textquotedblright, and when different
% page numbers are used (see below) e.\,g. arabic after 10~Roman pages:
% \textquotedblleft 17~(27~of~30)\textquotedblright.
% Please try this with the compiled \xpackage{pageslts-example} file!
%
% \bigskip
% \noindent The name of the \xpackage{pageslts} package refers to
% Last, Total, and page numbering Schemes pages. \xpackage{pagesLTS}
% was a former name of this package.
%
% \pagebreak
%
% \section{Usage}
%
% \indent Just load the package placing
% \begin{quote}
%   |\usepackage[<|\textit{options}|>]{pageslts}|
% \end{quote}
% \noindent in the preamble of your \LaTeXe\ source file
% (about |\AtEndDocument| see subsection~\ref{ssec:aed})
% and place a |\pagenumbering{...}| with appropriate argument
% (e.\,g.~arabic, roman, Roman, fnsymbol, alph, or Alph)
% right behind |\begin{document}| (see subsubsection~\ref{sss:nopnc})!\\
%
% \indent For example for various draft forms it is desirable to have a
% page reference to the last page, so that e.\,g. page footers can
% contain something like \textquotedblleft page $N$ of $K$\textquotedblright,
% where $N$ is the current page and $K$ is the last page. Once the package
% is loaded, anywhere in the text references can be made to the labels
% \texttt{LastPage}, \texttt{VeryLastPage}, and \texttt{LastPages}
% (most times with |\pageref{...}|, but more save with |\lastpageref{...}|).
% In particular one can use the \xpackage{fancyhdr} or \xpackage{nccfancyhdr}
% package, or redefinitions of the page headings and footings to get
% a reference to the (very) last page.\\
% \DescribeMacro{\pageref*}
% \DescribeMacro{\lastpageref*}
% If the \xpackage{hyperref} package is used, the references are hyperlinked
% to their aims. If these hyperlinks shall be suppressed, |\pageref*{...}|
% and |\lastpageref*{...}| can be used.
%
% \subsection{Options}
% \DescribeMacro{options}
% \indent The \xpackage{pageslts} package takes the following options:
%
% \subsubsection{pagecontinue\label{sss:pagecontinue}}
% \DescribeMacro{pagecontinue}
% \indent When option \texttt{pagecontinue=false} is \textbf{not} given
% (i.\,e. \texttt{pagecontinue} or \texttt{pagecontinue=true}
% or no \texttt{pagecontinue} option at all), at each
% |\pagenumbering{...}| command the number of the page will be continued
% with the page number following the last page of the same page numbering
% scheme. For example, if there are V~Roman pages in the frontmatter,
% some arabic ones in the mainmatter, and then Roman ones again in the
% backmatter, the last ones will start with VI instead of~I again.\\
% \indent If you want to start with I (or i, 1, a, A, *,\ldots ) again,
% set option \texttt{pagecontinue=false}. If you want to generally continue
% the numbers, but for some page numbering scheme do not want this,
% use \texttt{pagecontinue=true} and say |\setcounter{page}{1}|
% after |\pagenumbering{...}| for that page numbering scheme.
%
% \subsubsection{alphMult, AlphMulti, fnsymbolmult\label{sss:alphalph}}
%
% \indent The page number printed in
% \nolinebreak{\texttt{fnsymbol}\footnote{%
% \ensuremath {*},%
% \ensuremath {\dagger },%
% \ensuremath {\ddagger },%
% \ensuremath {\mathsection },%
% \ensuremath {\mathparagraph },%
% \ensuremath {\delimiter "026B30D },%
% \ensuremath {**},%
% \ensuremath {\dagger \dagger },%
% \ensuremath {\ddagger \ddagger }}}
% must be $>0$ and $<10$ and those printed in
% \nolinebreak{\texttt{alph}\footnote{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}} and
% \nolinebreak{\texttt{Alph}\footnote{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}} must
% be $>0$ and $<27$. After page~Z\quad \LaTeX\ \textit{should}
% continue with AA, AB, AC,\ldots\ Some people prefer
% AA, BB, CC,\ldots, but in hexadecimal it is $AA_{16}=170_{10}$
% and $171_{10}=AB_{16}$, whereas $BB_{16}=187_{10}$. In any way
% it should continue at all (maybe even with an user option to
% choose between the two continuations), but instead only gives
% an error:
% \begin{quote}
%   |LaTeX Error: Counter too large|\\
%   |See the LaTeX manual or LaTeX Companion for explanation.|\\
%   |You've lost some text.  Try typing  <return>  to proceed.|\\
%   |If that doesn't work, type  X <return>  to quit.|
% \end{quote}
% But thanks to the \xpackage{alphalph} package by \textsc{Heiko Oberdiek}
% these limitation no longer hold. With his |\erroralph| command
% now even negative or zero page
% \textquotedblleft numbers\textquotedblright{} are possible.\\
%
% \DescribeMacro{alphMult}
% The string option \texttt{alphMult} takes three values: |ab|, |bb|, |0|:
% \begin{description}
% \item[ab] After page z, the page
%  \textquotedblleft numbers\textquotedblright{} continue with
%  aa, ab, ac, ad,\ldots, fxshrxw (the default), and before a with
%  0, -a, -b,\ldots, -z, -aa, -ab,\ldots, -fxshrxw ($=-21\,474\,836\,47$).
% \item[bb] After page z, the page
%  \textquotedblleft numbers\textquotedblright{} continue with
%  aa, bb, cc, dd,\ldots, and before a with
%  0, -a, -b,\ldots, -z, -aa, -bb,\ldots\\
%  (Internally up~to $\pm 55\,834\,558$ is allowed, but when printed will
%  exceed the \LaTeX\ capacity even for smaller numbers --
%  in the example file this happens at about $6\,500$.)\\
%  (If you have a document with more than $6\,500$~pages, you might
%   think about splitting it in volumes. And page
%   \textquotedblleft numbers\textquotedblright{} with about 100~digits
%   are probably not easy to grasp for the reader, too.)\\
% \item[0] (zero) The \xpackage{pageslts} package does nothing,
%  thus the user is free to define the page
%  \textquotedblleft numbers\textquotedblright{} after~z and before~a.\\
%  (But if the user does not do anything at all, the\\
%  \ |LaTeX Error: Counter too large|\\
%  will appear again.)
% \end{description}
%
% \DescribeMacro{AlphMulti}
% The string option \texttt{AlphMulti} takes three values: |AB|, |BB|, |0|:
% \begin{description}
% \item[AB] After page Z, the page
%  \textquotedblleft numbers\textquotedblright{} continue with
%  AA, AB, AC, AD,\ldots, FXSHRXW (the default), and before A with
%  0, -A, -B,\ldots, -Z, -AA, -AB,\ldots, -FXSHRXW.
% \item[BB] After page Z, the page
%  \textquotedblleft numbers\textquotedblright{} continue with
%  AA, BB, CC, DD,\ldots, and before A with
%  0, -A, -B,\ldots, -Z, -AA, -BB,\ldots \\
%  (About the limits please see |alphMult| above.)
% \item[0] (zero) The \xpackage{pageslts} package does nothing,
%  thus the user is free to define the page
%  \textquotedblleft numbers\textquotedblright{} after~Z and before~A.\\
%  (But if the user does not do anything at all, the\\
%  \ |LaTeX Error: Counter too large|\\
%  will appear again.)
% \end{description}
%
% \DescribeMacro{fnsymbolmult}
% When option \texttt{fnsymbolmult=false} is \textbf{not} given
% (i.\,e. \texttt{fnsymbolmult} or \texttt{fnsymbolmult=true}
% or no \texttt{fnsymbolmult} option at all),
% after 5 (\ensuremath {\mathparagraph }) the page
% \textquotedblleft number\textquotedblright{} is continued with
% the doubled \textquotedblleft number\textquotedblright{} of the
% first, second, third,\ldots\ page (\ensuremath {**},
% \ensuremath {\dagger \dagger }, \ensuremath {\ddagger \ddagger },
% \ensuremath {\mathsection \mathsection },
% \ensuremath {\mathparagraph \mathparagraph }),
% and after the tenth page the
% \textquotedblleft number\textquotedblright{} is tripled
% (\ensuremath {***}, \ensuremath {\dagger \dagger \dagger },\ldots).
% Compile the \textsf{pageslts-example.tex} with \pdfLaTeX\ and
% see the resulting \xfile{pdf} file.\\
% Before \ensuremath {*} (page~1) the page
% \textquotedblleft numbers\textquotedblright{} are continued with
% 0, \ensuremath {- * }, \ensuremath {- \dagger },\ldots,
% \ensuremath {- \mathparagraph }, \ensuremath {- **},
% \ensuremath {- \dagger \dagger },\ldots \\
% If this is not wanted, set option \texttt{fnsymbolmult=false},
% and \xpackage{pageslts} will do nothing and allow the user to change
% the page \textquotedblleft number\textquotedblright . (But if the
% user does not do anything at all, the\\
% \ |LaTeX Error: Counter too large|\\
% will appear again.)\\
% While in \LaTeXe\ arabic (page) numbers are possible up~to
% |MAX|\,$ = 2\,147\,483\,647$ (cf.~the \xpackage{alphalph} package),\\
% |\erroralphalph{\fnsymbolmult}{...}| numbers are possible up~to
% 10\,737\,415 only. If this number is not only used internally
% but printed, after number about 11\,705 (which is
% 2\,341 times \ensuremath {\mathparagraph }) the \LaTeXe\ capacity
% is exceeded, depending on the remaining file and its use of
% \TeX\ capacity, of course. (If you have a document with more than
% 11\,705~pages, you might think about splitting it in volumes.
% And page \textquotedblleft numbers\textquotedblright{} with
% 2\,341~digits are probably not easy to grasp for the reader, too.)\\
%
% \subsubsection{romanMult, RomanMulti\label{sss:romanMult}}
%
% \DescribeMacro{romanMult}
% \DescribeMacro{RomanMulti}
% The options \texttt{romanMult(=true)} and \texttt{RomanMulti(=true)}
% expand the |\roman| and |\Roman| page numbering scheme to values
% below one ($<1$), i.\,e. 0, -i, -ii, -iii, -iv,\ldots\ and
% 0, -I, -II, -III, -IV,\ldots, respectively.\\
% Again the \TeX\ capacity will be exceeded before
% \nolinebreak{$\pm$ |MAX|\,}$ = \pm 2\,147\,483\,647$, and even if
% $1\,000\,000\,000$ is internally possible, this would print
% $1\,000\,000$ times the letter~\textsf{m} (or~\textsf{M}),
% which would require either very small print or quite huge paper size.\\
% (If you have a document with so many pages, you might think
% about splitting it in volumes. And page
% \textquotedblleft numbers\textquotedblright{} with
% thousands of digits are probably not easy to grasp for the reader,
% too.)\\
% If the expansion below $1$ is not wanted, set options
% \texttt{romanMult=false} and/or \texttt{RomanMulti=false},
% and \xpackage{pageslts} will do nothing and allow the user
% to change the page \textquotedblleft number\textquotedblright .
% (But if the user does not do anything at all, \LaTeX\ will just
% ignore the values - not even a warning will be issued.)
%
% \subsubsection{Arabic page numbers}
%
% \DescribeMacro{Arabic page numbers}
% In \LaTeXe\ arabic (page) numbers are already possible between
% |-MAX...MAX|, where |MAX|\,$ = 2\,147\,483\,647$ (cf.~the
% \xpackage{alphalph} package), without any expansion necessary.
% (But if you have a document with so many pages, you might think
% about splitting it in volumes!)
%
% \subsection{Labels}
%
% \DescribeMacro{pagesLTS.0}
% \indent At the first page a label \texttt{pagesLTS.0} is created.
% If |\pagenumbering{...}| is used right after
% |\begin{document}|, this is much easier for the
% \xpackage{pageslts} package (and chances for successful placing
% of all labels are much higher;
% \nolinebreak{cf.~subsubsection~\ref{sss:once}).}\\
%
% \DescribeMacro{LastPage}
% |\AtEndDocument| (see subsection~\ref{ssec:aed}) this package defines
% a label, \texttt{LastPage}, which the user can refer to with the\linebreak
% |\lastpageref{LastPage}| command. While |\pageref{LastPage}| is also
% possible (especially for backward compatibility with the \xpackage{LastPage}
% package), this is discouraged, because it will not work when it is used
% together with the \xpackage{hyperref} package and the \xpackage{fnsymbol}
% page numbering scheme. (The \xpackage{LastPage} package did not work with
% this combination, too, so if you want to, you can reproduce the old error
% -- but you do not have to do it, but can use |\lastpageref{LastPage}|.)\\
%
% \DescribeMacro{VeryLastPage}
% |\AfterLastShipout| the label \texttt{VeryLastPage} is defined, which
% the user can also refer to with the |\lastpageref{VeryLastPage}| command.
% Depending on usage of |\AtEndDocument| by other packages, \texttt{LastPage}
% might not point to the very last page, but |\lastpageref{VeryLastPage}|
% should do this (cf.~subsection~\ref{ssec:aed}).\\
%
% \DescribeMacro{LastPages}
% \DescribeMacro{page number}
% \DescribeMacro{number of pages}
% When more than one page numbering scheme is used, neither \texttt{LastPage}
% nor \texttt{VeryLastPage} give the total \textbf{number} of pages.
% For example, for a document with VI+36 pages, both give
% \textquotedblleft 36\textquotedblright{} as reference to the last page.
% While this is correct, the total number of pages is 42, and this is given
% by the reference to \texttt{LastPage\underline{s}}:
% \nolinebreak{|\lastpageref{LastPage|\underline{|s|}|}|} (note the
% \textquotedblleft s\textquotedblright{} at the end). When the
% page number was manipulated by |\addtocounter{page}{...}|
% or |\setcounter{page}{...}|, \texttt{LastPages} ignores this.
% (At a page numbering change the page is reset to one (without option
% |pagecontinue|). This is done by |\setcounter{page}{1}|, thus this is
% ignored, too.)\\
% |\pageref{totpages}| of the \xpackage{totpages} package is similar to
% |\lastpageref{LastPages}|, but while the target for \linebreak[4]
% |\pageref{totpages}| is placed |\AtEndDocument|, the target for
% |\lastpageref{LastPages}| is placed |\AfterLastShipout|, therefore
% |\lastpageref{LastPages}| is safer to really get the total page number.\\
%
% \pagebreak
%
% \DescribeMacro{\theCurrentPage}
% |\theCurrentPage| gives the current total/absolute page, in contrast to
% |\thepage|, which gives only the page \textit{name} in the current page
% numbering scheme. For example, when there are Roman VII pages in the
% frontmatter and afterwards in the mainmatter you are at arabic page~9,
% then |\theCurrentPage| is~16, whereas |\thepage| is~9. When the page
% \textquotedblleft number\textquotedblright{} (name) is manipulated by
% |\addtocounter{page}{...}| or |\setcounter{page}{...}|, |\theCurrentPage|
% \nolinebreak{ignores} this. Because \texttt{CurrentPage} is a normal
% counter, you can also say e.\,g.~|\Roman{CurrentPage}| to get the value
% in Roman page numbering scheme (e.\,g.~VIII for~8).\\
%
% \phantomsection
% \label{CurrentPageLocal}
% \DescribeMacro{\theCurrentPageLocal}
% |\theCurrentPageLocal| gives the current (arabic) number of pages in the
% current page numbering scheme. |\thepage| and |\theCurrentPageLocal| are
% different e.\,g. when |\addtocounter{page}{...}| or
% |\setcounter{page}{...}| were used.\\
% |\theCurrentPageLocal| can be printed in other formats, e.\,g.
% |\roman{pagesLTS.current.local.roman}|, but probably it only makes
% sense if page numbering scheme and format are the same, e.\,g.
% |\Roman{pagesLTS.current.local.Roman}| or\\
% |\Alph{pagesLTS.current.local.Alph}|.\\
% |\arabic{pagesLTS.current.local.|\ldots|}| probably make sense even
% when combined with another page numbering scheme. And this is exactly
% what |\theCurrentPageLocal| does:\\
% |\def\theCurrentPageLocal{\arabic{pagesLTS.current.local.\pagesLTS@pnc}}|.\\
%
% \DescribeMacro{pagesLTS. page numbering scheme . number }
% If you want to refer to the last page of the first, second,\ldots\ use
% of a page numbering scheme, you can refer to \linebreak
% |pagesLTS.<page numbering scheme>.<number>|, e.\,g.
% |\lastpageref{pagesLTS.Roman.1}|, where |<number>| is the occurrence
% of the page numbering scheme. For details please see
% page~\pageref{pagesLTS.pnscheme.nr}.\\
%
% \bigskip
% \DescribeMacro{\lastpageref}
% For pages with the \texttt{fnsymbol} page numbering scheme,
% |\lastpageref{...}| \nolinebreak{instead} of |\pageref{...}|
% \textit{must} be used. This is required for pages some\-where
% inside of the document as well as the (very) last page(s).
% Because |\lastpageref{...}| is a synonym for |\pageref{...}|,
% where no \xpackage{fnsymbol} page numbering scheme is used,
% it is save(r) to use it for all references to labels provided
% by the \xpackage{pageslts} package.
%
% \subsection[\texttt{\textbackslash pagenumbering\{\ldots \}}]{%
% \texttt{\textbackslash pagenumbering\{\ldots \}}}
% \DescribeMacro{\pagenumbering}
% \subsubsection{If \texttt{\textbackslash pagenumbering\{\ldots \}} is \textbf{not} used\label{sss:nopnc}}
%
% \indent When the \xpackage{pageslts} package is used, but |\pagenumbering{...}|
% (with an argument like arabic, roman, Roman, fnsymbol, alph, or Alph)
% is not used, there should be no problem, except that you might need
% more~(!) compiler runs to get all references right, and some references
% might even be missing (see below). The \xpackage{pageslts}
% package tries to determine the page numbering scheme at the first
% shipout, but success is not guaranteed. Thus please use |\pagenumbering{...}|
% at the beginning of your document!\\
% \indent Without |\pagenumbering{<something>}| (|<something>| e.\,g. = arabic)
% at the beginning of the document, the page numbers might be given in
% arabic \textit{by} (class) \textit{default}, but the \xpackage{pageslts}
% package does not know about this without |\pagenumbering{arabic}|.~--\\
% \indent The label \texttt{pagesLTS.0} is created at the first
% page even if no |\pagenumbering{...}| command is given.
% Maybe have a look at the \xfile{.aux} file after compiling your
% document to detect further labels (of other packages, too).\\
%
% \pagebreak
%
% \subsubsection{If \texttt{\textbackslash pagenumbering\{\ldots \}} is used once\label{sss:once}}
%
% \DescribeMacro{pagesLTS.0}
% At the first page a label \texttt{pagesLTS.0} is created.
% If |\pagenumbering{...}| is used right after |\begin{document}|,
% this is much easier for the \xpackage{pageslts} package
% (and chances for successful placing of all labels are much higher).
%
% \subsubsection{If \texttt{\textbackslash pagenumbering\{\ldots \}} is used more than once}
%
% \indent Everything from the preceding subsubsections applies and additionally
% the following:\\
% \indent When different page numbering schemes are used, e.\,g.
% Roman numbers for the frontmatter and arabic numbers for the
% mainmatter, please use |\pagenumbering{...}| for each of them!
% Even if you do this, the reference to neither the label \texttt{LastPage}
% nor the label \texttt{VeryLastPage} gives the \textbf{total}
% number of pages, but only the number of pages of the last used page
% numbering scheme (which could be exactly what you want, e.\,g. if
% you want to refer to the last page itself and do not want to
% give the total number of pages).\\
% \DescribeMacro{LastPages}
% \indent For remediation the label
% \nolinebreak{\texttt{LastPage}\textbf{\underline{s}}}
% (with \textquotedblleft s\textquotedblright{} at its end) is
% introduced. Please then refer to this label by \newline
% |\lastpageref{LastPages}| instead of \texttt{LastPage} or
% \texttt{VeryLastPage}.\\
%
% \DescribeMacro{pagesLTS.arabic}
% \DescribeMacro{pagesLTS.roman}
% \DescribeMacro{pagesLTS.Roman}
% \DescribeMacro{pagesLTS.alph}
% \DescribeMacro{pagesLTS.Alph}
% \DescribeMacro{pagesLTS.fnsymbol}
% Additionally, at the last page of each page numbering scheme a label
% \texttt{pagesLTS.<numbering scheme>} is placed, where
% \texttt{<numbering scheme>} is e.\,g.\ arabic, roman, Roman, alph,
% Alph,\ldots .\\
% For the \textbf{fnsymbol} page numbering scheme
% |\lastpageref{pagesLTS.fnsymbol}| is needed instead of \newline
% |\pageref{pagesLTS.fnsymbol}|. You can and should use
% |\lastpageref{...}| also for the other page numbering schemes.\\
%
% \bigskip
%
% While at the time of the last revision of the \xpackage{pageslts} package
% no other page numbering schemes were known to the maintainer,
% this package in principle works with every scheme which is
% recognized by the original |\pagenumbering| command.
% But the \xpackage{hyperref} package only then works with crazy page names,
% if the references to those pages are given in a certain way, thus the
% combination of a new page numbering scheme, the \xpackage{hyperref}
% and the \xpackage{pageslts} package might not work.~--
% The \xpackage{pageslts} package by itself also works with schemes,
% which the original |\pagenumbering{...}| does not recognize, but because
% the original |\pagenumbering{...}| is called by the \xpackage{pageslts}
% package, this might cause an error, see subsection~\ref{sec:unknown}!
% (And if the number format is unknown to \LaTeX{}, the pages will have
% no number, and therefore cannot be referenced. You might be able to
% help yourself by using the \xpackage{hyperref} package and
% manually placing |\hypertarget|s and |\href|s.)
%
% \subsubsection{If the same \texttt{\textbackslash pagenumbering\{\ldots \}}\ %
%  scheme is used more than once\label{sss:twice}}
%
% \indent Everything from the preceding subsubsections applies and additionally
% the following:\\
% \DescribeMacro{pagecontinue}
% \indent If the same page numbering scheme is used twice (or even more often)
% in one document (e.\,g. in the frontmatter Roman: I--V, in the
% mainmatter arabic: 1--20, and in the backmatter again Roman: VI--X),
% the second time it is used, the page numbering is either continued (option
% \texttt{pagecontinue} or \texttt{pagecontinue=true} or no option
% \texttt{pagecontinue}; the default) or reset to one (option
% \texttt{pagecontinue=false}). It is even possible to use
% a~page numbering scheme more than twice.\\
%
% \phantomsection
% \label{pagesLTS.pnscheme.nr}
% \DescribeMacro{pagesLTS. page numbering scheme . number }
% If you want to refer to the last page of the first, second,\ldots\ use
% of a page numbering scheme, page~V in the example above, you can refer to
% |pagesLTS.<page numbering scheme>.<number>|, e.\,g.
% |\lastpageref{pagesLTS.Roman.1}|, where |<number>| is the occurrence
% of the page numbering scheme.\\
%
% \pagebreak
%
% If you want to refer to the first page of a page numbering scheme,
% just place a label there, e.\,g.\\
% \indent |\pagenumbering{Roman}| \\
% \indent |\section{Section title\label{RomanSection}}| \\
% (You know where you use |\pagenumbering{...}| and this is the
%  \xpackage{pageslts} package, not the \xpackage{firstpage} one).\\
%
% When you want to give the number of pages of each
% \textquotedblleft sector\textquotedblright{} of the page numbering
% scheme, you can use\\
% \DescribeMacro{pagesLTS. page numbering scheme . number .local.cnt}
% |\lastpages{<page numbering scheme>}{<number>}|, \\
% where |<page numbering scheme>| is e.\,g. Roman, arabic,\ldots\ and
% |<number>| the \textquotedblleft sector\textquotedblright{} number,
% e.\,g.~|\lastpages{Roman}{2}|.\\
% (Internally, the counter has the format
% |pagesLTS.<page numbering scheme>.<number>.local.cnt|.)
%
% \noindent If you used the page numbering scheme Roman for three times,
% you could say
% \begin{verbatim}
% Last Roman page (pagesLTS.Roman): \lastpageref{pagesLTS.Roman}\\
% There are \lastpageref{pagesLTS.Roman.local}~pages with Roman numbers:\\
% \lastpages{Roman}{1}~pages in the first Roman sector
% (\pageref{Roman} -- \lastpageref{pagesLTS.Roman.1}),\\
% \lastpages{Roman}{2}~pages in the second Roman sector
% (\pageref{Roman2} -- \lastpageref{pagesLTS.Roman.2}), and\\
% \lastpages{Roman}{3}~pages in the third Roman sector
% (\pageref{Roman3} -- \lastpageref{pagesLTS.Roman.3}.\\
% \end{verbatim}
% to get
% \begin{quote}
% Last Roman page (pagesLTS.Roman): VIII\\
% There are 8 pages with Roman numbers:\\
% 3 pages in the first Roman sector (I -- III),\\
% 4 pages in the second Roman sector (IV -- VII), and\\
% 3 pages in the third Roman sector (VIII -- X).\\
% \end{quote}
% (see e.\,g. the compiled \textsf{pageslts-example} file).\\
%
% If you want to continue one page numbering scheme, but later on
% (third use of it, or for another page numbering scheme) want to
% reset the page number, just say |\setcounter{page}{1}| there.\\
%
% \pagebreak
%
% \noindent In your document the code
% \begin{verbatim}
% \makeatletter
% \renewcommand{\@evenfoot}%
%  {\normalsize\slshape DRAFT \today\hfil \upshape page {\thepage} (\theCurrentPage) of\ %
%   \lastpageref{pagesLTS.Roman} + \lastpageref{pagesLTS.arabic}\ = \lastpageref{LastPages} pages%
%  }
% \renewcommand{\@oddfoot}{\@evenfoot}
% \makeatother
%\end{verbatim}
% \noindent creates footers like\\
%
% \textquotedblleft\mbox{\textsl{DRAFT \today}\hspace{1cm}page V (5) of VII + 35 = 42 pages}\textquotedblright\\
%
% \noindent or\\
%
% \textquotedblleft\mbox{\textsl{DRAFT \today}\hspace{1cm}page 10 (17) of VII + 35 = 42 pages}\textquotedblright\\
%
% \noindent in the compiled document (cf.~the \texttt{pageslts-example} file).
%
% \noindent Code like
% \begin{verbatim}
%  This book has \lastpageref{pagesLTS.Roman}+\lastpageref{pagesLTS.arabic} pages %
%  (\lastpageref{LastPages} pages in total).
% \end{verbatim}
% \noindent produces output like
% \begin{quote}
% This book has X+85 pages (95 pages in total).
% \end{quote}
% \noindent (when using the \xpackage{hyperref} package,
% the references are even hyperlinked).\\
%
% If |\addtocounter{page}{...}| or |\setcounter{page}{...}| have been used,
% the local version of \texttt{CurrentPage} can be used, |\theCurrentPageLocal|,
% see subsection~\ref{CurrentPageLocal}.\\
%
% \subsection{\xpackage{papermas}(s) package\label{ss:papermas}}
% There is a kind of an add-on to this package, the \xpackage{papermas}
% package, which can be used to compute the number of sheets of paper
% needed to print a document (you can print more than one page of a
% document on one sheet of paper) as well as the approximate mass
% of the printout. Please see the \ref{ss:Downloads} subsection.
%
% \newpage
%
% \section{A few warnings\label{sec:warn}}
%
% \subsection{Hyperref and repeated page numbers}
%
% When two (or more) different page numbering schemes are used, or the page number
% is reset, or for any other reason there are two pages with the same number
% (maybe in different format, e.\,g. $1$ and \textsc{I}), and \xpackage{hyperref} has
% not been configured right, this can cause problems. Use \xpackage{hyperref} with
% \texttt{plainpages=false} and \texttt{pdfpagelabels=true}, and everything should
% be fine.\\
% More details can be found at
% \ \url{http://www.tex.ac.uk/cgi-bin/texfaq2html?label=pdfpagelabels}.
%
% \subsection{\texttt{\textbackslash AtEndDocument}\label{ssec:aed}}
%
% \indent The output of a \LaTeXe\ run is not independent of the order
% in which packages are loaded. It is often the case that the same
% formats for which one must put tables and figure at the end,
% are the ones in which endnotes are also required.
% If one wants to use |\AtEndDocument| here as well (as done for
% |\lastpageref{LastPage}|), then it is easy to get to three separate
% uses of |\AtEndDocument| (assuming one uses this for the endnotes
% as well). Clearly it is not safe for any package writer or user
% to assume that no material will follow what they put into
% |\AtEndDocument|. Therefore a message, which begins with
% \texttt{AED}, is included in every usage of |\AtEndDocument|,
% and it is tried to minimize any side effects the usage may have.\\
%
% As now \textsc{Heiko Oberdiek}'s \texttt{atveryend} package is used,
% the references |\lastpageref{VeryLastPage}| and \newline
% |\lastpageref{LastPages}| should work all right. About how to get the
% \texttt{atveryend} package, please see subsection~\ref{ss:Downloads}.
%
% \subsection{Interaction with very old versions of the \xpackage{endfloat} %
%  package\label{sec:endfloat}}
%
% \indent The \emph{very} old version~2.0 (and earlier) of the \xpackage{endfloat}
% package actually redefined the |\enddocument| command,
% and so interfered drastically with the \LaTeXe\ commands which make use
% of |\AtEndDocument|. Newer versions of \xpackage{endfloat} exist
% (at the time of writing this documentation: v2.5d as of 2011/12/25)
% in modern documentation form, which should be available from
% the same source where you received this file, see subsection~\ref{ss:Downloads}.\\
% A note is placed in the style file at the |\RequirePackage| section,
% and later it is even checked whether a (very) old \xpackage{endfloat}
% package is in use. If it is, a warning or even an error message
% is given, depending on \xpackage{endfloat} version.
% This assumes, that the old versions of \xpackage{endfloat} at least gave
% a version date, of course.\\
% If you want your \texttt{LastPage} to label the last page of
% these end floats, you need to load \xpackage{pageslts} \emph{after}
% loading \xpackage{endfloat}, or to use \texttt{VeryLastPage} instead.
% If, on the other hand, you \emph{want} \texttt{LastPage} to refer
% to the (not so) last page, exclusive of the floats at the end,
% then load in the reverse order. Independent from the order of
% \xpackage{pageslts} and \xpackage{endfloat}, you will still need the
% modified\footnote{New versions are available for over $15$~years now,
% so it might be time to update, if you did not do it already.} version of
% \xpackage{endfloat}.\\
% Using the
% \nolinebreak{\texttt{LastPage}\textbf{\underline{s}}\ (\textit{s}!)}\ label
% should get you to the last page in all cases: |\lastpageref{LastPages}|.\\
%
% Other \LaTeX209\ (!) packages also seem to like to redefine
% |\enddocument|. In addition to the old \xpackage{endfloat},
% \xpackage{harvard} comes to mind. All of these will need to be
% modified swiftly. \textbf{If possible, update to \LaTeXe{}!}
%
% \pagebreak
%
% \subsection{\xpackage{showkeys} package\label{ssec:showkeys}}
%
% When the \xpackage{showkeys} package has been loaded in \texttt{draft} mode,
% in the margin for each label a~box is displayed with the name of the label.
% \xpackage{showkeys} accomplishes this by redefining |\label|, but
% \xpackage{pageslts} does not use |\label|, but writes directly to the
% {\nobreak |\jobname|\xfile{.aux}-}\allowbreak file, and this is generally done
% \emph{after} the according page has shipped out, therefore no box can be placed
% on the \emph{preceding} page. At~least \xpackage{pageslts} gives a warning, that
% \xpackage{showkeys} cannot present the respective label.
%
% \subsection{\xpackage{lastpage} package\label{ssec:lastpage}}
%
% This package first started as a revision of the \xpackage{lastpage}
% package of \textsc{Jeffrey P. Goldberg} (jeffrey+news at goldmark dot org),
% but it became obvious that a replacement was needed to accomplish what this
% package does. For backward compatibility, a~label named |LastPage| is provided.
% Thus |\usepackage{lastpage}| can be replaced by\\
% |\usepackage[pagecontinue=false,%|\newline
% |alphMult=0,AlphMulti=0,fnsymbolmult=false,romanMult=false,RomanMulti=false]{pageslts}|,\\
% if the behaviour of the \xpackage{lastpage} package should be simulated.
% Using \textbf{old}~(!) versions of the \xpackage{lastpage} before the \xpackage{pageslts}
% before the \xpackage{hyperref} [2012/11/06 v6.83m]
% package results in multiply definitions of the |LastPage| label.
% While the \xpackage{pageslts} package cancels the command |\lastpage@putlabel|
% from the old \xpackage{lastpage} package (because it does this itself, and better),
% \xpackage{hyperref} redefines |\lastpage@putlabel| and thereby reintroduces it again
% (\xpackage{hyperref} should probably check for the version of the \xpackage{lastpage}
% package and/or whether the \xpackage{pageslts} package was also loaded.)
%
% \subsection{Using an unknown page numbering scheme\label{sec:unknown}}
%
% \indent I do not know whether \LaTeXe\ can handle another page numbering
% scheme (e.\,g.~Hebraic), but if you want to use it, this should be
% no problem for the \xpackage{pageslts} package. But the original
% |\pagenumbering{...}| as well as the \xpackage{hyperref} package
% (if~used) might want to vote against it, especially when used together
% with the \xpackage{pageslts} package. Especially especially
% (\textit{sic}!) if the last page uses this new page numbering scheme,
% you should check everything double (at least).\\
% (And if the number format is unknown to \LaTeX{}, the pages will have
% no number, and therefore cannot be referenced. You might be able to
% help yourself by using the \xpackage{hyperref} package and
% manually placing |\hypertarget|s and |\href|s.)
%
% \subsection{Page counter overflow\label{ss:overflow}}
%
% \indent Without the use of the \xpackage{alphalph} package, the\\
% \textquotedblleft ranges of supported counter values are more or less
% restricted. Only \cs{arabic} can be used with any counter
% value \TeX\ supports.
% \begin{quote}
% \catcode`\|=12 %
% \begin{tabular}{@{}l|l|l|l@{}}
% Presentation & Supported & Ignored & Error message\\
% command      & domain    & values  & `Counter too large'\\
% \hline
% \cs{arabic}
%   & \ttfamily -MAX..MAX & &\\
% \cs{roman}, \cs{Roman}
%   & \ttfamily 1..MAX & \ttfamily -MAX..0 &\\
% \cs{alph}, \cs{Alph}
%   & \ttfamily 1..26 & 0 & \ttfamily -MAX..-1, 27..MAX\\
% \cs{fnsymbol}
%   & \ttfamily 1..9 & 0 & \ttfamily -MAX..-1, 10..MAX\\
% \hline
% \end{tabular}\\[1ex]
% \texttt{MAX} = \texttt{2147483647}
% \end{quote}
% \textquotedblright{} (\textsc{Heiko Oberdiek}:
% The \xpackage{alphalph} package, 2010/04/18, v2.3, first table, p.~2).\\
% Please see subsubsections~\ref{sss:alphalph} and \ref{sss:romanMult} for
% instructions how to overcome these limitations.
%
% \newpage
%
% \subsection{Using the \xpackage{fnsymbol} page numbering scheme\label{ss:fnsymbol}}
%
% \indent Using the \texttt{fnsymbol} page numbering scheme can result in
% problems -- big ones!\\
% \textbf{When using this page numbering scheme, it is very important to use}
% \ |\lastpageref{...}| \textbf{instead of}\ |\pageref{...}| \textbf{for any%
% link to any label provided by the \xpackage{pageslts} package.}\\
% While the \xpackage{pageslts} package tries really very hard to circumvent
% any problem, other packages might screw up -- and quite totally for that.
% So,~you have been warned!\\
%
% \begin{description}
% \item[-] There can be a counter overflow, see preceding subsection~\ref{ss:overflow}.
%
% \item[-] Adobe Reader DC 2015.008.20082 does not show the correct page names
% for all pages with \texttt{fnsymbol} page numbering scheme (see the example file),
% while at least the (\ldots\ of \ldots )  part of the page number is displayed correctly
% (see page~\pageref{logical page numbers}, tip about logical page numbers).
% When the \xpackage{alphalph} package and the \xpackage{pageslts} package with
% |fnsymbolmult| option are used, more page names are presented correctly by the Reader.
% (Adobe Reader~X even got all pages right.)
% \end{description}
%
% \newpage
%
% \section{Alternatives\label{sec:Alternatives}}
%
% There are similar packages, which do (or do not) similar things. As I
% neither know what exactly you want to accomplish when using this package
% (e.\,g.~page number vs. page name, hyperlinks or not), nor what resources
% you have (e.\,g.~\eTeX{}), here is a list of some possible alternatives:\\
%
% \DescribeMacro{LastPage}
% \begin{description}
% \item[-] The \xpackage{LastPage} package also provides the
%  \texttt{LastPage} label (but not \texttt{VeryLastPage} or
%  \texttt{LastPages}). If you only want this and have a quite
%  limited amount of \TeX\ resources, you might want to use that
%  package instead.
%
% \item[-] If \LaTeX2.09\ is still used, and if you are unable
%  to switch to \LaTeXe{}, the \LaTeX2.09{} compatible
%  \xpackage{lastpage209.sty} can be used (which is also contained
%  in the recent \xpackage{LastPage} package).
% \end{description}
%
% \DescribeMacro{totpages}
% \begin{description}
% \item[-] The \xpackage{totpages} package provides a
%  \texttt{totpages} label similar to \texttt{LastPages},
%  but |\AtEndDocument| instead of |\AfterLastShipout|. Therefore
%  you should stay with \xpackage{pageslts}. The \xpackage{totpages}
%  package additionally computes the number of paper sheets needed to
%  (double) print the document (with one, two, three,\ldots\ pages
%  on one sheet of paper). This can also be accomplished with the
%  \xpackage{papermas} package.
% \end{description}
%
% \DescribeMacro{totcount}
% \begin{description}
% \item[-] The \xpackage{totcount} package provides the last value
%  of a counter, thus also the value of the \texttt{page} counter.
%  You do not get a hyperlink to the last page, only the numerical
%  value of the last page name is given (i.\,e. X+72 pages gives 72
%  instead of 82 as total number of pages), and the number of pages
%  can be changed e.\,g. by |\addtocounter|.
% \end{description}
%
% \DescribeMacro{nofm}
% \begin{description}
% \item[-] \textquotedblleft There is a package \xpackage{nofm.sty}
%  available, but some versions of it are defective, and most don't
%  work with \xpackage{fancyhdr} because they take over the complete
%  page layout.\textquotedblright{} (\textsc{Piet van Oostrum}:
%  Page layout in \LaTeX{}, March~2, 2004, section~16; fancyhdr.pdf)\\
%  \xpackage{nofm} as of 1991/02/25 (without version number), available at\\
%  \url{http://mirror.ctan.org/obsolete/macros/latex209/contrib/misc/nofm.sty},\\
%  does not work with e.\,g. \xpackage{hyperref}, redefines |\enddocument|
%  as well as |\@oddhead|, |\@evenhead|, |\@oddfoot|, and |\@evenfoot|.\\
%  If you know the (\url{https://www.CTAN.org}) location of a%
%  \textbf{working}~(!) version, please send me an e-mail, thanks!
% \end{description}
%
% \DescribeMacro{count1to}
% \begin{description}
% \item[-] You may want to have a look at the \xpackage{count1to} package.
% \end{description}
%
% \DescribeMacro{zref}
% \begin{description}
% \item[-] The \xpackage{zref} package of \textsc{Heiko Oberdiek} requires
%  \eTeX . \xpackage{pageslts} does not require \eTeX , but if you
%  already have \eTeX , you may have a look at the extensive
%  \xpackage{zref} package, whether it suits your needs better
%  (or additionally or whatsoever).
% \end{description}
%
% \bigskip
%
% \noindent (You programmed or found another alternative,
%  which is available at \url{https://www.CTAN.org}?\\
%  OK, send an e-mail to me with the name, location at CTAN,
%  and a short notice, and I will probably include it in the list above.)\\
%
% \smallskip
%
% \noindent About how to get those packages, please see subsection~\ref{ss:Downloads}.
%
% \newpage
%
% \section{Example}
%
%    \begin{macrocode}
%<*example>
\documentclass[british]{article}[2014/09/29]% v1.4h
\usepackage{lipsum}[2014/07/27]%              v1.3
\usepackage[draft]{showkeys}[2014/10/28]%     v3.17
%%      Use final instead of draft to hide the keys. %%
\usepackage{hyperref}[2012/11/06]%            v6.83m
\hypersetup{%
 extension=pdf,%
 plainpages=false,%
 pdfpagelabels=true,%
 hyperindex=false,%
 pdflang={en},%
 pdftitle={pageslts package example},%
 pdfauthor={Hans-Martin Muench},%
 pdfsubject={Example for the pageslts package},%
 pdfkeywords={LaTeX, pageslts, H.-Martin Muench},%
 pdfview=Fit,%
 pdfstartview=Fit,%
 pdfpagelayout=SinglePage,%
 bookmarksopen=true%
}
\usepackage[pagecontinue=true,alphMult=ab,AlphMulti=AB,fnsymbolmult=true,%
 romanMult=true,RomanMulti=true]{pageslts}[2015/12/21]% v1.2f
%% These are the default options. %%

\makeatletter
  \renewcommand{\@evenfoot}%
   {Page \thepage\ (\theCurrentPage; local: \theCurrentPageLocal) of %
    \lastpageref{pagesLTS.roman}(\lastpageref{pagesLTS.roman.local}) + %
    \lastpageref{pagesLTS.Roman}(\lastpageref{pagesLTS.Roman.local}) + %
    \lastpageref{pagesLTS.arabic}(\lastpageref{pagesLTS.arabic.local}) + %
    \lastpageref{pagesLTS.fnsymbol}(\lastpageref{pagesLTS.fnsymbol.local}) + %
    \lastpageref{pagesLTS.alph}(\lastpageref{pagesLTS.alph.local}) + %
    \lastpageref{pagesLTS.Alph}(\lastpageref{pagesLTS.Alph.local}) = %
    \lastpageref{LastPages} pages.%
   }
  \renewcommand{\@oddfoot}{\@evenfoot}
  \def\pagesLTSexampleArabic{3}
  \def\pagesLTSexamplealph{23}
  \gdef\unit#1{\mathord{\thinspace\mathrm{#1}}}%
\makeatother

\listfiles

\begin{document}
\pagenumbering{roman}
%% Note the first \pagenumbering immediately behind \begin{document}! %%
%%\addtocounter{page}{-2} %%

\section*{Example for pageslts}
\addcontentsline{toc}{section}{Example for pageslts}
\markboth{Example for pageslts}{Example for pageslts}

This example demonstrates the most common uses of package\\
\textsf{pageslts}, v1.2f as of 2015/12/21 (HMM).\\
The used options were \texttt{pagecontinue=true},
\texttt{alphMult=ab}, \texttt{AlphMulti=AB}, \linebreak
\texttt{fnsymbolmult=true},
\texttt{romanMult=true}, and \texttt{RomanMulti=true}
(the default ones).\\
For more details please see the documentation!\\

\label{keys} To hide the \pageref{keys}{\qquad } use option
\texttt{final} instead of \texttt{draft} with the \textsf{showkeys}
package (or remove the package call from the preamble of
this document).\\

\textbf{Hyperlinks or not:} If the \textsf{hyperref} package is loaded,
the references are also hyperlinked:\\
\smallskip
Page \thepage\ (\theCurrentPage; local: \theCurrentPageLocal) of %
\lastpageref{pagesLTS.roman}(\lastpageref{pagesLTS.roman.local}) + %
\lastpageref{pagesLTS.Roman}(\lastpageref{pagesLTS.Roman.local}) + %
\lastpageref{pagesLTS.arabic}(\lastpageref{pagesLTS.arabic.local}) + %
\lastpageref{pagesLTS.fnsymbol}(\lastpageref{pagesLTS.fnsymbol.local}) + %
\lastpageref{pagesLTS.alph}(\lastpageref{pagesLTS.alph.local}) + %
\lastpageref{pagesLTS.Alph}(\lastpageref{pagesLTS.Alph.local}) = %
\lastpageref{LastPages} pages.\\
If the \textsf{hyperref} package is loaded, but the hyperlinks of the
references shall be suppressed, \verb|\pageref*{...}|
and \verb|\lastpageref*{...}| can be used:\\
Page \thepage\ (\theCurrentPage; local: \theCurrentPageLocal) of %
\lastpageref*{pagesLTS.roman}(\lastpageref*{pagesLTS.roman.local}) + %
\lastpageref*{pagesLTS.Roman}(\lastpageref*{pagesLTS.Roman.local}) + %
\lastpageref*{pagesLTS.arabic}(\lastpageref*{pagesLTS.arabic.local}) + %
\lastpageref*{pagesLTS.fnsymbol}(\lastpageref*{pagesLTS.fnsymbol.local}) + %
\lastpageref*{pagesLTS.alph}(\lastpageref*{pagesLTS.alph.local}) + %
\lastpageref*{pagesLTS.Alph}(\lastpageref*{pagesLTS.Alph.local}) = %
\lastpageref*{LastPages} pages.\\


\textbf{Trademarks} appear throughout this example without any
trademark symbol; they are the property of their respective
trademark owner. There is no intention of infringement; the
usage is to the benefit of the trademark owner.\\

\textbf{Tip}: Use \textit{logical page numbers}
for the display of the pdf (in Adobe Reader DC 2015.008.20082:
Edit $>$ Preferences $>$ Categories: Page Display $>$
Page Content and Information: Use logical page numbers)!\\

You want negative page numbers? Not only arabic, but even roman,
Roman, alph, Alph or fnsymbol ones? No problem, e.\,g. just give a\\
\verb|\addtocounter{page}{|-\textit{some number}\verb|}| in the
source code of this example file (or uncomment the prepared line)!

\bigskip

Save per page about $200\unit{ml}$ water, $2\unit{g}$ CO$_{2}$
and $2\unit{g}$ wood:\\
Therefore please print only if this is really necessary.

\pagebreak

\tableofcontents

\newpage

\pagenumbering{roman}
%% in case the page numbering is changed before,
%% otherwise pagesLTS.current.local.roman on this page
%% would be undefined

\section{roman}

\noindent (\texttt{roman} page numbering was started before,
because the page numbering scheme was needed to start at
the first page, of course.)\\

\noindent First page (\verb|\lastpageref{pagesLTS.0}|):
\lastpageref{pagesLTS.0}\\

\noindent The page (\verb|\thepage|): \thepage \\

\noindent Current page (\verb|\theCurrentPage|),
i.\,e. counted continuously from the first page): \theCurrentPage \\
You can get this also in other formats:
\roman{CurrentPage}, \Roman{CurrentPage}, \arabic{CurrentPage},
\fnsymbol{CurrentPage}, \alph{CurrentPage}, \Alph{CurrentPage}.

\noindent CurrentPageLocal (\verb|\theCurrentPageLocal|),
i.\,e. counted continuously from the first page of the
current page numbering scheme): \theCurrentPageLocal \\
You can get also this in other formats, too:
\roman{pagesLTS.current.local.roman}, \Roman{pagesLTS.current.local.roman},
\arabic{pagesLTS.current.local.roman}, \fnsymbol{pagesLTS.current.local.roman},
\alph{pagesLTS.current.local.roman}, \Alph{pagesLTS.current.local.roman},
but probably it only makes sense if page numbering scheme and format are
the same, e.\,g.\\
\verb|\Roman{pagesLTS.current.local.Roman}|\\
or \verb|\Alph{pagesLTS.current.local.Alph}|. \verb|\arabic{...}| could
make sense even if combined with another page numbering scheme.
And this is exactly what \verb|\theCurrentPageLocal| does:\\
\nolinebreak{\verb|\def\theCurrentPageLocal{\arabic{pagesLTS.current.local.\pagesLTS@pnc}}|.}\\

\noindent Last roman page (pagesLTS.roman): \lastpageref{pagesLTS.roman}{\hskip4em }
(There are \lastpageref{pagesLTS.roman.local} pages with roman numbers.)\\

\noindent Last Roman page (pagesLTS.Roman): \lastpageref{pagesLTS.Roman}{\hskip3em }
(There are \lastpageref{pagesLTS.Roman.local}~pages with Roman numbers:\\
\lastpages{Roman}{1}~pages in the first Roman sector
(\pageref{Roman}{\hskip3em }-\lastpageref{pagesLTS.Roman.1}{\hskip3em }),\\
\lastpages{Roman}{2}~pages in the second Roman sector
(\pageref{Roman2}{\hskip3em }-\lastpageref{pagesLTS.Roman.2}{\hskip3em }), and\\
\lastpages{Roman}{3}~pages in the third Roman sector
(\pageref{Roman3}{\hskip3em }-\lastpageref{pagesLTS.Roman.3}{\hskip3em }).\\

When the option \texttt{pagecontinue=false} is used with the
\textsf{pageslts} package, the \verb|\lastpageref{pagesLTS.Roman}| will
point to the same page as before, but this will have a lower number.\\
The \verb|\lastpageref{pagesLTS.Roman.local}| will not change,
because the number of pages does not change (only the page numbers).\\

\noindent Last arabic page (pagesLTS.arabic): \lastpageref{pagesLTS.arabic}{\hskip5em }
(There are only \lastpageref{pagesLTS.arabic.local} pages with arabic numbers,
because an \verb|\addtocounter{page}{|\pagesLTSexampleArabic\verb|}| was used.)\\

\noindent Last fnsymbol page (pagesLTS.fnsymbol): \lastpageref{pagesLTS.fnsymbol} \\
(\verb|\lastpageref{pagesLTS.fnsymbol}| -- never \verb|\pageref{pagesLTS.fnsymbol}|!)\\
(There are \lastpageref{pagesLTS.fnsymbol.local} pages with fnsymbol numbers.)\\

\noindent Last alph page (pagesLTS.alph): \lastpageref{pagesLTS.alph}{\hskip4em }
(There are only \lastpageref{pagesLTS.alph.local} pages with alph numbers,
because an \verb|\addtocounter{page}{|\pagesLTSexamplealph\verb|}| was used.)\\

\noindent Last Alph page (pagesLTS.Alph): \lastpageref{pagesLTS.Alph}{\hskip4em }
(There are \lastpageref{pagesLTS.Alph.local} pages with Alph numbers.)\\

\noindent Last page's \textit{name} (LastPage): \lastpageref{LastPage}\\

\noindent Very last page's \textit{name} (VeryLastPage): \lastpageref{VeryLastPage}\\
(\texttt{lastpage} and \texttt{VeryLastPage} are identical, unless
a package with output \linebreak
\verb|\AtEndDocument| after the \textsf{pageslts} package was added.)\\

\noindent Last page's \textit{number} (LastPages): \lastpageref{LastPages}{\hskip3em }
(=~total number of pages)\\

\lipsum[1-3]

\newpage

\pagenumbering{Roman}

\section{Roman\label{Roman}}
\subsection{Common Roman page numbering}

\noindent First page (\verb|\lastpageref{pagesLTS.0}|):
\lastpageref{pagesLTS.0}\\

\noindent The page (\verb|\thepage|): \thepage \\

\noindent Current page (\verb|\theCurrentPage|),
i.\,e. counted continuously from the first page): \theCurrentPage \\

\noindent CurrentPageLocal (\verb|\theCurrentPageLocal|),
i.\,e. counted continuously from the first page of the
current page numbering scheme): \theCurrentPageLocal \\

\noindent Last roman page (pagesLTS.roman): \lastpageref{pagesLTS.roman}{\hskip4em }
(There are \lastpageref{pagesLTS.roman.local} pages with roman numbers.)\\

\noindent Last Roman page (pagesLTS.Roman): \lastpageref{pagesLTS.Roman}{\hskip3em }
(There are \lastpageref{pagesLTS.Roman.local}~pages with Roman numbers:\\
\lastpages{Roman}{1}~pages in the first Roman sector
(\pageref{Roman}{\hskip3em }-\lastpageref{pagesLTS.Roman.1}{\hskip3em }),\\
\lastpages{Roman}{2}~pages in the second Roman sector
(\pageref{Roman2}{\hskip3em }-\lastpageref{pagesLTS.Roman.2}{\hskip3em }), and\\
\lastpages{Roman}{3}~pages in the third Roman sector
(\pageref{Roman3}{\hskip3em }-\lastpageref{pagesLTS.Roman.3}{\hskip3em }).\\

\noindent Last arabic page (pagesLTS.arabic): \lastpageref{pagesLTS.arabic}{\hskip5em }
(There are only \lastpageref{pagesLTS.arabic.local} pages with arabic numbers,
because an \verb|\addtocounter{page}{|\pagesLTSexampleArabic\verb|}| was used.)\\

\noindent Last fnsymbol page (pagesLTS.fnsymbol): \lastpageref{pagesLTS.fnsymbol} \\
(\verb|\lastpageref{pagesLTS.fnsymbol}| -- never \verb|\pageref{pagesLTS.fnsymbol}|!)\\
(There are \lastpageref{pagesLTS.fnsymbol.local} pages with fnsymbol numbers.)\\

\noindent Last alph page (pagesLTS.alph): \lastpageref{pagesLTS.alph}{\hskip4em }
(There are only \lastpageref{pagesLTS.alph.local} pages with alph numbers,
because an \verb|\addtocounter{page}{|\pagesLTSexamplealph\verb|}| was used.)\\

\noindent Last Alph page (pagesLTS.Alph): \lastpageref{pagesLTS.Alph}{\hskip4em }
(There are \lastpageref{pagesLTS.Alph.local} pages with Alph numbers.)\\

\noindent Last page's \textit{name} (LastPage): \lastpageref{LastPage}\\

\noindent Very last page's \textit{name} (VeryLastPage): \lastpageref{VeryLastPage}\\
(\texttt{LastPage} and \texttt{VeryLastPage} are identical, unless
a package with output \linebreak
\verb|\AtEndDocument| after the \textsf{pageslts} package was added.)\\

\noindent Last page's \textit{number} (LastPages): \lastpageref{LastPages}{\hskip3em }
(=~total number of pages)\\

\lipsum[1-4]

\newpage

\subsection{Last page of first Roman sector}
\verb|\lastpageref{pagesLTS.Roman}| does \textbf{not}
refer to this page (but there: \lastpageref{pagesLTS.Roman}),
because the option \texttt{pagecontinue=true}
was chosen. When a reference to this page is wanted,\\
\verb|\lastpageref{pagesLTS.Roman.1}| can be used: \lastpageref{pagesLTS.Roman.1}.\\

\bigskip
There are \lastpages{Roman}{1}~pages (\verb|\lastpages{Roman}{1}|)
in this first Roman sector.\\
The Roman page numbering scheme is continued later in section~\ref{Roman2})!

\newpage

\pagenumbering{arabic}

\section{arabic}

\subsection{Standard page numbering}

\noindent First page (\verb|\lastpageref{pagesLTS.0}|):
\lastpageref{pagesLTS.0}\\

\noindent The page (\verb|\thepage|): \thepage \\

\noindent Current page (\verb|\theCurrentPage|),
i.\,e. counted continuously from the first page): \theCurrentPage \\

\noindent CurrentPageLocal (\verb|\theCurrentPageLocal|),
i.\,e. counted continuously from the first page of the
current page numbering scheme): \theCurrentPageLocal \\

\noindent Last roman page (pagesLTS.roman): \lastpageref{pagesLTS.roman}{\hskip4em }
(There are \lastpageref{pagesLTS.roman.local} pages with roman numbers.)\\

\noindent Last Roman page (pagesLTS.Roman): \lastpageref{pagesLTS.Roman}{\hskip3em }
(There are \lastpageref{pagesLTS.Roman.local}~pages with Roman numbers:\\
\lastpages{Roman}{1}~pages in the first Roman sector
(\pageref{Roman}{\hskip3em }-\lastpageref{pagesLTS.Roman.1}{\hskip3em }),\\
\lastpages{Roman}{2}~pages in the second Roman sector
(\pageref{Roman2}{\hskip3em }-\lastpageref{pagesLTS.Roman.2}{\hskip3em }), and\\
\lastpages{Roman}{3}~pages in the third Roman sector
(\pageref{Roman3}{\hskip3em }-\lastpageref{pagesLTS.Roman.3}{\hskip3em }).\\

\noindent Last arabic page (pagesLTS.arabic): \lastpageref{pagesLTS.arabic}{\hskip5em }
(There are only \lastpageref{pagesLTS.arabic.local} pages with arabic numbers,
because an \verb|\addtocounter{page}{|\pagesLTSexampleArabic\verb|}| was used.)\\

\noindent Last fnsymbol page (pagesLTS.fnsymbol): \lastpageref{pagesLTS.fnsymbol} \\
(\verb|\lastpageref{pagesLTS.fnsymbol}| -- never \verb|\pageref{pagesLTS.fnsymbol}|!)\\
(There are \lastpageref{pagesLTS.fnsymbol.local} pages with fnsymbol numbers.)\\

\noindent Last alph page (pagesLTS.alph): \lastpageref{pagesLTS.alph}{\hskip4em }
(There are only \lastpageref{pagesLTS.alph.local} pages with alph numbers,
because an \verb|\addtocounter{page}{|\pagesLTSexamplealph\verb|}| was used.)\\

\noindent Last Alph page (pagesLTS.Alph): \lastpageref{pagesLTS.Alph}{\hskip4em }
(There are \lastpageref{pagesLTS.Alph.local} pages with Alph numbers.)\\

\noindent Last page's \textit{name} (LastPage): \lastpageref{LastPage}\\

\noindent Very last page's \textit{name} (VeryLastPage): \lastpageref{VeryLastPage}\\
(\texttt{LastPage} and \texttt{VeryLastPage} are identical, unless
a package with output \linebreak
\verb|\AtEndDocument| after the \textsf{pagesLTS} package was added.)\\

\noindent Last page's \textit{number} (LastPages): \lastpageref{LastPages}{\hskip3em }
(=~total number of pages)\\

\lipsum[1-4]
\newpage

\subsection[Empty page style]{Also an empty page style is no problem %
for the current or total page count}

\bigskip

\thispagestyle{empty}

\noindent First page (\verb|\lastpageref{pagesLTS.0}|):
\lastpageref{pagesLTS.0}\\

\noindent The page (\verb|\thepage|): \thepage \\

\noindent Current page (\verb|\theCurrentPage|),
i.\,e. counted continuously from the first page): \theCurrentPage \\

\noindent CurrentPageLocal (\verb|\theCurrentPageLocal|),
i.\,e. counted continuously from the first page of the
current page numbering scheme): \theCurrentPageLocal \\

\noindent Last roman page (pagesLTS.roman): \lastpageref{pagesLTS.roman}{\hskip4em }
(There are \lastpageref{pagesLTS.roman.local} pages with roman numbers.)\\

\noindent Last Roman page (pagesLTS.Roman): \lastpageref{pagesLTS.Roman}{\hskip3em }
(There are \lastpageref{pagesLTS.Roman.local}~pages with Roman numbers:\\
\lastpages{Roman}{1}~pages in the first Roman sector
(\pageref{Roman}{\hskip3em }-\lastpageref{pagesLTS.Roman.1}{\hskip3em }),\\
\lastpages{Roman}{2}~pages in the second Roman sector
(\pageref{Roman2}{\hskip3em }-\lastpageref{pagesLTS.Roman.2}{\hskip3em }), and\\
\lastpages{Roman}{3}~pages in the third Roman sector
(\pageref{Roman3}{\hskip3em }-\lastpageref{pagesLTS.Roman.3}{\hskip3em }).\\

\noindent Last arabic page (pagesLTS.arabic): \lastpageref{pagesLTS.arabic}{\hskip5em }
(There are only \lastpageref{pagesLTS.arabic.local} pages with arabic numbers,
because an \verb|\addtocounter{page}{|\pagesLTSexampleArabic\verb|}| was used.)\\

\noindent Last fnsymbol page (pagesLTS.fnsymbol): \lastpageref{pagesLTS.fnsymbol} \\
(\verb|\lastpageref{pagesLTS.fnsymbol}| -- never \verb|\pageref{pagesLTS.fnsymbol}|!)\\
(There are \lastpageref{pagesLTS.fnsymbol.local} pages with fnsymbol numbers.)\\

\noindent Last alph page (pagesLTS.alph): \lastpageref{pagesLTS.alph}{\hskip4em }
(There are only \lastpageref{pagesLTS.alph.local} pages with alph numbers,
because an \verb|\addtocounter{page}{|\pagesLTSexamplealph\verb|}| was used.)\\

\noindent Last Alph page (pagesLTS.Alph): \lastpageref{pagesLTS.Alph}{\hskip4em }
(There are \lastpageref{pagesLTS.Alph.local} pages with Alph numbers.)\\

\noindent Last page's \textit{name} (LastPage): \lastpageref{LastPage}\\

\noindent Very last page's \textit{name} (VeryLastPage): \lastpageref{VeryLastPage}\\
(\texttt{LastPage} and \texttt{VeryLastPage} are identical, unless
a package with output \linebreak
\verb|\AtEndDocument| after the \textsf{pageslts} package was added.)\\

\noindent Last page's \textit{number} (LastPages): \lastpageref{LastPages}{\hskip3em }
(=~total number of pages)\\

\lipsum[1-4]

\newpage

\subsection[addtocounter, setcounter]{Neither %
\texttt{\textbackslash addtocounter\{page\}} nor %
\texttt{\textbackslash setcounter\{page\}} is a problem for the %
current or total page numbers}

(Here is an \verb|\addtocounter{page}{|\pagesLTSexampleArabic\verb|}|
in the source code.)\\
\addtocounter{page}{\pagesLTSexampleArabic}

\noindent The page (from \verb|\thepage| command): \thepage \\

\noindent Current page (from \verb|\theCurrentPage|\ %
command), i.\,e. counted continuously from the first page): \theCurrentPage \\

\noindent CurrentPageLocal (from \verb|\theCurrentPageLocal|\ %
command), i.\,e. counted continuously from the first page of the
current page numbering scheme): \theCurrentPageLocal\\

\noindent Last page's number (LastPages): \lastpageref{LastPages}{\hskip3em }
(= total number of pages)\\

\lipsum[1-7]

\newpage

\pagenumbering{fnsymbol}

\section{fnsymbol}

Adobe Reader DC 2015.008.20082 does not show the correct page names
for all pages with \texttt{fnsymbol} page numbering scheme,
while at least the (\ldots\ of \ldots )  part of the page number is displayed correctly.
(Adobe Reader~X even got all pages right.)

\bigskip

Without option \texttt{fnsymbolmult=true} of the \textsf{pageslts} package
(and the help of \textsc{Heiko Oberdiek}'s \textsf{alphalph} package),
after page~9 (\textquotedblleft \ensuremath {\ddagger \ddagger }\textquotedblright )
(and also for negative page numbers) there would just appear a
\begin{quote}
\begin{verbatim}
LaTeX Error: Counter too large
See the LaTeX manual or LaTeX Companion for explanation.
You've lost some text.  Try typing  <return>  to proceed.
If that doesn't work, type  X <return>  to quit.
\end{verbatim}
\end{quote}
Now the page numbers after 5 (\ensuremath {\mathparagraph }) are
continued  with the doubled \textquotedblleft number\textquotedblright{} of
the first, second, third,\ldots\ page (\ensuremath {**},
\ensuremath {\dagger \dagger }, \ensuremath {\ddagger \ddagger },
\ensuremath {\mathsection \mathsection },
\ensuremath {\mathparagraph \mathparagraph }),
and after the tenth page the \textquotedblleft number\textquotedblright{} is
tripled (\ensuremath {***}, \ensuremath {\dagger \dagger \dagger },\ldots).
Page zero is named 0 and negative pages just named like the positive ones
with addition of a minus sign~($-$).

\bigskip

\noindent First page (\verb|\lastpageref{pagesLTS.0}|):
\lastpageref{pagesLTS.0}\\

\noindent The page (\verb|\thepage|): \thepage \\

\noindent Current page (\verb|\theCurrentPage|),
i.\,e. counted continuously from the first page): \theCurrentPage \\

\noindent CurrentPageLocal (\verb|\theCurrentPageLocal|),
i.\,e. counted continuously from the first page of the
current page numbering scheme): \theCurrentPageLocal \\

\noindent Last roman page (pagesLTS.roman): \lastpageref{pagesLTS.roman}{\hskip4em }
(There are \lastpageref{pagesLTS.roman.local} pages with roman numbers.)\\

\noindent Last Roman page (pagesLTS.Roman): \lastpageref{pagesLTS.Roman}{\hskip3em }
(There are \lastpageref{pagesLTS.Roman.local}~pages with Roman numbers:\\
\lastpages{Roman}{1}~pages in the first Roman sector
(\pageref{Roman}{\hskip3em }-\lastpageref{pagesLTS.Roman.1}{\hskip3em }),\\
\lastpages{Roman}{2}~pages in the second Roman sector
(\pageref{Roman2}{\hskip3em }-\lastpageref{pagesLTS.Roman.2}{\hskip3em }), and\\
\lastpages{Roman}{3}~pages in the third Roman sector
(\pageref{Roman3}{\hskip3em }-\lastpageref{pagesLTS.Roman.3}{\hskip3em }).\\

\noindent Last arabic page (pagesLTS.arabic): \lastpageref{pagesLTS.arabic}{\hskip5em }
(There are only \lastpageref{pagesLTS.arabic.local} pages with arabic numbers,
because an \verb|\addtocounter{page}{|\pagesLTSexampleArabic\verb|}| was used.)\\

\noindent Last fnsymbol page (pagesLTS.fnsymbol): \lastpageref{pagesLTS.fnsymbol} \\
(\verb|\lastpageref{pagesLTS.fnsymbol}| -- never \verb|\pageref{pagesLTS.fnsymbol}|!)\\
(There are \lastpageref{pagesLTS.fnsymbol.local} pages with fnsymbol numbers.)\\

\noindent Last alph page (pagesLTS.alph): \lastpageref{pagesLTS.alph}{\hskip4em }
(There are only \lastpageref{pagesLTS.alph.local} pages with alph numbers,
because an \verb|\addtocounter{page}{|\pagesLTSexamplealph\verb|}| was used.)\\

\noindent Last Alph page (pagesLTS.Alph): \lastpageref{pagesLTS.Alph}{\hskip4em }
(There are \lastpageref{pagesLTS.Alph.local} pages with Alph numbers.)\\

\noindent Last page's \textit{name} (LastPage): \lastpageref{LastPage}\\

\noindent Very last page's \textit{name} (VeryLastPage): \lastpageref{VeryLastPage}\\
(\texttt{LastPage} and \texttt{VeryLastPage} are identical, unless
a package with output \linebreak
\verb|\AtEndDocument| after the \textsf{pageslts} package was added.)\\

\noindent Last page's \textit{number} (LastPages): \lastpageref{LastPages}{\hskip3em }
(=~total number of pages)\\

\lipsum[1-60]

\newpage

\pagenumbering{Roman}

\section{Roman - again!\label{Roman2}}

The page number would start with \textquotedblleft I\textquotedblright{} again --
but for the \textsf{pageslts} package (with option \texttt{pagecontinue=true},
or with option just \texttt{pagecontinue}, or even just
\nolinebreak{with\textbf{out}} option \texttt{pagecontinue=false}).
This package remembered the (\arabic{pagesLTS.double.Roman}-1)\footnote{%
OK, here you have to compute this value for yourself, but %
subtracting one should be manageable for \TeX{}nicians.} pages already
done in Roman output, and therefore continues with page
\textquotedblleft \thepage \textquotedblright .\\
If you want to start with \textquotedblleft I\textquotedblright{} all
over again, you will have two pages with the same name,
but nevertheless you can do this by using option \texttt{pagecontinue=false}
or a \verb|\setcounter{page}{1}|\ here (not demonstrated in this example file).\\

\noindent First page (\verb|\lastpageref{pagesLTS.0}|):
 \lastpageref{pagesLTS.0}\\

\noindent The page (\verb|\thepage|): \thepage \\

\noindent Current page (\verb|\theCurrentPage|),
i.\,e. counted continuously from the first page): \theCurrentPage \\

\noindent CurrentPageLocal (\verb|\theCurrentPageLocal|),
i.\,e. counted continuously from the first page of the
current page numbering scheme): \theCurrentPageLocal \\

\noindent Last roman page (pagesLTS.roman): \lastpageref{pagesLTS.roman}{\hskip4em }
(There are \lastpageref{pagesLTS.roman.local} pages with roman numbers.)\\

\noindent Last Roman page (pagesLTS.Roman): \lastpageref{pagesLTS.Roman}{\hskip3em }
(There are \lastpageref{pagesLTS.Roman.local}~pages with Roman numbers:\\
\lastpages{Roman}{1}~pages in the first Roman sector
(\pageref{Roman}{\hskip3em }-\lastpageref{pagesLTS.Roman.1}{\hskip3em }),\\
\lastpages{Roman}{2}~pages in the second Roman sector
(\pageref{Roman2}{\hskip3em }-\lastpageref{pagesLTS.Roman.2}{\hskip3em }), and\\
\lastpages{Roman}{3}~pages in the third Roman sector
(\pageref{Roman3}{\hskip3em }-\lastpageref{pagesLTS.Roman.3}{\hskip3em }).\\

\noindent Last arabic page (pagesLTS.arabic): \lastpageref{pagesLTS.arabic}{\hskip5em }
(There are only \lastpageref{pagesLTS.arabic.local} pages with arabic numbers,
because an \verb|\addtocounter{page}{|\pagesLTSexampleArabic\verb|}| was used.)\\

\noindent Last fnsymbol page (pagesLTS.fnsymbol): \lastpageref{pagesLTS.fnsymbol} \\
(\verb|\lastpageref{pagesLTS.fnsymbol}| -- never
\verb|\pageref{pagesLTS.fnsymbol}|!)\\
(There are \lastpageref{pagesLTS.fnsymbol.local} pages with fnsymbol numbers.)\\

\noindent Last alph page (pagesLTS.alph): \lastpageref{pagesLTS.alph}{\hskip4em }
(There are only \lastpageref{pagesLTS.alph.local} pages with alph numbers,
because an \verb|\addtocounter{page}{|\pagesLTSexamplealph\verb|}| was used.)\\

\noindent Last Alph page (pagesLTS.Alph): \lastpageref{pagesLTS.Alph}{\hskip4em }
(There are \lastpageref{pagesLTS.Alph.local} pages with Alph numbers.)\\

\noindent Last page's \textit{name} (LastPage): \lastpageref{LastPage}\\

\noindent Very last page's \textit{name} (VeryLastPage): \lastpageref{VeryLastPage}\\
(\texttt{LastPage} and \texttt{VeryLastPage} are identical, unless
a package with output \linebreak
\verb|\AtEndDocument| after the \textsf{pageslts} package was added.)\\

\noindent Last page's \textit{number} (LastPages): \lastpageref{LastPages}{\hskip3em }
(=~total number of pages)\\

\lipsum[1-6]

\newpage

\verb|\lastpageref{pagesLTS.Roman}| does \textbf{not}
refer to this page (but there: \lastpageref{pagesLTS.Roman}),
because the option \texttt{pagecontinue=true}
was chosen. When a reference to this page is wanted,\\
\verb|\lastpageref{pagesLTS.Roman.2}| can be used: \lastpageref{pagesLTS.Roman.2}.\\

\bigskip
There are \lastpages{Roman}{2}~pages (\verb|\lastpages{Roman}{2}|) in this
second Roman sector.\\
The Roman page numbering scheme is continued later in section~\ref{Roman3})!

\newpage

\pagenumbering{alph}

\section{alph\label{alph}}

\noindent First page (\verb|\lastpageref{pagesLTS.0}|):
 \lastpageref{pagesLTS.0}\\

\noindent The page (\verb|\thepage|): \thepage \\

\noindent Current page (\verb|\theCurrentPage|),
i.\,e. counted continuously from the first page): \theCurrentPage \\

\noindent CurrentPageLocal (\verb|\theCurrentPageLocal|),
i.\,e. counted continuously from the first page of the
current page numbering scheme): \theCurrentPageLocal \\

\noindent Last roman page (pagesLTS.roman): \lastpageref{pagesLTS.roman}{\hskip4em }
(There are \lastpageref{pagesLTS.roman.local} pages with roman numbers.)\\

\noindent Last Roman page (pagesLTS.Roman): \lastpageref{pagesLTS.Roman}{\hskip3em }
(There are \lastpageref{pagesLTS.Roman.local}~pages with Roman numbers:\\
\lastpages{Roman}{1}~pages in the first Roman sector
(\pageref{Roman}{\hskip3em }-\lastpageref{pagesLTS.Roman.1}{\hskip3em }),\\
\lastpages{Roman}{2}~pages in the second Roman sector
(\pageref{Roman2}{\hskip3em }-\lastpageref{pagesLTS.Roman.2}{\hskip3em }), and\\
\lastpages{Roman}{3}~pages in the third Roman sector
(\pageref{Roman3}{\hskip3em }-\lastpageref{pagesLTS.Roman.3}{\hskip3em }).\\

\noindent Last arabic page (pagesLTS.arabic): \lastpageref{pagesLTS.arabic}{\hskip5em }
(There are only \lastpageref{pagesLTS.arabic.local} pages with arabic numbers,
because an \verb|\addtocounter{page}{|\pagesLTSexampleArabic\verb|}| was used.)\\

\noindent Last fnsymbol page (pagesLTS.fnsymbol): \lastpageref{pagesLTS.fnsymbol} \\
(\verb|\lastpageref{pagesLTS.fnsymbol}| -- never \verb|\pageref{pagesLTS.fnsymbol}|!)\\
(There are \lastpageref{pagesLTS.fnsymbol.local} pages with fnsymbol numbers.)\\

\noindent Last alph page (pagesLTS.alph): \lastpageref{pagesLTS.alph}{\hskip4em }
(There are only \lastpageref{pagesLTS.alph.local} pages with alph numbers,
because an \verb|\addtocounter{page}{|\pagesLTSexamplealph\verb|}| was used.)\\

\noindent Last Alph page (pagesLTS.Alph): \lastpageref{pagesLTS.Alph}{\hskip4em }
(There are \lastpageref{pagesLTS.Alph.local} pages with Alph numbers.)\\

\noindent Last page's \textit{name} (LastPage): \lastpageref{LastPage}\\

\noindent Very last page's \textit{name} (VeryLastPage): \lastpageref{VeryLastPage}\\
(\texttt{LastPage} and \texttt{VeryLastPage} are identical, unless
a package with output \linebreak
\verb|\AtEndDocument| after the \textsf{pageslts} package was added.)\\

\noindent Last page's \textit{number} (LastPages): \lastpageref{LastPages}{\hskip3em }
(=~total number of pages)\\

\lipsum[1-4]

\newpage

Without option \texttt{alphMult=ab} of the \textsf{pageslts} (and the help of
\textsc{Heiko Oberdiek's} \textsf{alphalph} package), after page
\textquotedblleft z\textquotedblright{} there would just appear a
\begin{quote}
\begin{verbatim}
LaTeX Error: Counter too large
See the LaTeX manual or LaTeX Companion for explanation.
You've lost some text.  Try typing  <return>  to proceed.
If that doesn't work, type  X <return>  to quit.
\end{verbatim}
\end{quote}
Now the page numbers are continued aa, ab, ac,\ldots\ (aa, bb, cc,\ldots\ is
also possible, see the \textsf{pageslts} documentation).\\
To demonstrate this, we add a\\
\verb|\addtocounter{page}{|\pagesLTSexamplealph\verb|}|\\
in the source code here.

\addtocounter{page}{\pagesLTSexamplealph}

\bigskip

\lipsum[1-18]

\newpage

\pagenumbering{Roman}

\section{Roman - third time!\label{Roman3}}

The page number would start with
\textquotedblleft I\textquotedblright{} again -- but
for the \textsf{pageslts} package (with option \texttt{pagecontinue=true},
or with option just \texttt{pagecontinue}, or even just
\nolinebreak{with\textbf{out}} option \texttt{pagecontinue=false}).
This package remembered the
(\arabic{pagesLTS.double.Roman}-1)\footnote{OK, here %
you have to compute this value for yourself, but %
subtracting one should be managable for \TeX nicians.} pages already
done in Roman output, and therefore continues with page
\textquotedblleft \thepage \textquotedblright .\\
If you want to start with \textquotedblleft I\textquotedblright{} all
over again, you will have (at least) two pages with the same name,
but nevertheless you can do this by using option
\texttt{pagecontinue=false} instead of \texttt{pagecontinue=true}
(not demonstrated here).\\

\noindent First page (\verb|\lastpageref{pagesLTS.0}|):
 \lastpageref{pagesLTS.0}\\

\noindent The page (\verb|\thepage|): \thepage \\

\noindent Current page (\verb|\theCurrentPage|),
i.\,e. counted continuously from the first page): \theCurrentPage \\

\noindent CurrentPageLocal (\verb|\theCurrentPageLocal|),
i.\,e. counted continuously from the first page of the
current page numbering scheme): \theCurrentPageLocal \\

\noindent Last roman page (pagesLTS.roman): \lastpageref{pagesLTS.roman}{\hskip4em }
(There are \lastpageref{pagesLTS.roman.local} pages with roman numbers.)\\

\noindent Last Roman page (pagesLTS.Roman): \lastpageref{pagesLTS.Roman}{\hskip3em }
(There are \lastpageref{pagesLTS.Roman.local}~pages with Roman numbers:\\
\lastpages{Roman}{1}~pages in the first Roman sector
(\pageref{Roman}{\hskip3em }-\lastpageref{pagesLTS.Roman.1}{\hskip3em }),\\
\lastpages{Roman}{2}~pages in the second Roman sector
(\pageref{Roman2}{\hskip3em }-\lastpageref{pagesLTS.Roman.2}{\hskip3em }), and\\
\lastpages{Roman}{3}~pages in the third Roman sector
(\pageref{Roman3}{\hskip3em }-\lastpageref{pagesLTS.Roman.3}{\hskip3em }).\\

\noindent Last arabic page (pagesLTS.arabic): \lastpageref{pagesLTS.arabic}{\hskip5em }
(There are only \lastpageref{pagesLTS.arabic.local} pages with arabic numbers,
because an \verb|\addtocounter{page}{|\pagesLTSexampleArabic\verb|}| was used.)\\

\noindent Last fnsymbol page (pagesLTS.fnsymbol): \lastpageref{pagesLTS.fnsymbol} \\
(\verb|\lastpageref{pagesLTS.fnsymbol}| -- never \verb|\pageref{pagesLTS.fnsymbol}|!)\\
(There are \lastpageref{pagesLTS.fnsymbol.local} pages with fnsymbol numbers.)\\

\noindent Last alph page (pagesLTS.alph): \lastpageref{pagesLTS.alph}{\hskip4em }
(There are only \lastpageref{pagesLTS.alph.local} pages with alph numbers,
because an \verb|\addtocounter{page}{|\pagesLTSexamplealph\verb|}| was used.)\\

\noindent Last Alph page (pagesLTS.Alph): \lastpageref{pagesLTS.Alph}{\hskip4em }
(There are \lastpageref{pagesLTS.Alph.local} pages with Alph numbers.)\\

\noindent Last page's \textit{name} (LastPage): \lastpageref{LastPage}\\

\noindent Very last page's \textit{name} (VeryLastPage): \lastpageref{VeryLastPage}\\
(\texttt{LastPage} and \texttt{VeryLastPage} are identical, unless
a package with output \linebreak
\verb|\AtEndDocument| after the \textsf{pageslts} package was added.)\\

\noindent Last page's \textit{number} (LastPages): \lastpageref{LastPages}{\hskip3em }
(=~total number of pages)\\

\lipsum[1-3]

\newpage

\lastpageref{pagesLTS.Roman}
(\verb|\lastpageref{pagesLTS.Roman}|)
\textbf{does} refers to this page, because the option
\texttt{pagecontinue=true} was chosen. Also\\
\verb|\lastpageref{pagesLTS.Roman.3}| can be used: \lastpageref{pagesLTS.Roman.3}.\\

\bigskip

There are \lastpages{Roman}{3}~pages (\verb|\lastpages{Roman}{3}|) in this
third Roman sector.\\

\newpage

\pagenumbering{Alph}

\section{Alph}

\noindent First page (\verb|\lastpageref{pagesLTS.0}|):
 \lastpageref{pagesLTS.0}\\

\noindent The page (\verb|\thepage|): \thepage \\

\noindent Current page (\verb|\theCurrentPage|),
i.\,e. counted continuously from the first page): \theCurrentPage \\

\noindent CurrentPageLocal (\verb|\theCurrentPageLocal|),
i.\,e. counted continuously from the first page of the
current page numbering scheme): \theCurrentPageLocal \\

\noindent Last roman page (pagesLTS.roman): \lastpageref{pagesLTS.roman}{\hskip4em }
(There are \lastpageref{pagesLTS.roman.local} pages with roman numbers.)\\

\noindent Last Roman page (pagesLTS.Roman): \lastpageref{pagesLTS.Roman}{\hskip3em }
(There are \lastpageref{pagesLTS.Roman.local}~pages with Roman numbers:\\
\lastpages{Roman}{1}~pages in the first Roman sector
(\pageref{Roman}{\hskip3em }-\lastpageref{pagesLTS.Roman.1}{\hskip3em }),\\
\lastpages{Roman}{2}~pages in the second Roman sector
(\pageref{Roman2}{\hskip3em }-\lastpageref{pagesLTS.Roman.2}{\hskip3em }), and\\
\lastpages{Roman}{3}~pages in the third Roman sector
(\pageref{Roman3}{\hskip3em }-\lastpageref{pagesLTS.Roman.3}{\hskip3em }).\\

\noindent Last arabic page (pagesLTS.arabic): \lastpageref{pagesLTS.arabic}{\hskip5em }
(There are only \lastpageref{pagesLTS.arabic.local} pages with arabic numbers,
because an \verb|\addtocounter{page}{|\pagesLTSexampleArabic\verb|}| was used.)\\

\noindent Last fnsymbol page (pagesLTS.fnsymbol): \lastpageref{pagesLTS.fnsymbol} \\
(\verb|\lastpageref{pagesLTS.fnsymbol}| -- never \verb|\pageref{pagesLTS.fnsymbol}|!)\\
(There are \lastpageref{pagesLTS.fnsymbol.local} pages with fnsymbol numbers.)\\

\noindent Last alph page (pagesLTS.alph): \lastpageref{pagesLTS.alph}{\hskip4em }
(There are only \lastpageref{pagesLTS.alph.local} pages with alph numbers,
because an \verb|\addtocounter{page}{|\pagesLTSexamplealph\verb|}| was used.)\\

\noindent Last Alph page (pagesLTS.Alph): \lastpageref{pagesLTS.Alph}{\hskip4em }
(There are \lastpageref{pagesLTS.Alph.local} pages with Alph numbers.)\\

\noindent Last page's \textit{name} (LastPage): \lastpageref{LastPage}\\

\noindent Very last page's \textit{name} (VeryLastPage): \lastpageref{VeryLastPage}\\
(\texttt{LastPage} and \texttt{VeryLastPage} are identical, unless
a package with output \linebreak
\verb|\AtEndDocument| after the \textsf{pageslts} package was added.)\\

\noindent Last page's \textit{number} (LastPages): \lastpageref{LastPages}{\hskip3em }
(=~total number of pages)\\

\lipsum[1-3]

Without option \texttt{alphMulti=AB} of the \textsf{pageslts} (and the help of
\textsc{Heiko Oberdiek's} \textsf{alphalph} package), after page
\textquotedblleft Z\textquotedblright{} there would just appear a
\begin{quote}
\begin{verbatim}
LaTeX Error: Counter too large
See the LaTeX manual or LaTeX Companion for explanation.
You've lost some text.  Try typing  <return>  to proceed.
If that doesn't work, type  X <return>  to quit.
\end{verbatim}
\end{quote}
Now the page numbers are continued AA, AB, AC,\ldots\ (AA, BB, CC,\ldots\ is
also possible, see the \textsf{pageslts} documentation).\\
This is not demonstrated here, but see section~\ref{alph}.

\newpage

\section{The End}

\noindent First page (\verb|\lastpageref{pagesLTS.0}|):
 \lastpageref{pagesLTS.0}\\

\noindent The page (\verb|\thepage|): \thepage \\

\noindent Current page (\verb|\theCurrentPage|),
i.\,e. counted continuously from the first page): \theCurrentPage \\

\noindent CurrentPageLocal (\verb|\theCurrentPageLocal|),
i.\,e. counted continuously from the first page of the
current page numbering scheme): \theCurrentPageLocal \\

\noindent Last roman page (pagesLTS.roman): \lastpageref{pagesLTS.roman}{\hskip4em }
(There are \lastpageref{pagesLTS.roman.local} pages with roman numbers.)\\

\noindent Last Roman page (pagesLTS.Roman): \lastpageref{pagesLTS.Roman}{\hskip3em }
(There are \lastpageref{pagesLTS.Roman.local}~pages with Roman numbers:\\
\lastpages{Roman}{1}~pages in the first Roman sector
(\pageref{Roman}{\hskip3em }-\lastpageref{pagesLTS.Roman.1}{\hskip3em }),\\
\lastpages{Roman}{2}~pages in the second Roman sector
(\pageref{Roman2}{\hskip3em }-\lastpageref{pagesLTS.Roman.2}{\hskip3em }), and\\
\lastpages{Roman}{3}~pages in the third Roman sector
(\pageref{Roman3}{\hskip3em }-\lastpageref{pagesLTS.Roman.3}{\hskip3em }).\\

\noindent Last arabic page (pagesLTS.arabic): \lastpageref{pagesLTS.arabic}{\hskip5em }
(There are only \lastpageref{pagesLTS.arabic.local} pages with arabic numbers,
because an \verb|\addtocounter{page}{|\pagesLTSexampleArabic\verb|}| was used.)\\

\noindent Last fnsymbol page (pagesLTS.fnsymbol): \lastpageref{pagesLTS.fnsymbol} \\
(\verb|\lastpageref{pagesLTS.fnsymbol}| -- never \verb|\pageref{pagesLTS.fnsymbol}|!)\\
(There are \lastpageref{pagesLTS.fnsymbol.local} pages with fnsymbol numbers.)\\

\noindent Last alph page (pagesLTS.alph): \lastpageref{pagesLTS.alph}{\hskip4em }
(There are only \lastpageref{pagesLTS.alph.local} pages with alph numbers,
because an \verb|\addtocounter{page}{|\pagesLTSexamplealph\verb|}| was used.)\\

\noindent Last Alph page (pagesLTS.Alph): \lastpageref{pagesLTS.Alph}{\hskip4em }
(There are \lastpageref{pagesLTS.Alph.local} pages with Alph numbers.)\\

\noindent Last page's \textit{name} (LastPage): \lastpageref{LastPage}\\

\noindent Very last page's \textit{name} (VeryLastPage): \lastpageref{VeryLastPage}\\
(\texttt{LastPage} and \texttt{VeryLastPage} are identical, unless
a package with output \linebreak
\verb|\AtEndDocument| after the \textsf{pageslts} package was added.)\\

\noindent Last page's \textit{number} (LastPages): \lastpageref{LastPages}{\hskip3em }
(=~total number of pages)\\

\medskip

\noindent Page \thepage\ (\theCurrentPage; local: \theCurrentPageLocal) of %
\lastpageref{pagesLTS.roman} (\lastpageref{pagesLTS.roman.local}) + %
\lastpageref{pagesLTS.Roman} (\lastpageref{pagesLTS.Roman.local}) + %
\lastpageref{pagesLTS.arabic} (\lastpageref{pagesLTS.arabic.local}) + %
\lastpageref{pagesLTS.fnsymbol} (\lastpageref{pagesLTS.fnsymbol.local}) + %
\lastpageref{pagesLTS.alph} (\lastpageref{pagesLTS.alph.local}) + %
\lastpageref{pagesLTS.Alph} (\lastpageref{pagesLTS.Alph.local}) = %
\lastpageref{LastPages} pages.

\end{document}
%</example>
%    \end{macrocode}
%
% \pagebreak
%
% \StopEventually{}
%
% \section{The implementation}
%
% (This and the source code of the example file are the reasons
% for printing the documentation in landscape format instead of portrait.)\\
%
% We start off by checking that we are loading into \LaTeXe{} and
% announcing the name and version of this package.
%
%    \begin{macrocode}
%<*package>
%    \end{macrocode}
%
%    \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[2015/01/01]
\ProvidesPackage{pageslts}[2015/12/21 v1.2f
            Refers to special pages' numbers/names (HMM)]

%    \end{macrocode}
%
% A short description of the \xpackage{pageslts} package:
%
%    \begin{macrocode}
%% Allows for things like\\
%% |Page \thepage\ (\theCurrentPage; local: \theCurrentPageLocal) of %
%%  \lastpageref{pagesLTS.roman}(\lastpageref{pagesLTS.roman.local}) + %
%%  \lastpageref{pagesLTS.Roman}(\lastpageref{pagesLTS.Roman.local}) + %
%%  \lastpageref{pagesLTS.arabic}(\lastpageref{pagesLTS.arabic.local}) + %
%%  \lastpageref{pagesLTS.fnsymbol}(\lastpageref{pagesLTS.fnsymbol.local}) + %
%%  \lastpageref{pagesLTS.alph}(\lastpageref{pagesLTS.alph.local}) + %
%%  \lastpageref{pagesLTS.Alph}(\lastpageref{pagesLTS.Alph.local}) = %
%%  \lastpageref{LastPages} pages.|\\
%% to get\\
%% 'Page d (57; local: 4) of ii(2) + XX(20) + *(1) + 30(30) + e(5) + C(3) = 61 pages.'.

%    \end{macrocode}
%
% The package is now named `pageslts' but had been named `pagesLTS' before.
% \LaTeX\ does not load a package two times, but it is case sensitive,
% i.\,e. \emph{would} load `pageslts' and `pagesLTS', resulting in
% possible problems. Therefore we check for a loaded `pagesLTS' package
% (assuming |\pagesLTS@loaded| is not |p@gesLTSlo@ded| and not defined to
% |p@gesLTSlo@ded| by another package). This check might work only for
% the second and following compilation runs.
%
%    \begin{macrocode}
\@ifpackageloaded{pagesLTS}{%
  \def\pagesLTS@doubleload{p@gesLTSlo@ded}
  \ifx\pagesLTS@loaded\pagesLTS@doubleload%
    \PackageError{pageslts}{Requested pagesLTS instead of pageslts}{%
      You have requested package `pagesLTS'. This package is now named `pageslts'.\MessageBreak%
      Requesting `pagesLTS' as well as `pageslts' leads to loading the same package\MessageBreak%
      twice (and results in errors). Loading of `pageslts' will therefore be\MessageBreak%
      abandoned now. To fix this problem, please look in the \jobname.log file for\MessageBreak%
      LaTeX Warning: You have requested package `pagesLTS',\MessageBreak%
      \space \space \space \space \space \space \space \space \space \space \space \space \space%
      \space \space but the package provides `pageslts'.\MessageBreak%
      and change the package call in the calling style/document.\MessageBreak%
      If a style file made the mistake, please inform its maintainer and/or the\MessageBreak%
      maintainer of the pageslts package about it (after making sure you have\MessageBreak%
      the recent version of that style file).\MessageBreak%
      Thank you and sorry for the inconvenience!\MessageBreak%
     }
    \endinput
  \fi
  }{% \relax
   }

\gdef\pagesLTS@loaded{p@gesLTSlo@ded}

%    \end{macrocode}
%
% For |\ltx@ifpackageloaded| the \xpackage{ltxcmds} package is needed,
% also by \textsc{Heiko Oberdiek} (see subsection~\ref{ss:Downloads}):
%
%    \begin{macrocode}
\RequirePackage{ltxcmds}[2011/11/09]%        v1.22
%    \end{macrocode}
%
% For its |\AfterLastShipout| (as well as its |\AtEndAfterFileList|) command
% we need the \xpackage{atveryend} package by \textsc{Heiko Oberdiek}
% (see subsection~\ref{ss:Downloads}):
%
%    \begin{macrocode}
\RequirePackage{atveryend}[2011/06/30]%      v1.8
\AtBeginDocument{%
  %% https://tex.stackexchange.com/a/45654/6865
  %% and https://tex.stackexchange.com/q/261445/6865
  \def\pagesLTS@etb{etoolbox.sty}%
  \let\pagesLTS@ave\@empty%
  \@for\@pageslts@currname:=\@filelist\do{%
     \ifx\@pageslts@currname\pagesLTS@etb\relax%
       \def\pagesLTS@ave{atveryend.sty}%
     \fi%
     \ifx\@pageslts@currname\pagesLTS@ave%
       \@ifpackagelater{atveryend}{2015/08/01}{%\relax
          \PackageInfo{pageslts}{etoolbox package loaded before atveryend package\MessageBreak%
            With atveryend version 1.8 of 2011/06/30 this caused a problem,\MessageBreak%
            which is probably solved in the new version used here.\MessageBreak%
            To play it safe, you could load the atveryend package\MessageBreak%
            before the etoolbox package.\MessageBreak%
            }%
        }{% else
          \PackageError{pageslts}{etoolbox package loaded before atveryend package}{%
            You can use both packages, but when etoolbox is loaded before atveryend,\MessageBreak%
            atveryend no longer detects \string\enddocument\space\MessageBreak% 
            and hook "AtVeryVeryEnd" is not executed.\MessageBreak%
            Just load the atveryend package before the etoolbox package!\MessageBreak%
            }%
         }%
     \fi%
   }%
  }

%    \end{macrocode}
%
% For its |\EveryShipout| command we need the \xpackage{everyshi}
% package by \textsc{Martin Schr\"{o}der} (see subsection~\ref{ss:Downloads}):
%
%    \begin{macrocode}
\RequirePackage{everyshi}[2001/05/15]%       v3.00
%    \end{macrocode}
%
% For its |\LetLtxMacro| command we need the \xpackage{letltxmacro}
% package by \textsc{Heiko Oberdiek} (see subsection~\ref{ss:Downloads}):
%
%    \begin{macrocode}
\RequirePackage{letltxmacro}[2010/09/02]%    v1.4
%    \end{macrocode}
%
% For the handling of the options we need the \xpackage{kvoptions}
% package also by \textsc{Heiko Oberdiek} (see subsection~\ref{ss:Downloads}):
%
%    \begin{macrocode}
\RequirePackage{kvoptions}[2011/06/30]%      v3.11
%    \end{macrocode}
%
% The \xpackage{undolabl} package of \textsc{H.-Martin M\"{u}nch} (i.\,e. myself),
% with code from \textsc{Ulrich Diez}, (see subsection~\ref{ss:Downloads})
% is needed to overwrite labels, when the same page numbering scheme
% is used twice (or even more often).
%
%    \begin{macrocode}
\RequirePackage{undolabl}[2015/03/29]%       v1.0l
%    \end{macrocode}
%
% We use the \xpackage{rerunfilecheck} package by \textsc{Heiko Oberdiek}
% to make sure that the user gets and sees the rerun warnings (if any).
%
%    \begin{macrocode}
\RequirePackage{rerunfilecheck}[2011/04/15]% v1.7
%    \end{macrocode}
%
% We must not forget to give the source of |Prelim@EveryShipout|:
%
%    \begin{macrocode}
%% pageslts package uses Prelim@EveryShipout code from the
%% prelim2e package [2009/05/29 v1.3] by Martin Schr\"{o}der, thanks!

%    \end{macrocode}
%
% About the \xpackage{prelim2e} package by \textsc{Martin Schr\"{o}der}
% see subsection~\ref{ss:Downloads}.\\
%
% A last information for the user(s):
%
%    \begin{macrocode}
%% pageslts may work with earlier versions of LaTeX2e and those packages,
%% but this was not tested. Please consider updating your LaTeX
%% and packages to the most recent version (if they are not already
%% the most recent version).
%    \end{macrocode}
% See subsection~\ref{ss:Downloads} about how to get them.\\
%
% \pagebreak
%
% The very old version~2.0 (and earlier) of the \xpackage{endfloat}
% package actually redefined the |\enddocument| command,
% and so interfered drastically with the \LaTeXe\ commands which
% make use of |\AtEndDocument|. Newer versions of \xpackage{endfloat}
% exists (at the time of writing this documentation: v2.5d as of 2011/12/25)
% in modern documentation form, which are available from \url{https://www.CTAN.org}
% (see subsection~\ref{ss:Downloads}).
% A~note is placed here, and later it is checked whether a (very) old
% \xpackage{endfloat} package is in use. If it is, a warning or even
% an error message is given, depending on \xpackage{endfloat} version.
% This assumes, that the old versions of \xpackage{endfloat} at least gave
% a version date, of course.
%
%    \begin{macrocode}
%% The recent version of the endfloat package is v2.5d as of 2011/12/25.
%% The pageslts package is not fully compatible with version 2.0
%% (and earlier) of the endfloat package, because those versions
%% redefined the \enddocument command.

%    \end{macrocode}
%
% The options are introduced:
%
%    \begin{macrocode}
\SetupKeyvalOptions{family = pagesLTS,prefix = pagesLTS@}
\DeclareBoolOption[true]{pagecontinue}% \pagesLTS@pagecontinue
\DeclareStringOption[ab]{alphMult}
\DeclareStringOption[AB]{AlphMulti}
\DeclareBoolOption[true]{romanMult}
\DeclareBoolOption[true]{RomanMulti}
\DeclareBoolOption[true]{fnsymbolmult}

\ProcessKeyvalOptions*

%    \end{macrocode}
%
% For comparisons, zero, one, two and three are defined (|\z@|, |\@ne| and so on
% do not work for this).
%
%    \begin{macrocode}
\def\pagesLTS@zero{0}
\def\pagesLTS@one{1}
\def\pagesLTS@two{2}
\def\pagesLTS@three{3}

%    \end{macrocode}
%
% The traditional behaviour is a reset of the page number to one,
% each time the page numbering scheme changes. The option
% |pagecontinue| changes this to a continuation with the
% number/name following the last page number/name of the same
% page numbering scheme. The user is informed accordingly.
%
%    \begin{macrocode}
\ifpagesLTS@pagecontinue%
  \PackageInfo{pageslts}{Option pagecontinue enabled\MessageBreak%
    (maybe by default):\MessageBreak%
    The pageslts package will continue the page numbering,\MessageBreak%
    when the same page numbering scheme is used twice.\MessageBreak%
    If you do not want this, call pageslts with option\MessageBreak%
    pagecontinue=false (or use \string\setcounter{page}=1).\MessageBreak%
  }
\else
%    \end{macrocode}
%
% \pagebreak
%
%    \begin{macrocode}
  \PackageWarningNoLine{pageslts}{Option pagecontinue is false:\MessageBreak%
    The pageslts package was used, but the option\MessageBreak%
    pagecontinue was set to false.\MessageBreak%
    If you want the page numbers to be continued,\MessageBreak%
    when the same page numbering scheme is used twice,\MessageBreak%
    please call pageslts with option pagecontinue=true,\MessageBreak%
    otherwise the page number is reset to one each time\MessageBreak%
    the page numbering scheme is changed.\MessageBreak%
    For details please see the documentation%
  }
\fi

%    \end{macrocode}
%
% The page number printed in \texttt{alph} or in \texttt{Alph}
% page numbering scheme had to be $>0$ and \nolinebreak{$<27$.}\ %
% Now the \xpackage{alphalph} package allows to extend the
% numbering scheme (not only for pages). Because some users
% prefer aa, ab, ac, ad,\ldots\ and some aa, bb, cc, dd,\ldots,
% both schemes can be chosen via the options.
% The \texttt{fnsymbol} page numbering scheme was restricted to values
% $>0$ and \nolinebreak{$<10$.}\ The \xpackage{alphalph} package allows
% to extend this page numbering scheme, too. Option \texttt{fnsymbolmult}
% can be chosen with the \xpackage{pageslts} package.
% If no extension is wished (or another extension is wished
% and implemented manually), \xpackage{pageslts} can be called with
% options set to 0 (zero) and false: |alphMult=0|, |AlphMulti=0|,
% |fnsymbolmult=false|.
%
%    \begin{macrocode}
\def\pagesLTS@ab{ab}
\def\pagesLTS@bb{bb}
\def\pagesLTS@ABi{AB}
\def\pagesLTS@BBi{BB}

\ifx\pagesLTS@alphMult\pagesLTS@ab%
\else
  \ifx\pagesLTS@alphMult\pagesLTS@bb%
  \else
    \ifx\pagesLTS@alphMult\pagesLTS@zero%
      \PackageWarningNoLine{pageslts}{%
        Option alphMult=0 found:\MessageBreak%
        The pageslts package was used, but the option\MessageBreak%
        alphMult was set to 0 (zero).\MessageBreak%
        If you want the page numbers to be extended\MessageBreak%
        after z, you have to organize this yourself now.\MessageBreak%
        For automatic continuation, please use the\MessageBreak%
        alphalph package and call pageslts\MessageBreak%
        with option alphMult=ab (for aa, ab, ac, ad,...) or\MessageBreak%
        with option alphMult=bb (for aa, bb, cc, dd,...).\MessageBreak%
        For details please see the documentation!%
       }
    \else
      \PackageError{pageslts}{Unknown option value}{%
        The pageslts package was used with option\MessageBreak%
        alphMult= \pagesLTS@alphMult . Only values\MessageBreak%
        ab, bb, and 0 (zero) are valid.\MessageBreak%
        The default ab is set.\MessageBreak%
        For details please see the documentation!%
       }
      \setkeys{pagesLTS}{alphMult=ab}
    \fi
  \fi
\fi

\ifx\pagesLTS@AlphMulti\pagesLTS@ABi%
\else
  \ifx\pagesLTS@AlphMulti\pagesLTS@BBi%
  \else
    \ifx\pagesLTS@AlphMulti\pagesLTS@zero%
      \PackageWarningNoLine{pageslts}{%
        Option AlphMulti=0 found:\MessageBreak%
        The pageslts package was used, but the option\MessageBreak%
        AlphMulti was set to 0 (zero).\MessageBreak%
        If you want the page numbers to be extended\MessageBreak%
        after Z, you have to organize this yourself now.\MessageBreak%
        For automatic continuation, please use the\MessageBreak%
        alphalph package and call pageslts\MessageBreak%
        with option AlphMulti=AB (for AA, AB, AC, AD,...) or\MessageBreak%
        with option AlphMulti=BB (for AA, BB, CC, DD,...).\MessageBreak%
        For details please see the documentation!%
       }
    \else
      \PackageError{pageslts}{Unknown option value}{%
        The pageslts package was used with option\MessageBreak%
        AlphMulti= \pagesLTS@AlphMulti . Only values\MessageBreak%
        AB, BB, and 0 (zero) are valid.\MessageBreak%
        The default AB is set.\MessageBreak%
        For details please see the documentation!%
       }
      \setkeys{pagesLTS}{AlphMulti=AB}
    \fi
  \fi
\fi

%    \end{macrocode}
%
% If |alph| or |Alph| or |fnsymbol| page numbers shall be continued,
% the \xpackage{alphalph} package is required.
%
%    \begin{macrocode}
\ifx\pagesLTS@alphMult\pagesLTS@zero% \relax
\else \RequirePackage{alphalph}[2011/05/13]% v2.4
\fi

\ifx\pagesLTS@AlphMulti\pagesLTS@zero% \relax
\else \RequirePackage{alphalph}[2011/05/13]% v2.4
\fi

\ifpagesLTS@fnsymbolmult%
  \RequirePackage{alphalph}[2011/05/13]% v2.4
\fi

%    \end{macrocode}
%
% For the roman page numbering scheme, it is just the
% choice of an extension by \xpackage{pageslts} or not.
%
%    \begin{macrocode}
\ifpagesLTS@romanMult%
  \PackageInfo{pageslts}{Option romanMult enabled\MessageBreak%
    (maybe by default):\MessageBreak%
    The pageslts package will extend the page numbering\MessageBreak%
    of the roman scheme below i with\MessageBreak%
     0, -i, -ii, -iii, -iv,...\MessageBreak%
    If you do not want this, call pageslts with option\MessageBreak%
    romanMult=false.\MessageBreak%
  }
\else
  \PackageWarningNoLine{pageslts}{Option romanMult is set to false:\MessageBreak%
  The pageslts package was used, but the option\MessageBreak%
  romanMult was set to false.\MessageBreak%
  If you want the page numbering of the roman scheme\MessageBreak%
  to be extended below i,\MessageBreak%
  please call pageslts with option romanMult=true,\MessageBreak%
  otherwise zero and negative page numbers of the\MessageBreak%
  roman scheme will need to be defined otherwise.\MessageBreak%
  For details please see the documentation!\MessageBreak%
  }
\fi

%    \end{macrocode}
%
% Same for the Roman page numbering scheme.
%
%    \begin{macrocode}
\ifpagesLTS@RomanMulti%
  \PackageInfo{pageslts}{Option RomanMulti enabled\MessageBreak%
    (maybe by default):\MessageBreak%
    The pageslts package will extend the page numbering\MessageBreak%
    of the Roman scheme below I with\MessageBreak%
    0, -I, -II, -III, -IV,...\MessageBreak%
    If you do not want this, call pageslts with option\MessageBreak%
    RomanMulti=false.\MessageBreak%
   }
\else
  \PackageWarningNoLine{pageslts}{Option RomanMulti is set to false:\MessageBreak%
    The pageslts package was used, but the option\MessageBreak%
    RomanMulti was set to false.\MessageBreak%
    If you want the page numbering of the Roman scheme\MessageBreak%
    to be extended below i,\MessageBreak%
    please call pageslts with option RomanMulti=true,\MessageBreak%
    otherwise zero and negative page numbers of the\MessageBreak%
    Roman scheme will need to be defined otherwise.\MessageBreak%
    For details please see the documentation!\MessageBreak%
   }
\fi

%    \end{macrocode}
%
% For the footnotesymbol page numbering scheme, it is also
% just the choice of a extension by \xpackage{pageslts} or not.
%
%    \begin{macrocode}
\ifpagesLTS@fnsymbolmult%
  \PackageInfo{pageslts}{Option fnsymbolmult enabled\MessageBreak%
    (maybe by default):\MessageBreak%
    The pageslts package will extend the page numbering\MessageBreak%
    of the footnotesymbol scheme using the alphalph\MessageBreak%
    package.\MessageBreak%
    If you do not want this, call pageslts with option\MessageBreak%
    fnsymbolmult=false.\MessageBreak%
   }
\else
  \PackageWarningNoLine{pageslts}{%
    Option fnsymbolmult is set to false:\MessageBreak%
    The pageslts package was used, but the option\MessageBreak%
    fnsymbolmult was set to false.\MessageBreak%
    If you want the page numbering of the footnotesymbol\MessageBreak%
    scheme to be extended using the alphalph package,\MessageBreak%
    please call pageslts with option fnsymbolmult=true,\MessageBreak%
    otherwise page numbers of the footnotesymbol scheme\MessageBreak%
    greater than nine will need to be defined otherwise.\MessageBreak%
    For details please see the documentation!\MessageBreak%
   }
\fi

%    \end{macrocode}
%
% Now defining some variables, place-holders, and abbreviations:
%
%    \begin{macrocode}
\def\pagesLTS@pnc{0}
\def\pagesLTS@called{0}
\def\pagesLTS@fns{fnsymbol}
\def\pagesLTS@alph{alph}
\def\pagesLTS@Alph{Alph}
\def\pagesLTS@rerun{0}
\def\pagesLTS@eso{0}
\def\pagesLTS@esov{0}
\def\lastpageref{\lastpagereftxt}
\def\pagesLTS@undolable{none}
\def\pncmissing{0}
\def\pagesLTS@SK{0}
\def\pagesLTS@messageNPN{%
 The pageslts package was used, but\MessageBreak%
 \string\pagenumbering \MessageBreak%
 was not called at the beginning of the document\MessageBreak%
 (maybe earlier or later).\MessageBreak%
 Please use \string\pagenumbering \MessageBreak%
 (with an argument like arabic, roman, Roman,\MessageBreak%
 fnsymbol, alph, or Alph) at the beginning\MessageBreak%
 of your document! Otherwise your document\MessageBreak%
 will probably compile, but the pageslts\MessageBreak%
 package might not be able to get all labels\MessageBreak%
 for the references to the respective pages\MessageBreak%
 right.\MessageBreak%
 }

%    \end{macrocode}
%
% It is checked whether writing to files is allowed.
% The \xpackage{pageslts} package cannot be used without that!
% Some packages (e.\,g. \xpackage{tikz} and \xpackage{selectp}) sometimes prevent
% the output to the \xfile{aux} file. In that case a warning or an error message
% is issued. This is no problem as long as there is/was another compilation run
% where the labels can/could be processed via the \xfile{aux} file.\\
% If it is allowed to write to the \xfile{aux} file, we define
% |\pagesLTS@loaded| as |p@gesLTSnotlo@ded| for the next compilation run.
%
%    \begin{macrocode}
\AtBeginDocument{%
  \if@filesw%
%    \end{macrocode}
%
% \noindent then |\relax|.\newline
% When writing to files is not allowed, nothing can be done.
% But when the labels were already processed via the \xfile{aux} file,
% nothing needs to be done (if enough compilation runs have been done before).
%
%    \begin{macrocode}
  \else%
    \@ifpackageloaded{tikz}{%
      \PackageWarning{pageslts}%
        {It was not allowed to write to an\MessageBreak%
         .aux file. This package does not work without access\MessageBreak%
         to an .aux file.\MessageBreak%
         It is OK if the .aux file was already updated\MessageBreak%
         by a previouse compiler run\MessageBreak%
         and would not have changed anyway.\MessageBreak%
        }%
    }{\PackageError{pageslts}{No writing to auxiliary file allowed}%
        {It was not allowed to write to an .aux file.\MessageBreak%
         This package does not work without access to an .aux file.\MessageBreak%
         Press Ctrl+Z to exit.\MessageBreak%
         But it is OK if the .aux file was already updated\MessageBreak%
         by previouse compiler runs\MessageBreak%
         and would not have changed anyway.\MessageBreak%
         (In that case just press Enter or Return\MessageBreak%
         to continue the compilation.)\MessageBreak%
        }%
     }%
  \fi%
  }

%    \end{macrocode}
%
% \begin{macro}{\pagenumbering}
% \indent \qquad To keep the original meaning of |\pagenumbering|:
%
%    \begin{macrocode}
\LetLtxMacro{\OrigPagenumbering}{\pagenumbering}

%    \end{macrocode}
% \end{macro}
%
% Defining some new counters (and doing related things):
%
%    \begin{macrocode}
\newcounter{CurrentPage}
\setcounter{CurrentPage}{1}
\def\theCurrentPageLocal{\arabic{pagesLTS.current.local.\pagesLTS@pnc}}
%    \end{macrocode}
%
% The counter |pagesLTS.pagenr| is for saving the total page
% number of the last page in the \xfile{.aux} file.
%
%    \begin{macrocode}
\newcounter{pagesLTS.pagenr}
%    \end{macrocode}
%
% While generally
% |\pagesLTS@ifcounter{pagesLTS.current.local.\pagesLTS@pnc}|
% is used, for the beginning of the document
% |pagesLTS.current.local.0| is predefined.
% (A~|\pagesLTS@ifcounter{pagesLTS.current.local.\pagesLTS@pnc}|
% could be used for this, too, but we know that |pagesLTS.current.local.0|
% was not defined, so we can just do the definition here.)
% And the first local page gets the number one.
%
%    \begin{macrocode}
\newcounter{pagesLTS.current.local.0}
\setcounter{pagesLTS.current.local.0}{1}
%    \end{macrocode}
%
% And the same again for |pagesLTS.pnc.0|.
%
%    \begin{macrocode}
\newcounter{pagesLTS.pnc.0}

%    \end{macrocode}
%
% \phantomsection
% \begin{macro}{\xroman}\label{xroman}
% When |\roman{...}| is used with a value $<1$, \LaTeX\ just ignores this
% (see subsection~\ref{ss:overflow}). Here we provide a command
% |\xroman{...}| \nolinebreak{(e\textbf{x}panded} roman),
% which gives the usual |\roman| numbers (i, ii, iii, iv,\ldots)
% for positive values,
% $-\left\vert \ldots \right\vert $ (i.\,e. -i, -ii, -iii, -iv,\ldots)
% for negative values, and 0 for all other values (which should be zero).
%
%    \begin{macrocode}
\newcommand{\xroman}[1]{%
  \ifnum\value{#1}>0%
    \roman{#1}%
  \else%
    \ifnum\value{#1}<0%
%    \end{macrocode}
%
% |\arabic{#1}| gives the arabic number of argument |#1|,
% which is negative here (for example $-7$),
% \textquotedblleft |-|\textquotedblright{} puts another minus
% sign in front of it (for example $--7$), |\number| removes
% all unnecessary preceding zeros, plus and minus signs
% (for example $7$), |\romannumeral| turns it into a |roman|
% number (for example vii), and
% \textquotedblleft |-|\textquotedblright{} puts the minus
% sign back in front of it (for example -vii).
%
%    \begin{macrocode}
      -\romannumeral\number-\arabic{#1}%
    \else%
      0%
    \fi%
  \fi%
  }

%    \end{macrocode}
%  \end{macro}
%
% \pagebreak
%
% \begin{macro}{\XRoman}
% |\XRoman| does the same for uppercase |\Roman| numbers.
% |-\uppercase{\romannumeral\number-\arabic{#1}}| cannot be used,
% because the result in the example is |-\uppercase{vii}| and
% not |-VII|.\footnote{This does not matter for the print out,
% but for the display of the logical page numbers
% as well as the \xfile{.aux} file.} Therefore we have a look
% at \LaTeX's own |\@Roman\FOOcounter|,\\
% |\def\@Roman#1{\expandafter\@slowromancap\romannumeral #1@}|,\\
% and use |\@slowromancap|, which is a fully expandable macro,
% to do the trick for this:
%
% \noindent \textquotedblleft
% \begin{quote}
%\begin{verbatim}
%\def\@slowromancap#1{\ifx @#1% then terminate
%\else
%\if i#1I\else\if v#1V\else\if x#1X\else\if l#1L\else\if
%c#1C\else\if d#1D\else \if m#1M\else#1\fi\fi\fi\fi\fi\fi\fi
%\expandafter\@slowromancap
%\fi
%}
%\end{verbatim}
% \end{quote}
% \textquotedblright{} (1998/05/16 Version v1.1g LaTeX Kernel File~m
% ltcounts.dtx 105 Counters and Lengths).
%
%    \begin{macrocode}
\newcommand{\XRoman}[1]{%
  \ifnum\value{#1}>0%
    \Roman{#1}%
  \else%
    \ifnum\value{#1}<0%
      -\expandafter\@slowromancap\romannumeral\number-\arabic{#1}@%
    \else%
      0%
    \fi%
  \fi%
  }

%    \end{macrocode}
%  \end{macro}
%
% \begin{macro}{\XXRoman}
% In older versions |\XXRoman| was used. For compatibility, it is forwarded to |\XRoman|
% and an error message is given.
%
%    \begin{macrocode}
\newcommand{\XXRoman}[1]{\XRoman{#1}%
  \PackageError{pageslts}{Old command \string\XXRoman\space found}{Replaced by \string\XRoman.}%
  }

%    \end{macrocode}
%  \end{macro}
%
% \begin{macro}{\pagesLTS@ifcounter}
% We provide a way to create counters like
% \begin{itemize}
% \item[-] \DescribeMacro{pagesLTS.pnc. page numbering scheme }
%   |pagesLTS.pnc.<page numbering scheme>|, e.\,g. |pagesLTS.pnc.Roman|,
% \item[-] \DescribeMacro{pagesLTS.double. page numbering scheme }
%   |pagesLTS.double.<page numbering scheme>|, e.\,g. |pagesLTS.double.Roman|,
% \item[-] \DescribeMacro{PageCurrentLocal. page numbering scheme }
%   |PageCurrentLocal.<page numbering scheme>|, e.\,g. |PageCurrentLocal.Roman|,
% \end{itemize}
% for all page numbering schemes, even those not supported
% by the current original |\pagenumbering|
% (1994/05/19 v1.1a LaTeX Kernel File w ltpageno.dtx 52 Page Numbering),
% which is\\
% \begin{quote}
%\begin{verbatim}
%\countdef\c@page=0 \c@page=1
%\def\cl@page{}
%\def\pagenumbering#1{%
%  \global\c@page \@ne \gdef\thepage{\csname @#1\endcsname
%   \c@page}}
%\end{verbatim}
% \end{quote}
%
%    \begin{macrocode}
\newcommand{\pagesLTS@ifcounter}[1]{%
  \@ifundefined{c@#1}{\newcounter{#1}}{\relax}%
  }

%    \end{macrocode}
%  \end{macro}
%
% \begin{macro}{\lastpages}
% We provide a command to give the number of pages in a sector
% of a split page numbering scheme (see page~\pageref{pagesLTS.pnscheme.nr},\\
% |pagesLTS.<page numbering scheme>.<number>.local.cnt|):
%
%    \begin{macrocode}
\newcommand{\lastpages}[2]{%
  \pagesLTS@ifcounter{pagesLTS.#1.#2.local.cnt}%
  \arabic{pagesLTS.#1.#2.local.cnt}%
  }

%    \end{macrocode}
%  \end{macro}
%
% \begin{macro}{\pagesLTS@writelabel}
% At last defining the writing of a label:
%
%    \begin{macrocode}
\newcommand{\pagesLTS@writelabel}[1]{%
  \addtocounter{page}{+1}%
%    \end{macrocode}
%
% \noindent |\addtocounter{page}{+1}| because |\pagesLTS@putlabel| includes an\\
% |\addtocounter{page}{-1}|, which is not necessary here.\\
% Into the \xfile{.aux} file something like\\
% |\newlabel{pagesLTS.Roman}{{}{VIII}{}{page.VIII}{}}|\\
% is written, thus |\lastpageref{pagesLTS.Roman}| prints |VIII| and
% links to |page.VIII|.
%
%    \begin{macrocode}
  \pagesLTS@putlabel{pagesLTS.#1}{\thepage}{1}
  \addtocounter{page}{-1}%
  \ifx\pagesLTS@pnc\pagesLTS@zero% \relax
%    \end{macrocode}
%
% i.\,e. if the current page numbering scheme is
% \textquotedblleft 0\textquotedblright, i.\,e. before the first
% |\pagenumbering{...}| command, do nothing,
%
%    \begin{macrocode}
  \else%
    \addtocounter{page}{+1}%
    \pagesLTS@putlabel{pagesLTS.#1.local}{\theCurrentPageLocal}{1}
%    \end{macrocode}
%
% otherwise write into the \xfile{.aux} file something like\\
% |\newlabel{pagesLTS.arabic.local}{{}{5}{}{page.8}{}}|,\\
% thus |\lastpageref{pagesLTS.arabic.local}| prints |5| and
% links to |page.8|. Here (and in the example file) it is not
% \textquotedblleft print |8| and link to |page.8|\textquotedblright ,
% because |\addtocounter{page}{3}| has been used, thus the page with
% \textquotedblleft number\textquotedblright{} (name) |8| is the
% \textbf{fifth} $(=8-3)$ page.
%
%    \begin{macrocode}
    \addtocounter{page}{-1}%
  \fi%
  }

%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\erroralphalph}
% \indent |\erroralphalph| extends the
% \textquotedblleft numbers\textquotedblright{} of counters
% to zero and negative values for representations usually
% not supporting this: |\alphalph|, |\AlphAlph|, and
% |\fnsymbolmult| of the \xpackage{alphalph} package.\\
% |\alph|, |\Alph|, and |\fnsymbol| would not support
% \textquotedblleft numbers\textquotedblright{} below one.\\
% |\arabic| already supports negative numbers and zero.\\
% |\roman| and |\Roman| support neither negative numbers
% nor zero, but are expanded in this package
% (|\xroman| and |\XRoman|), see page~\pageref{xroman}.\\
%
%    \begin{macrocode}

%% The following code is from Heiko Oberdiek [2010/04/18],              %%
%% expanding his alphalph package as of 2010/04/18, v2.3. (Thanks!)     %%
\newcommand*{\erroralphalph}[2]{%
  \ifnum\value{#2}>0%
    #1{\value{#2}}%
  \else%
    \ifnum\value{#2}<0%
      -#1{\expandafter\@gobble\the\value{#2}}%
    \else%
      0%
    \fi%
  \fi%
  }
%% End of code from Heiko Oberdiek                                      %%
%% Check and Error/Warning messages have been moved to \EveryShipout,   %%
%% because messages inside e.g. the \pageref command can cause trouble. %%

%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\expandPagenumbering}
% \indent Here the |\erroralphalph| command is called with the
% appropriate arguments for each page numbering scheme.
%
%    \begin{macrocode}

\newcommand{\expandPagenumbering}[1]{%
  \let\Origthepage\thepage%
  \def\pagesLTS@tmpC{arabic}%
  \ifx\pagesLTS@pnc\pagesLTS@tmpC% \relax
%    \end{macrocode}
%
% |\arabic| already supports negative numbers and zero
% (|-MAX...MAX|, where |MAX|\,$ = 2\,147\,483\,647$).
%
%    \begin{macrocode}
  \else%
    \def\pagesLTS@tmpC{roman}%
    \ifx\pagesLTS@pnc\pagesLTS@tmpC%
      \ifpagesLTS@romanMult%
%    \end{macrocode}
%
% |\erroralphalph{\roman}{page}| cannot be used, because
% |-\roman{\expandafter\@gobble\the\value{page}}| does not work.
% If option |romanMult| is not false,
% |\xroman| (see page~\pageref{xroman}) expands the usable
% roman page numbers to values below 1 (i, I, respectively),
% see subsubsection~\ref{sss:romanMult}.
%
%    \begin{macrocode}
        \renewcommand*{\thepage}{\xroman{page}}%
      \fi%
    \else%
      \def\pagesLTS@tmpC{Roman}%
      \ifx\pagesLTS@pnc\pagesLTS@tmpC%
        \ifpagesLTS@RomanMulti%
%    \end{macrocode}
%
% The same for |\Roman| page numbering, expanded by |\XRoman|
% (see page~\pageref{xroman}).
%
%    \begin{macrocode}
          \renewcommand*{\thepage}{\XRoman{page}}%
        \fi%
      \else%
        \ifx\pagesLTS@pnc\pagesLTS@alph%
%    \end{macrocode}
%
% |\alph| and |\Alph| page numberings are expanded to negative
% and zero values, and to values greater than
% \textquotedblleft z\textquotedblright{} or
% \textquotedblleft Z\textquotedblright{} with the
% \xpackage{alphalph} package.~--
% If |\pagesLTS@alphMult| was zero, nothing is done.
%
%    \begin{macrocode}
          \ifx\pagesLTS@alphMult\pagesLTS@ab%
            \renewcommand*{\thepage}{\erroralphalph{\alphalph}{page}}%
          \else \ifx\pagesLTS@alphMult\pagesLTS@bb%
                  \renewcommand*{\thepage}{\erroralphalph{\alphMult}{page}}%
                \fi%
          \fi%
        \else%
          \ifx\pagesLTS@pnc\pagesLTS@Alph%
            \ifx\pagesLTS@AlphMulti\pagesLTS@ABi%
              \renewcommand*{\thepage}{\erroralphalph{\AlphAlph}{page}}%
            \else \ifx\pagesLTS@AlphMulti\pagesLTS@BBi%
                    \renewcommand*{\thepage}{\erroralphalph{\AlphMult}{page}}%
                  \fi%
            \fi%
          \else%
            \ifx\pagesLTS@pnc\pagesLTS@fns%
%    \end{macrocode}
%
% Same for |\fnsymbol| page numbers.
%
%    \begin{macrocode}
              \ifpagesLTS@fnsymbolmult%
                \renewcommand*{\thepage}{\erroralphalph{\fnsymbolmult}{page}}%
              \fi%
            \else%
%    \end{macrocode}
%
% If the used page numbering scheme has not been recognized by the
% \xpackage{pageslts} package so far, we can do nothing, and problems
% might result.\\
%
%    \begin{macrocode}
              \PackageError{pageslts}{unknown page numbering scheme}{%
                The pageslts package encountered the unknown\MessageBreak%
                page numbering scheme\MessageBreak%
                `#1'. \MessageBreak%
                If this is no typing mistake, it might work\MessageBreak%
                - or it might not work.\MessageBreak%
                \@ehc%
                }
            \fi%
          \fi%
        \fi%
      \fi%
    \fi%
  \fi%
  \let\pagesLTS@tmpC\undefined%
  }

%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\pagenumbering}
% \indent Now for the \textbf{new} version of the |\pagenumbering| command:
%
%    \begin{macrocode}
\renewcommand{\pagenumbering}[1]{%
%    \end{macrocode}
%
% If the current page numbering scheme, |\pagesLTS@pnc|, or the
% requested page numbering scheme, |#1|, is |\pagesLTS@fns|,
% i.\,e. \texttt{fnsymbol}, the counter\texttt{pagesLTS.fnsymbol.local}
% is needed. If it does not exists yet, it is created here.
%
%    \begin{macrocode}
  \edef\pagesLTS@tmpA{#1}%
  \ifx\pagesLTS@pnc\pagesLTS@fns%
    \pagesLTS@ifcounter{pagesLTS.fnsymbol.local}%
  \fi%
  \ifx\pagesLTS@tmpA\pagesLTS@fns%
    \pagesLTS@ifcounter{pagesLTS.fnsymbol.local}%
  \fi%
%    \end{macrocode}
%
% If the current page numbering scheme, |\pagesLTS@pnc|, and the
% requested page numbering scheme, |#1|, is the same one, nothing
% further is done, otherwise the real action begins.
%
%    \begin{macrocode}
  \ifx\pagesLTS@pnc\pagesLTS@tmpA% \relax
  \else%
%    \end{macrocode}
%
% The next code is executed, when we are at a page after the first one.
% This distinction is done for two reasons:\\
% On the one hand, |\pagenumbering| could be called \textit{before}
% |\begin{document}| (where the current page should not be
% greater than one), and on the other hand we go one page back to
% aim all references to that page. Obviously at the first page
% there is no going backward.
%
%    \begin{macrocode}
    \ifnum \value{CurrentPage}>1%
      \addtocounter{page}{-1}%
      \addtocounter{pagesLTS.current.local.\pagesLTS@pnc}{-1}%
%    \end{macrocode}
%
% For the case that the page numbering scheme is or will be split,
% like e.\,g. the Roman one in the |pageslts-example.tex|, a counter
% like
% |pagesLTS.Roman.1.local.count|
% (or |pagesLTS.Roman.2.local.count|,
% |pagesLTS.Roman.3.local.count|,\ldots ) is introduced and set to the
% number of the local page.
%
%    \begin{macrocode}
      \newcounter{pagesLTS.\pagesLTS@pnc.\arabic{pagesLTS.pnc.\pagesLTS@pnc}.local.count}%
      \setcounter{pagesLTS.\pagesLTS@pnc.\arabic{pagesLTS.pnc.\pagesLTS@pnc}.local.count}{%
        \value{pagesLTS.current.local.\pagesLTS@pnc}}%
%    \end{macrocode}
%
% If the page numbering scheme is \xpackage{fnsymbol},
% and if it \textit{was} used before,
% from said counter the number of pages of the preceding uses
% of the same page numbering scheme, |pagesLTS.\pagesLTS@pnc.done|,
% is subtracted (same as for the other schemes, see below). Instead of introducing a new
% counter (which can be problematic, when the number of available counters is limited),
% we borrow the \texttt{pagesLTS.pnc.0} counter, i.\,e. we save its value to |\pagesLTS@tmpa|,
% (ab)use the counter, and then set it back to its former value as saved in |\pagesLTS@tmpa|.
%
%    \begin{macrocode}
      \ifx\pagesLTS@pnc\pagesLTS@fns%
        \ifnum \value{pagesLTS.pnc.\pagesLTS@pnc}>1%
          \mathchardef\pagesLTS@tmpa=\arabic{pagesLTS.pnc.0}%
          \setcounter{pagesLTS.pnc.0}{\value{pagesLTS.pnc.\pagesLTS@pnc}}%
          \addtocounter{pagesLTS.pnc.0}{-1}%
          \addtocounter{pagesLTS.\pagesLTS@pnc.\arabic{pagesLTS.pnc.\pagesLTS@pnc}.local.count}{%
            -\value{pagesLTS.\pagesLTS@pnc.\arabic{pagesLTS.pnc.0}.local.count}}%
          \setcounter{pagesLTS.pnc.0}{\pagesLTS@tmpa}%
        \fi%
%    \end{macrocode}
%
% If the page numbering scheme is \textit{not} \xpackage{fnsymbol},
% a~numbered label is written:
%
%    \begin{macrocode}
      \else%
        \pagesLTS@writelabel{\pagesLTS@pnc.\arabic{pagesLTS.pnc.\pagesLTS@pnc}}%
%    \end{macrocode}
%
% If the page numbering scheme was \textit{not} used before,
%
%    \begin{macrocode}
        \ifnum \value{pagesLTS.pnc.\pagesLTS@pnc}<2%
%    \end{macrocode}
%
% an unnumbered label is also written:
%
%    \begin{macrocode}
          \pagesLTS@writelabel{\pagesLTS@pnc}%
%    \end{macrocode}
%
% If the page numbering scheme \textit{was} used before,
% from said counter the number of pages of the preceding uses
% of the same page numbering scheme, |pagesLTS.\pagesLTS@pnc.done|,
% is subtracted. Instead of introducing a new
% counter (which can be problematic, when the number of available counters is limited),
% we again borrow the \texttt{pagesLTS.pnc.0} counter (see above).
%
%    \begin{macrocode}
        \else%
          \mathchardef\pagesLTS@tmpa=\arabic{pagesLTS.pnc.0}%
          \setcounter{pagesLTS.pnc.0}{\value{pagesLTS.pnc.\pagesLTS@pnc}}%
          \addtocounter{pagesLTS.pnc.0}{-1}%
          \pagesLTS@ifcounter{pagesLTS.\pagesLTS@pnc.done}%
          \addtocounter{pagesLTS.\pagesLTS@pnc.done}{%
            \value{pagesLTS.\pagesLTS@pnc.\arabic{pagesLTS.pnc.0}.local.count}}%
          \addtocounter{pagesLTS.\pagesLTS@pnc.\arabic{pagesLTS.pnc.\pagesLTS@pnc}.local.count}{%
            -\value{pagesLTS.\pagesLTS@pnc.done}}%
          \setcounter{pagesLTS.pnc.0}{\pagesLTS@tmpa}%
        \fi%
%    \end{macrocode}
%
% The values are written to the \xfile{.aux} file
% (if writing is allowed: |\if@filesw|),
% because they must be available at the beginning of the document:
%
%    \begin{macrocode}
        \if@filesw%
          \immediate\write\@auxout{\string
            \pagesLTS@ifcounter{pagesLTS.\pagesLTS@pnc.\arabic{pagesLTS.pnc.\pagesLTS@pnc}.local.cnt}}%
        \fi%
        \edef\pagesLTS@tmpB{\arabic{pagesLTS.\pagesLTS@pnc.\arabic{pagesLTS.pnc.\pagesLTS@pnc}.local.count}}%
        \if@filesw%
          \immediate\write\@auxout{\string
            \setcounter{pagesLTS.\pagesLTS@pnc.\arabic{pagesLTS.pnc.\pagesLTS@pnc}.local.cnt}{\pagesLTS@tmpB}}%
        \fi%
      \fi%
%    \end{macrocode}
%
% For further code for the case of \xpackage{fnsymbol} please see below
% (|\lastpagereftext|, page~\pageref{lastpagereftextlabel}).\\
% The last page number is saved, in case the same page
% numbering scheme is continued later.
%
%    \begin{macrocode}
      \pagesLTS@ifcounter{pagesLTS.double.\pagesLTS@pnc}%
      \setcounter{pagesLTS.double.\pagesLTS@pnc}{\value{page}}%
%    \end{macrocode}
%
% We went back one page, so we must go forward again:
%
%    \begin{macrocode}
      \addtocounter{pagesLTS.current.local.\pagesLTS@pnc}{+1}%
      \addtocounter{page}{+1}%
%    \end{macrocode}
%
% The page numbering scheme |\pagesLTS@pnc| is now set to
% the new one, given by the user as argument with the
% |\pagenumbering{...}| command:
%
%    \begin{macrocode}
      \xdef\pagesLTS@pnc{#1}%
%    \end{macrocode}
%
% The new page numbering scheme is now started for real:
%
%    \begin{macrocode}
      \OrigPagenumbering{#1}%
%    \end{macrocode}
%
% If a page numbering scheme not known by the original
% |\pagenumbering{...}| command is used, an error will
% arise here - but maybe without error message.\\
%
% If page numbering schem |\alph|, |\Alph|, or |\fnsymbol| is used,
% \xpackage{pageslts} extends the page numbers according to
% the given options, using the \xpackage{alphalph} package.
% |\arabic| does not need any expansion.
% |\roman| and |\Roman| at least receive a definition for
% zero.
%
%    \begin{macrocode}
      \expandPagenumbering{#1}%
%    \end{macrocode}
%
% Counters like |pagesLTS.pnc.Roman| are introduced:
%
%    \begin{macrocode}
      \pagesLTS@ifcounter{pagesLTS.pnc.\pagesLTS@pnc}%
%    \end{macrocode}
%
% The saved number of times this page numbering scheme was used
% is increased by one:
%
%    \begin{macrocode}
      \addtocounter{pagesLTS.pnc.\pagesLTS@pnc}{1}%
%    \end{macrocode}
%
% \indent Now defining the counter |pagesLTS.double.\pagesLTS@pnc|,
% if it did not exist already, adding~1, because this is
% the first page of it (or another one, if the scheme is
% continued):
%
%    \begin{macrocode}
      \pagesLTS@ifcounter{pagesLTS.double.\pagesLTS@pnc}%
      \addtocounter{pagesLTS.double.\pagesLTS@pnc}{1}%
%    \end{macrocode}
%
% The page number is continued, if the option |pagecontinue=false|
% is \textbf{not} set, otherwise it is reset to one. Note that neither
% the local nor the current counter are reset, as they contain
% the real \textit{values} and not the \textit{names} of the pages.
%
%    \begin{macrocode}
      \ifpagesLTS@pagecontinue%
        \setcounter{page}{\value{pagesLTS.double.\pagesLTS@pnc}}%
      \else%
        \setcounter{page}{1}%
      \fi%
%    \end{macrocode}
%
% If it does not exist already, the counter
% |pagesLTS.current.local.\pagesLTS@pnc|
% (e.\,g. |pagesLTS.current.local.Roman|) is created.
%
%    \begin{macrocode}
      \pagesLTS@ifcounter{pagesLTS.current.local.\pagesLTS@pnc}%
%    \end{macrocode}
%
% If |pagesLTS.double.\pagesLTS@pnc| of the current page numbering
% scheme is equal to one, this is the first page of this page
% numbering scheme. Then |pagesLTS.current.local.\pagesLTS@pnc|
% (which was zero) is set to one.
%
%    \begin{macrocode}
      \ifnum \value{pagesLTS.double.\pagesLTS@pnc}=1%
        \setcounter{pagesLTS.current.local.\pagesLTS@pnc}{1}%
      \fi%
%    \end{macrocode}
%
% Otherwise, i.\,e. if |\value{CurrentPage}| is not |>1|,
% i.\,e. before the first page has shiped out:
%
%    \begin{macrocode}
    \else%
      %% before the first page has shipped out
%    \end{macrocode}
%
% The current page numbering scheme is defined by the
% argument of |\pagenumbering{...}|, which the user gave:
%
%    \begin{macrocode}
      \xdef\pagesLTS@pnc{#1}%
%    \end{macrocode}
%
% \noindent and the page numbering scheme set by the original
% page numbering command
% (1994/05/19 v1.1a LaTeX Kernel File w ltpageno.dtx 52 Page Numbering),
% which resets the page number to one,
% but at the first page continuation does not make sense).
% Well, nearly the original page numbering command:
% |\OrigPagenumbering{\pagesLTS@pnc}| does not work,
% so we \textquotedblleft expand\textquotedblright{} the
% |\OrigPagenumbering| command:
%
%    \begin{macrocode}
      \global\c@page \@ne\relax%
      \global\def\thepage{\csname \expandafter @\pagesLTS@pnc \endcsname \c@page}%
%    \end{macrocode}
%
% If a page numbering scheme is used, which is not known by
% \LaTeX , an error might arise here -- but maybe without error message.\\
%
% If page numbering scheme |\alph|, |\Alph|, or |\fnsymbol| is used,
% \xpackage{pageslts} extends the page numbers according to
% the given options, using the \xpackage{alphalph} package.
% |\arabic| does not need any expansion.
% |\roman| and |\Roman| at least receive a definition for
% zero.
%
%    \begin{macrocode}
      \expandPagenumbering{#1}
%    \end{macrocode}
%
% We are at the first page, so the page counters are set to one:
%
%    \begin{macrocode}
      \pagesLTS@ifcounter{pagesLTS.pnc.\pagesLTS@pnc}%
      \setcounter{pagesLTS.pnc.\pagesLTS@pnc}{1}%
      \pagesLTS@ifcounter{pagesLTS.double.\pagesLTS@pnc}%
      \setcounter{pagesLTS.double.\pagesLTS@pnc}{1}%
      \pagesLTS@ifcounter{pagesLTS.current.local.\pagesLTS@pnc}%
      \setcounter{pagesLTS.current.local.\pagesLTS@pnc}{1}%
    \fi%
%    \end{macrocode}
%
% Whether |\pagenumbering{...}| is called in the preamble,
% |\AtBeginDocument|, right after |\begin{document}|,
% or somewhere in the document, we want to remember
% \textit{whether} it was called at all:
%
%    \begin{macrocode}
    \gdef\pagesLTS@called{1}%
  \fi%
%    \end{macrocode}
%
% We do not need the temporary definitions any more.
%
%    \begin{macrocode}
  \let\pagesLTS@tmpA\undefined%
  \let\pagesLTS@tmpB\undefined%
  }

%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\lastpageref*}
% If \xpackage{hyperref} is used, but (some) references to some last page shall
% not be hyperlinked, a command |\lastpageref*| (analogous to |\pageref*|) is
% needed. Therefore we define (analogous to |\HyPsd@pageref| from
% the \xpackage{hyperref} package by \textsc{Heiko Oberdiek})
%
%    \begin{macrocode}
%% analogous to \HyPsd@pageref from the hyperref package by Heiko Oberdiek:
\def\lastpagereftxt#1{\pagesLTS@@pageref#1*\END}

%    \end{macrocode}
%
% Macro |\pagesLTSpageref| checks, whether a star is present (analogous to
% |\HyPsd@@pageref| again from the \xpackage{hyperref} package
% of \textsc{Heiko Oberdiek}):
%
%    \begin{macrocode}
\def\pagesLTS@@pageref#1*#2\END{%
  \ifx\\#2\\% no star
    \pagesLTS@@@pageref{#1}%
  \else% star
    \expandafter\pagesLTS@@@pagerefstar%
  \fi%
}

\def\pagesLTS@@@pageref#1{\lastpagereftext{#1}}
\def\pagesLTS@@@pagerefstar#1{\lastpagereftextstar{#1}}

%    \end{macrocode}
% \end{macro}
%
% \phantomsection
% \begin{macro}{\lastpagereftext} \label{lastpagereftextlabel}
% \indent When |\lastpageref| is used somewhere inside the \texttt{txt} (text),
% i.\,e. not at the last page, it is defined as |\lastpagereftxt| (see above).
% When the page numbering scheme is \xpackage{fnsymbol}, and the \xpackage{hyperref}
% package has been loaded, a hyperref instead of a label is used for the reference
% to |pagesLTS.fnsymbol.local.\arabic{pagesLTS.fnsymbol.local}|.
% (And if the \texttt{pagesLTS.fnsymbol.local} counter did not exist yet,
% it is created here.)\\
%
%    \begin{macrocode}
\newcommand{\lastpagereftext}[1]{%
  \def\pagesLTS@tmpA{#1}%
  \def\pagesLTS@tmpB{pagesLTS.fnsymbol.local}%
  \ifx\pagesLTS@tmpA\pagesLTS@tmpB%
    \pagesLTS@ifcounter{pagesLTS.fnsymbol.local}%
    \ltx@ifpackageloaded{hyperref}{%
      \href{\#pagesLTS.fnsymbol.local.\arabic{pagesLTS.fnsymbol.local}}%
        {\arabic{pagesLTS.fnsymbol.local}}%
%    \end{macrocode}
%
% When the page numbering scheme is \xpackage{fnsymbol}, but the \xpackage{hyperref} package
% has \textit{not} been loaded, just the arabic number of the
% \texttt{pagesLTS.fnsymbol.local} counter is given (because there will be
% no hyperlink anyway).
%
%    \begin{macrocode}
     }{\arabic{pagesLTS.fnsymbol.local}}%
%    \end{macrocode}
%
% Otherwise just the common |\pageref| is applied:
%
%    \begin{macrocode}
  \else%
    \pageref{#1}%
  \fi%
%    \end{macrocode}
%
% We do not need the temporary definitions any more.
%
%    \begin{macrocode}
  \let\pagesLTS@tmpA\undefined%
  \let\pagesLTS@tmpB\undefined%
  }

%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\lastpagereftextstar}
% And the same for the starred version, where no hyperlink is generated:
%
%    \begin{macrocode}
\newcommand{\lastpagereftextstar}[1]{%
  \def\pagesLTS@tmpA{#1}%
  \def\pagesLTS@tmpB{pagesLTS.fnsymbol.local}%
  \ifx\pagesLTS@tmpA\pagesLTS@tmpB%
     \pagesLTS@ifcounter{pagesLTS.fnsymbol.local}%
     \arabic{pagesLTS.fnsymbol.local}%
  \else%
%    \end{macrocode}
%
% There is no |\pageref*| without \xpackage{hyperref}.
%
%    \begin{macrocode}
    \ltx@ifpackageloaded{hyperref}{\pageref*{#1}}{\pageref{#1}}%
  \fi%
  \let\pagesLTS@tmpA\undefined%
  \let\pagesLTS@tmpB\undefined%
  }

%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\lastpagerefend}
% \indent When the \xpackage{hyperref} package is used and the page numbering scheme
% of the last page is \xpackage{fnsymbol}, |\lastpageref| is defined as
% |\lastpagerefend|.
% Hyperrefs instead of labels are used for the reference to
% \xpackage{fnsymbol} pages (including the last one).\\
%
% Again it must be discriminated between unstarred form and starred form:
%
%    \begin{macrocode}
\def\lastpagerefend#1{\pagesLTS@@pagerefend#1*\END}

\def\pagesLTS@@pagerefend#1*#2\END{%
  \ifx\\#2\\% no star
    \pagesLTS@@@pagerefend{#1}%
  \else% star
    \expandafter\pagesLTS@@@pagerefendstar%
  \fi%
}

\def\pagesLTS@@@pagerefend#1{\l@stpagerefend{#1}}
\def\pagesLTS@@@pagerefendstar#1{\l@stpagerefendstar{#1}}

%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\l@stpagerefend}
% The unstarred form (i.\,e. with hyperlinks, if \xpackage{hyperref} is loaded,
% otherwise without hyperlinks):
%
%    \begin{macrocode}
\newcommand{\l@stpagerefend}[1]{%
  \def\pagesLTS@tmpA{#1}%
  \def\pagesLTS@tmpB{pagesLTS.fnsymbol.local}%
  \ifx\pagesLTS@tmpA\pagesLTS@tmpB%
    \pagesLTS@ifcounter{pagesLTS.fnsymbol.local}%
    \ltx@ifpackageloaded{hyperref}{%
      \href{\#pagesLTS.fnsymbol.local.\arabic{pagesLTS.fnsymbol.local}}%
        {\arabic{pagesLTS.fnsymbol.local}}%
     }{\arabic{pagesLTS.fnsymbol.local}}%
  \else%
    \def\pagesLTS@tmpB{pagesLTS.fnsymbol}%
    \ifx\pagesLTS@tmpA\pagesLTS@tmpB%
      \ltx@ifpackageloaded{hyperref}{%
        \href{\#pagesLTS.fnsymbol.local.\arabic{pagesLTS.fnsymbol.local}}%
          {\pagesLTS.lastpage}%
       }{\pageref{pagesLTS.fnsymbol}}%
    \else%
      \def\pagesLTS@tmpB{LastPage}%
      \ifx\pagesLTS@tmpA\pagesLTS@tmpB%
        \ltx@ifpackageloaded{hyperref}{%
          \href{\#pagesLTS.fnsymbol.local.\pagesLTS@eso}%
            {\pagesLTS.lastpage}%
         }{\pageref{LastPage}}%
      \else%
        \def\pagesLTS@tmpB{VeryLastPage}%
        \ifx\pagesLTS@tmpA\pagesLTS@tmpB%
          \ltx@ifpackageloaded{hyperref}{%
            \href{\#pagesLTS.fnsymbol.local.\arabic{pagesLTS.fnsymbol.local}}%
              {\pagesLTS.lastpage}%
           }{\pageref{VeryLastPage}}%
        \else%
          \def\pagesLTS@tmpB{LastPages}%
          \ifx\pagesLTS@tmpA\pagesLTS@tmpB%
            \ltx@ifpackageloaded{hyperref}{%
              \href{\#pagesLTS.fnsymbol.local.\arabic{pagesLTS.fnsymbol.local}}%
                {\arabic{pagesLTS.pagenr}}%
             }{\pageref{LastPages}}%
          \else%
            \pageref{#1}%
          \fi%
        \fi%
      \fi%
    \fi%
  \fi%
%    \end{macrocode}
%
% We do not need the temporary definitions any more.
%
%    \begin{macrocode}
  \let\pagesLTS@tmpA\undefined%
  \let\pagesLTS@tmpB\undefined%
  }

%    \end{macrocode}
% \end{macro}
%
% \pagebreak
%
% \begin{macro}{\l@stpagerefendstar}%
% And the starred form, without hyperlinks, even if \xpackage{hyperref} is loaded,
% otherwise (i.\,e. without loaded \xpackage{hyperref}) this command is not called:
%
%    \begin{macrocode}
\newcommand{\l@stpagerefendstar}[1]{%
  \def\pagesLTS@tmpA{#1}%
  \def\pagesLTS@tmpB{pagesLTS.fnsymbol.local}%
  \ifx\pagesLTS@tmpA\pagesLTS@tmpB%
    \pagesLTS@ifcounter{pagesLTS.fnsymbol.local}%
    \arabic{pagesLTS.fnsymbol.local}%
  \else%
    \def\pagesLTS@tmpB{pagesLTS.fnsymbol}%
    \ifx\pagesLTS@tmpA\pagesLTS@tmpB%
      \ltx@ifpackageloaded{hyperref}{\pageref*{pagesLTS.fnsymbol}}{%
        \pageref{pagesLTS.fnsymbol}}%
    \else%
      \def\pagesLTS@tmpB{LastPage}%
      \ifx\pagesLTS@tmpA\pagesLTS@tmpB%
        \ltx@ifpackageloaded{hyperref}{\pageref*{LastPage}}{\pageref{LastPage}}%
      \else%
        \def\pagesLTS@tmpB{VeryLastPage}%
        \ifx\pagesLTS@tmpA\pagesLTS@tmpB%
          \ltx@ifpackageloaded{hyperref}{\pageref*{VeryLastPage}}{%
            \pageref{VeryLastPage}}%
        \else%
          \def\pagesLTS@tmpB{LastPages}%
          \ifx\pagesLTS@tmpA\pagesLTS@tmpB%
            \ltx@ifpackageloaded{hyperref}{\pageref*{LastPages}}{\pageref{LastPages}}%
          \else%
            \ltx@ifpackageloaded{hyperref}{\pageref*{#1}}{\pageref{#1}}%
            \fi%
          \fi%
        \fi%
      \fi%
    \fi%
  \fi%
  \let\pagesLTS@tmpA\undefined%
  \let\pagesLTS@tmpB\undefined%
  }

%    \end{macrocode}
% \end{macro}
%
% \pagebreak
%
% \begin{macro}{\overrideLTSlabel}
% |\overridelabel| from the \xpackage{undolabl} package just |\undonewlabel|s
% a~label and places a new |\label{#1}|, but we need to place a
% |\pagesLTS@putlabel{#1}{#2}|, therefore we need another command instead of
% (but somewhat similar to) |\overridelabel|:
%
%    \begin{macrocode}
% somewhat analogous to \overridelabel from the undolabl package:
\newcommand\overrideLTSlabel[2]{%
  \@bsphack
    \ifnum \value{pagesLTS.pnc.\pagesLTS@pnc}>1%
      \edef\pagesLTStmpA{#1}%
      \edef\pagesLTStmpB{pagesLTS.\pagesLTS@pnc.local}%
      \ifx\pagesLTStmpA\pagesLTStmpB%
          \immediate\write\@auxout{\string\undonewlabel{#1}}%
          \@overriddenmessage s{#1}%
      \fi%
    \fi%
    \pagesLTS@putlabel{#1}{#2}{0}%
  \@esphack%
  }

%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@pagesLTS@Prelim@EveryShipout}
% \indent Because we cannot make references to pages with \xpackage{fnsymbol}
% page \textquotedblleft numbers\textquotedblright{} manually
% with \xpackage{hyperref}, we use \nolinebreak{|\phantomsection|\,s} and
% refer to one of those. But because we do not know how many
% \nolinebreak{|\phantomsection|\,s} and \nolinebreak{|\section*|\,s}
% are introduced by the user (or other packages;
% cf.~\LaTeX~bug~2298: knowing level of |section*|,
% \ \url{http://www.latex-project.org/cgi-bin/ltxbugs2html?category=LaTeX&responsible=anyone&state=open&keyword=&pr=latex%2F2298&search=}),
% we cannot refer to the last one as we did with the pages.
%
%    \begin{macrocode}
\newcommand{\@pagesLTS@Prelim@EveryShipout}{%
%% The following code is from the prelim2e package             %%
%% [2009/05/29 v1.3] by Martin Schr\"{o}der (Thanks!):         %%
  \bgroup
    \dimen\z@=\wd\@cclv
    \dimen\@ne=\ht\@cclv
    \dimen\tw@=\dp\@cclv
    \dimen\thr@@=\dimen1
    \advance\dimen\thr@@ by \dimen\tw@
    \global\setbox\@cclv\vbox to \dimen\thr@@{%
      \hb@xt@\dimen\z@{%
        \box\@cclv%
        \hss%
        }%
      \vbox to \z@{%
        \hb@xt@\dimen\z@{%
          \let\protect\relax
%% Code not from prelim2e package:                             %%
%    \end{macrocode}
%
% Therefore each page with \xpackage{fnsymbol} page
% \textquotedblleft number\textquotedblright{} receives a
% |\phantomsection| and a label, which includes a number increased
% by one for each page. This is done for
% |pagesLTS.fnsymbol.local.\arabic{pagesLTS.fnsymbol.cont}|
% as well as
% |pagesLTS.fnsymbol|, |pagesLTS.\pagesLTS@pnc|, and
% |pagesLTS.\pagesLTS@pnc.local|.\\
% In case an older label already existed, it is overwritten by an
% |\overridelabel| command.
%
%    \begin{macrocode}
          \ifx\pagesLTS@pnc\pagesLTS@fns%
            \pagesLTS@ifcounter{pagesLTS.fnsymbol.cont}%
            \addtocounter{pagesLTS.fnsymbol.cont}{1}%
            \ltx@ifpackageloaded{hyperref}{%
              \phantomsection%
              \hypertarget{pagesLTS.fnsymbol.local.\arabic{pagesLTS.fnsymbol.cont}}{}%
              }{}%
            \ifnum \pagesLTS@esov=\pagesLTS@zero%
              \label{pagesLTS.fnsymbol}%
            \else%
              \overridelabel{pagesLTS.fnsymbol}%
            \fi%
          \else%
            \ltx@ifpackageloaded{hyperref}{\phantomsection}{}%
            \if@filesw%
              \overridelabel{pagesLTS.\pagesLTS@pnc}%
%    \end{macrocode}
%
% We need to go forward one page (and later backward again), because
% |\overrideLTSlabel| calls a |\pagesLTS@putlabel|, and that one uses
% |\addtocounter{page}{-1}...\addtocounter{page}{+1}|, which is not
% needed here.
%
%    \begin{macrocode}
              \addtocounter{page}{+1}%
                \overrideLTSlabel{pagesLTS.\pagesLTS@pnc.local}{\theCurrentPageLocal}%
              \addtocounter{page}{-1}%
            \fi%
          \fi%
%% Code from prelim2e package again:                           %%
        }%
        \vss%
      }%
      \vss%
    }%
    \wd\@cclv=\dimen\z@
    \ht\@cclv=\dimen\@ne
    \dp\@cclv=\dimen\tw@
  \egroup
%% End of code from the prelim2e package.                      %%
  }

%    \end{macrocode}
% \end{macro}
%
% \pagebreak
%
% \begin{macro}{\EveryShipout}
% \indent At the end of each shipout, the following commands are executed:
%
%    \begin{macrocode}
\EveryShipout{%
  \ifnum\value{page}>0% \relax
  \else%
    \ifnum\value{page}=0%
      \PackageWarning{pageslts}{%
        Counter `page' is zero!\MessageBreak%
        If the page numbering scheme is not arabic\MessageBreak%
        and further not extended\MessageBreak%
        (see Page counter overflow in the pageslts\MessageBreak%
        documentation), without other measures\MessageBreak%
        this will lead to a counter overflow.\MessageBreak%
      }%
    \else%
      \ifnum\value{page}<0%
        \PackageWarning{pageslts}{%
          Counter `page' is negative: `\the\value{page}'!\MessageBreak%
          If the page numbering scheme is not arabic\MessageBreak%
          and further not extended\MessageBreak%
          (see Page counter overflow in the pageslts\MessageBreak%
          documentation), without other measures\MessageBreak%
          this will lead to a counter overflow.\MessageBreak%
        }%
      \else%
        \PackageError{pageslts}{%
          Counter `page' does not have a recognized value:\MessageBreak%
          `\the\value{page}'\MessageBreak%
          \@ehd \MessageBreak%
          }%
      \fi%
    \fi%
  \fi%
%    \end{macrocode}
%
% If the |CurrentPage| is equal to one, this is the first shipout.
%
%    \begin{macrocode}
  \ifnum \value{CurrentPage}=1% This is the first shipout!
%    \end{macrocode}
%
% We check whether some page numbering scheme was defined by
% |\pagenumbering{...}| (\textbf{as it schould be!}):
%
%    \begin{macrocode}
    \ifx\pagesLTS@called\pagesLTS@zero%
%    \end{macrocode}
%
% If it was not defined (i.\,e. |\pagesLTS@called| is zero),
% the user should be informed, that a |\pagenumbering{...}|
% is missing behind |\begin{document}|.
% Of course, it is possible that some package did some
% pages of output with |\AtBeginDocument|. In that case,
% one |\pagenumbering{...}| before |\begin{document}| and
% one |\pagenumbering{...}| (with the same argument, of course!)
% behind |\begin{document}| could help somewhat. When |\PackageError|
% was used here, the error message was not written to the screen and
% the \xfile{.log}-file, but into the document. Therefore we just make
% a note to give the error message later (|\AtEndDocument|). At that
% time unfortunately most of the document has already been compiled
% (or did not compile due to this error), but I do not know how to
% change that.
%
%    \begin{macrocode}
      \global\def\pncmissing{1}%
%    \end{macrocode}
%
% We save the current value of the page,
%
%    \begin{macrocode}
      \mathchardef\pagesLTS@tmpD=\arabic{page}%
%    \end{macrocode}
%
% determine the current page numbering scheme,
%
%    \begin{macrocode}
%% Code from Andres L\"{o}h, Universiteit Utrecht (NL)         %%
      \def\extract#1{\expandafter\extract@ #1\END}%
      \def\extract@#1\csname @#2\endcsname#3\END{#2}%
      \edef\pagesLTS@tmpQ{\extract\thepage}%
%% End of code from Andres L\"{o}h                             %%
      \let\pagesLTS@tmpP\pagesLTS@tmpQ%
%    \end{macrocode}
%
% set the current page numbering scheme to~0
% (because before the beginning of the document it should be~0),
%
%    \begin{macrocode}
      \def\pagesLTS@pnc{0}%
%    \end{macrocode}
%
% and then issue a |\pagenumbering| command with the determined
% page numbering scheme as argument:
%
%    \begin{macrocode}
      \pagenumbering{\pagesLTS@tmpP}%
%    \end{macrocode}
%
% This resets the page to one (if option |pagecontinue=false|
% was chosen), but because we do not start a new page numbering
% scheme here but manifest a page numbering scheme, which
% the user forgot to define, the page number should not have
% been reset to one. (This is the first page, but maybe the user
% wants it to have page number 2001?) Therefore we revert this here
% and set the page number to its value, which was saved before the
% |\pagenumbering| command.
%
%    \begin{macrocode}
      \setcounter{page}{\pagesLTS@tmpD}%
    \fi%
%    \end{macrocode}
%
% We are at the first page, so we put the label here.
%
%    \begin{macrocode}
    \pagesLTS@writelabel{0}%
  \fi%
%    \end{macrocode}
%
% If the current page numbering scheme |\pagesLTS@pnc| is
% |\pagesLTS@fns| (which is defined as \texttt{fnsymbol}),
% the label is set by \linebreak
% |\@pagesLTS@Prelim@EveryShipout| (see just above),
% and |\pagesLTS@esov| is set to the (real) number (not the name) of
% this page numbering scheme, |\arabic{pagesLTS.fnsymbol.cont}|.\\
% When no more pages with \xpackage{fnsymbol} page
% \textquotedblleft number\textquotedblright{} are shipped out,
% the value remains fixed and we have our reference to the last page
% of the \xpackage{fnsymbol} page numbering range.
% (At least we will have that reference after some more work,
% see below).
%
%    \begin{macrocode}
  \ifx\pagesLTS@pnc\pagesLTS@fns%
    \@pagesLTS@Prelim@EveryShipout%
    \gdef\pagesLTS@esov{\arabic{pagesLTS.fnsymbol.cont}}%
%    \end{macrocode}
%
% When another page numbering scheme was reused (in the example file
% \xpackage{Roman}), we also need to apply\\
% |\@pagesLTS@Prelim@EveryShipout|,
% because otherwise we would get multiply defined labels.
%
%    \begin{macrocode}
  \else%
    \ifnum \value{pagesLTS.pnc.\pagesLTS@pnc}>1%
      \@pagesLTS@Prelim@EveryShipout%
    \fi%
  \fi%
%    \end{macrocode}
%
% The |CurrentPage| as well as the |pagesLTS.current.local.\pagesLTS@pnc|
% are advanced by one (because one page was shipped out and the next is
% about to begin).
%
%    \begin{macrocode}
  \addtocounter{CurrentPage}{1}%
  \addtocounter{pagesLTS.current.local.\pagesLTS@pnc}{1}%
  }

%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\pagesLTS@putlabelhyper}
% \indent Here the labels are set, if the \xpackage{hyperref} package
% was loaded. Simply using |\label| would not work, because labels
% wait for the output routines to work, and there may not be any
% more invocations of the output routines. To force the write out
% we need to do an |\immediate| write.
%
%    \begin{macrocode}
\newcommand{\pagesLTS@putlabelhyper}[2]{%
  \ifHy@pageanchor \relax%
  \else%
%    \end{macrocode}
%
% If the \xpackage{hyperref} package is used, but pageanchors are disabled,
% the hyperlinking will not work.
%
%    \begin{macrocode}
    \PackageError{pagesLTS}{hyperref option pageanchor disabled}{%
      The \string\lastpageref{#1} link doesn't work\MessageBreak%
      using hyperref with disabled option `pageanchor'.\MessageBreak%
    }%
  \fi
%    \end{macrocode}
%
% If use of the \xfile{.aux}-file is allowed, the label for
% \texttt{LastPage} is written into that file, the page
% reference depending on the options, which where set for
% the \xpackage{hyperref} package.
%
%    \begin{macrocode}
%% The following code is from the hyperref package             %%
%% [2010/04/17 v6.80x; newer versions are available]           %%
%% by Heiko Oberdiek (Big Thanks!).                            %%
  \if@filesw
    \begingroup
      \let\@number\@firstofone
      \ifHy@pageanchor
        \ifHy@hypertexnames
          \ifHy@plainpages
            \def\Hy@temp{\arabic{page}}%
          \else
            \Hy@unicodefalse
%% Code not from hyperref package:                             %%
%% The following lines are modified from the hyperref package. %%
%% Without the modification, after the first shipout "PD1" is  %%
%% inserted each time |\pdfstringdef\Hy@temp{\thepage}| is     %%
%% executed (if |fnsymbol| is not used).                       %%
            \ifnum \value{CurrentPage}=1%
              \ifx\pagesLTS@pnc\pagesLTS@fns%
                \pdfstringdef\Hy@temp{\thepage}%
              \else%
                \def\Hy@temp{\thepage}%
              \fi%
            \else%
              \pdfstringdef\Hy@temp{\thepage}%
            \fi%
%% Code from hyperref package again:                           %%
          \fi
        \else
          \def\Hy@temp{\the\Hy@pagecounter}%
        \fi
      \fi
%% End of code from the hyperref package.                      %%
%% (The following four lines are modified                      %%
%%  from the hyperref package.)                                %%
      \immediate\write\@auxout{\string
        \newlabel{#1}{{}{#2}{}{\ifHy@pageanchor page.\Hy@temp\fi}{}}}%
    \endgroup%
  \fi%
  }

%    \end{macrocode}
% \end{macro}
%
% \phantomsection
% \begin{macro}{\pagesLTS@putlabel}\label{pagesLTSputlabel}
% \indent Since the page has been put out, we are on the page after
% that page. We therefore subtract one from the page counter.
%
%    \begin{macrocode}
\newcommand{\pagesLTS@putlabel}[3]{%
  \addtocounter{page}{-1}%
%    \end{macrocode}
%
% When the \xpackage{showkeys} package has been loaded in \texttt{draft} mode,
% in the margin for each label a box is displayed with the name of the label.
% \xpackage{showkeys} accomplishes this by redefining |\label|, but
% \xpackage{pageslts} does not use |\label|, but writes directly to the
% {\nobreak |\jobname|\xfile{.aux}-}\allowbreak file, and this is generally done
% \emph{after} the according page has shipped out, therefore no box can be placed
% on the \emph{preceding} page. At least \xpackage{pageslts} gives a warning, that
% \xpackage{showkeys} cannot present the respective label.
%
%    \begin{macrocode}
  \ifx\pagesLTS@SK\pagesLTS@one\relax%
    \message{^^J}%
    \message{Package pageslts Warning: Package showkeys without option final loaded,}%
    \ifnum\value{pagesLTS.pagenr}<1%
      \message{(pageslts)                but label #1 on page \thepage\space(about \theCurrentPage)}%
    \else%
      \message{(pageslts)                but label #1 on page \thepage\space(about \theCurrentPage\space of \arabic{pagesLTS.pagenr})}%
    \fi%
    \message{(pageslts)                cannot be shown, because pageslts does not use \string\label,}%
    \message{(pageslts)                but writes directly to the \jobname.aux file. ^^J}%
  \fi%
%    \end{macrocode}
%
% If the \xpackage{hyperref} package is used, the format of the labels is somewhat longer.
%
%    \begin{macrocode}
  \ltx@ifpackageloaded{hyperref}{\pagesLTS@putlabelhyper{#1}{#2}}{% else
%    \end{macrocode}
%
% \pagebreak
%
% If the \xpackage{hyperref} package is not used, there will be no hyperlinks,
% and the label is written in the way of the old \xpackage{lastpage} package.
% But we must remember to undo the label first, if it already exists.
%
%    \begin{macrocode}
    \if@filesw%
      \ifnum \value{pagesLTS.pnc.\pagesLTS@pnc}<2%
%    \end{macrocode}
%
% When the \xpackage{nameref} package is used, |\newlabel| needs five instead of two arguments:
%
%    \begin{macrocode}
        \ltx@ifpackageloaded{nameref}{%
          \immediate\write\@auxout{\string\newlabel{#1}{{}{#2}{}{}{}}}}{% else
          \immediate\write\@auxout{\string\newlabel{#1}{{}{#2}}}}%
      \else%
        \edef\pagesLTStmpA{#1}%
        \edef\pagesLTStmpB{pagesLTS.\pagesLTS@pnc.local}%
        \ifx\pagesLTStmpA\pagesLTStmpB%
          \edef\pagesLTStmpA{#3}%
          \ifx\pagesLTStmpA\pagesLTS@one%
%    \end{macrocode}
%
% Only when the third argument of |\pagesLTS@putlabel| is $1$,
% we do need to undo the label. Otherwise there is no label to
% undo, and the \xpackage{undolabl} package would give an error.
%
%    \begin{macrocode}
            \immediate\write\@auxout{\string\undonewlabel{#1}}%
          \fi%
        \fi%
        \ltx@ifpackageloaded{nameref}{%
          \immediate\write\@auxout{\string\newlabel{#1}{{}{#2}{}{}{}}}}{% else
          \immediate\write\@auxout{\string\newlabel{#1}{{}{#2}}}}%
      \fi%
    \fi%
  }%
%    \end{macrocode}
%
% After the writeout we restore the page number again,
% since there might be other things still to be done.
%
%    \begin{macrocode}
  \addtocounter{page}{+1}%
  }

%    \end{macrocode}
% \end{macro}
%
% \pagebreak
%
% \begin{macro}{\pagesLTS@putlabels}
% \indent |\pagesLTS@putlabels| is nearly identical to |\pagesLTS@putlabelV|:
%
%    \begin{macrocode}
\newcommand{\pagesLTS@putlabels}{%
  \addtocounter{page}{-1}%
  \addtocounter{CurrentPage}{-1}%
  \addtocounter{pagesLTS.current.local.\pagesLTS@pnc}{-1}%
%    \end{macrocode}
%
% If |\pagenumbering{...}| has not been used,
% |\pagesLTS@pnc| is still zero ($0$, |\pagesLTS@zero|),
% and the according warning message is given.
%
%    \begin{macrocode}
  \ifx\pagesLTS@pnc\pagesLTS@zero%
   \PackageWarning{pagesLTS}{No page numbering scheme found:\MessageBreak%
     \pagesLTS@messageNPN }%
%    \end{macrocode}
%
% \noindent otherwise the numbered label is written,
% and if the page numbering scheme was not used before,
% the unnumbered label is written, too.
%
%
%    \begin{macrocode}
  \else%
    \pagesLTS@writelabel{\pagesLTS@pnc.\arabic{pagesLTS.pnc.\pagesLTS@pnc}}%
    \ifnum \value{pagesLTS.pnc.\pagesLTS@pnc}<2%
      \ifx\pagesLTS@pnc\pagesLTS@fns% \relax
      \else%
        \pagesLTS@writelabel{\pagesLTS@pnc}%
      \fi%
    \fi%
  \fi%
%    \end{macrocode}
%
% \noindent Before the label for the \texttt{LastPages} can be put,
% we must advance one page again, because |\pagesLTS@putlabel| itself
% goes back one page (and at its end forward again).
%
%    \begin{macrocode}
  \addtocounter{page}{+1}%
  \pagesLTS@putlabel{LastPages}{\theCurrentPage}{1}%
%    \end{macrocode}
%
% \noindent Here should follow a\\
%  |\addtocounter{page}{-1}|,\\
% but we have to remember to increase the page counters again,
% which were decreased at the start of this |\pagesLTS@putlabels|
% command, and that would include\\
%  |\addtocounter{page}{+1}|,\\
% therefore this two lines cancel each other and
% therefore just can be skipped. But the other counters have to
% be increased:
%
%    \begin{macrocode}
  \addtocounter{CurrentPage}{+1}%
  \addtocounter{pagesLTS.current.local.\pagesLTS@pnc}{1}%
  }

%    \end{macrocode}
% \end{macro}
%
% \pagebreak
%
% \begin{macro}{\AtBeginDocument}
% \indent |\AtBeginDocument| we write into the \xfile{aux} file regarding
% the double loading of the package.
% Then it is checked whether the \texttt{endfloat}
% package has been loaded, whether it is newer than March 1992 (i.\,e. at least
% April 1992 v2.0), in which case it is compatible with this
% \xpackage{pageslts} package.\\
% If it is even newer than 2011/12/24, it is the recent version
% (as of the time of last revision of this documentation:
% 2011/12/25 v2.5d).
%
%    \begin{macrocode}
\AtBeginDocument{%
  \if@filesw%
    \immediate\write\@auxout{\string\gdef\string\pagesLTS@loaded{p@gesLTSnotlo@ded}}%
  \fi%
  \@ifpackageloaded{endfloat}%
   {\@ifpackagelater{endfloat}{1992/03/31}% April 1992 v2.0
    {\@ifpackagelater{endfloat}{2011/12/24}{% 2011/12/25 v2.5d
       \relax}%
%    \end{macrocode}
%
% If it is compatible, but not the recent version, a warning is given:
%
%    \begin{macrocode}
     {\PackageWarningNoLine{pageslts}{Old endfloat package detected:\MessageBreak%
        There is a newer version of the endfloat package available.\MessageBreak%
        Please consider updating your version.\MessageBreak%
        The pageslts package might be incompatible with\MessageBreak%
        your current endfloat package.\MessageBreak%
      }%
     }%
%    \end{macrocode}
%
% If it is so very old, that it is not compatible,
% an Error message is given:
%
%    \begin{macrocode}
    }{\PackageError{pageslts}{Incompatible, very old endfloat package detected.}%
      {The very old version 2.0 (and earlier) of the\MessageBreak%
       endfloat package actually redefined the \string\enddocument ,\MessageBreak%
       and so interfered drastically with the LaTeX2e commands\MessageBreak%
       which make use of \string\AtEndDocument .\MessageBreak%
       Newer versions of the endfloat package exists\MessageBreak%
       (at least: v2.5d as of 2011/12/25)\MessageBreak%
       in modern documentation form,\MessageBreak%
       which should be available from CTAN.\MessageBreak%
       Please update your endfloat package\MessageBreak%
       for use with the pageslts package.\MessageBreak %
      }%
     }%
   }{}%
%    \end{macrocode}
%
% \pagebreak
%
% It is checked whether the old \xpackage{lastpage} package has been loaded.\\
% (If it has been loaded indeed, the |\lastpage@putlabel| is
% \textquotedblleft killed\textquotedblright ,
% see subsection~\ref{ssec:lastpage}.)
%
%    \begin{macrocode}
  \@ifpackageloaded{lastpage}%
   {\@ifpackagelater{lastpage}{2010/07/28}% 2010/07/29 v1.2a
      {\@ifpackagelater{lastpage}{2013/01/27}% 2013/01/28 v1.2l
         {\PackageWarning{pageslts}{lastpage package detected.\MessageBreak%
           With pageslts package in use, lastpage has no function.\MessageBreak%
           Just remove the lastpage package from your document.\MessageBreak%
           }%
         }{%
         \PackageWarning{pageslts}{Old lastpage package detected.\MessageBreak%
           With pageslts package in use, lastpage has no function.\MessageBreak%
           Just remove the lastpage package from your document.\MessageBreak%
           At least update it!\MessageBreak%
           }%
         }%
      }{%
       \PackageWarning{pageslts}{Incompatible package lastpage detected:\MessageBreak%
         Package pageslts was loaded, but also an old\MessageBreak%
         version of the lastpage package.\MessageBreak%
         pageslts has all functionality of the lastpage\MessageBreak%
         package (and more), so just remove the lastpage\MessageBreak%
         package from your document.\MessageBreak%
         (At least update it!)\MessageBreak%
         pageslts will now ''kill'' the lastpage@putlabel\MessageBreak%
         command of the lastpage package.\MessageBreak%
       }%
       \gdef\lastpage@putlabel{\relax}%
      }%
   }{}%
%    \end{macrocode}
%
% Further it is checked whether the \xpackage{alphalph} package has been loaded.
% If that is the case, the commands are defined accordingly.\\
%
%    \begin{macrocode}
  \ltx@ifpackageloaded{alphalph}%
    {\newalphalph{\AlphMult}[mult]{\@Alph}{26}%
     \newalphalph{\alphMult}[mult]{\@alph}{26}%
     \newalphalph{\fnsymbolmult}[mult]{\@fnsymbol}{5}%
    }{}%
%    \end{macrocode}
%
% \pagebreak
%
% Further it is checked whether the \xpackage{hyperref} package has been loaded:
%
%    \begin{macrocode}
  \ltx@ifpackageloaded{hyperref}{%
%    \end{macrocode}
%
% and whether the \xpackage{pdfpages} package is loaded:
%
%    \begin{macrocode}
     \@ifpackageloaded{pdfpages}%
       {\PackageWarningNoLine{pageslts}{Package pdfpages detected.\MessageBreak%
          Using hyperref with pdfpages can cause problems. See\MessageBreak%
          https://www.ctan.org/pkg/pax\MessageBreak%
          for the Pdf Annotations eXtractor, pax%
          }%
       }{% \relax
        }%
%    \end{macrocode}
%
% The \xpackage{undolabl} package has been updated and now uses |\undonewlabel| with only
% one argument.
%
%    \begin{macrocode}
     \@ifpackageloaded{undolabl}%
       {\@ifpackagelater{undolabl}{2010/07/14}%    2010/07/15 v1.0d
          {\@ifpackagelater{undolabl}{2015/03/29}% 2015/03/29 v1.0l
             {% recent version as of the time of last revision of this package: OK
             }{% old, but not obsolete version
               \PackageWarningNoLine{pageslts}{Old version of undolabl package used.\MessageBreak%
                 See https://www.ctan.org/pkg/undolabl\MessageBreak%
                 for a new version.\MessageBreak%
                }%
             }
          }{\PackageError{pageslts}{Incompatible, obsolete version of undolabl package used.}{%
              See https://www.ctan.org/pkg/undolabl\MessageBreak%
              for a new version.\MessageBreak%
              Type  X <return>  to quit.\MessageBreak%
             }%
          }
       }{\PackageError{pageslts}{Package undolabl missing}{%
           Package undolabl not found.\MessageBreak%
           The pageslts package needs the undolabl package.\MessageBreak%
           See https://www.ctan.org/pkg/undolabl\MessageBreak%
           Type  X <return>  to quit.\MessageBreak%
           }%
       }
%    \end{macrocode}
%
% \pagebreak
%
% Additionally a version check of the available \xpackage{hyperref}
% package is performed and if need be a warning is issued:
%
%    \begin{macrocode}
     \@ifpackagelater{hyperref}{2012/11/05}{% 2012/11/06 v6.83m
       \relax}{%
       \PackageWarningNoLine{pageslts}{Old hyperref package detected:\MessageBreak%
         There is a newer version of the\MessageBreak%
         hyperref package available:\MessageBreak%
         https://www.ctan.org/pkg/hyperref\MessageBreak%
         Please consider updating your version.\MessageBreak%
       }%
     }%
     %% pageslts supports the use of the package hyperref by
     %% Heiko Oberdiek (hyperref version 2012/11/06 v6.83m).
     %% pageslts may work with earlier versions of this packages,
     %% but this was not tested.
    }{%
%    \end{macrocode}
%
% If no \xpackage{hyperref} package in use is detected, a warning is issued, too:
%
%    \begin{macrocode}
      \PackageWarning{pageslts}{Package hyperref NOT detected.\MessageBreak%
        pageslts would support hyperref. The page references\MessageBreak%
        will NOT be hyperlinked!\MessageBreak }%
     }%
%    \end{macrocode}
%
% If the \xpackage{showkeys} package has been loaded in \texttt{draft} mode,
% warnings about missing label boxes will be issued (see p.~\pageref{pagesLTSputlabel}),
% but because it cannot be checked for \xpackage{showkeys} after |\AtBeginDocument|,
% the check must be done here and the result remembered.
%
%    \begin{macrocode}
  \ltx@ifpackageloaded{showkeys}{%
    \@ifpackagewith{showkeys}{final}{}{\gdef\pagesLTS@SK{1}}}{% else \relax
    }%
  }

%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\AtEndDocument}
% \indent |\AtEndDocument| the check is repeated. If \xpackage{showkeys} was
% loaded after the check performed before, an error message is issued.
%
%    \begin{macrocode}
\AtEndDocument{%
  \ltx@ifpackageloaded{showkeys}{%
    \ifx\pagesLTS@SK\pagesLTS@one\relax%
    \else%
      \providecommand*\pagesLTS@sklf[1]{}%
      \ifx\showkeyslabelformat\pagesLTS@sklf\relax%
      \else%
        \PackageError{pageslts}{Package showkeys loaded after pageslts}{%
          The showkeys package with option "final" has been loaded\MessageBreak%
          after the pageslts package.\MessageBreak%
          Please first load showkeys and then pageslts}%
      \fi%
    \fi%
  }{% else no showcase, \relax
  }%
%    \end{macrocode}
%
% We also give the error message about the missing (i.\,e.~not found)
% page numbering scheme, which could not be given in |\EveryShipout|.
%
%    \begin{macrocode}
  \ifx\pncmissing\pagesLTS@one\relax%
    \PackageError{pageslts}{pagenumbering scheme missing}{\pagesLTS@messageNPN }%
  \fi%
%    \end{macrocode}
%
% Then we put in a |\message| to show, in what order things (which were called)
% are done (see subsection~\ref{ssec:aed}).
%
%    \begin{macrocode}
  \message{^^J%
    AED: pageslts setting LastPage ^^J}%
%    \end{macrocode}
%
% After this we issue a |\clearpage| to put out all floats,
% which are still floating, remember the page number (if |fnsymbol|),
% and after that we place the \texttt{LastPage} label.
%
%    \begin{macrocode}
  \clearpage%
  \ifx\pagesLTS@pnc\pagesLTS@fns%
    \def\pagesLTS@tmpA{\arabic{pagesLTS.fnsymbol.local}}%
    \ifnum \pagesLTS@eso=\pagesLTS@tmpA%
      \gdef\pagesLTS@rerun{0}%
    \else%
      \gdef\pagesLTS@rerun{1}%
    \fi%
    \if@filesw%
      \immediate\write\@auxout{\string\gdef\string\pagesLTS@eso{\pagesLTS@tmpA}}%
    \fi%
  \fi%
  \pagesLTS@putlabel{LastPage}{\thepage}{1}%
%    \end{macrocode}
%
% We do not need the temporary definition any more.
%
%    \begin{macrocode}
  \let\pagesLTS@tmpA\undefined%
  }

%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\AfterLastShipout}
% \indent |\AfterLastShipout| is a command from \textsc{Heiko Oberdiek's}
% \texttt{atveryend} package (see above).
%
%    \begin{macrocode}
\AfterLastShipout{%
%    \end{macrocode}
%
% If writing to the \xfile{.aux} file is allowed:
%
%    \begin{macrocode}
  \if@filesw%
%    \end{macrocode}
%
% The number of pages with the \xpackage{fnsymbol} page numbering scheme,
% |\pagesLTS@esov|, is saved via the \xfile{.aux} file (if it is not zero):
%
%    \begin{macrocode}
    \ifx\pagesLTS@esov\pagesLTS@zero%
    \else%
      \immediate\write\@auxout{\string
        \pagesLTS@ifcounter{pagesLTS.fnsymbol.local}}%
      \immediate\write\@auxout{\string
        \setcounter{pagesLTS.fnsymbol.local}{\pagesLTS@esov}}%
    \fi%
%    \end{macrocode}
%
% If the \xpackage{hyperref} package is in use, and the page numbering scheme
% of the last page is \xpackage{fnsymbol}, everything is quite more complicated.
% Therefore |\lastpageref| is switched from simple |\lastpagereftxt|
% to the more difficult |\lastpagerefend|.
%
%    \begin{macrocode}
    \ltx@ifpackageloaded{hyperref}{%
      \ifx\pagesLTS@pnc\pagesLTS@fns%
          \immediate\write\@auxout{\string
            \gdef\string\lastpageref{\string\lastpagerefend}}%
      \fi%
     }{}%
  \fi%
%    \end{macrocode}
%
% At the call of a |\pagenumbering{...}| command, everything
% for a split page numbering scheme is organized. For the last
% page numbering scheme, there is no |\pagenumbering{...}| command
% at the end, so we need to handle this here:
%
%    \begin{macrocode}
  \pagesLTS@ifcounter{pagesLTS.\pagesLTS@pnc.\arabic{pagesLTS.pnc.\pagesLTS@pnc}.local.count}%
  \setcounter{pagesLTS.\pagesLTS@pnc.\arabic{pagesLTS.pnc.\pagesLTS@pnc}.local.count}{%
    \value{pagesLTS.current.local.\pagesLTS@pnc}}%
%    \end{macrocode}
%
% And we are one page after the last one (|\AfterLastShipout|!),
% so we go back one page. (We again borrow the \texttt{pagesLTS.pnc.0} counter for the computations
% instead of defining yet another one.)
%
%    \begin{macrocode}
  \addtocounter{pagesLTS.\pagesLTS@pnc.\arabic{pagesLTS.pnc.\pagesLTS@pnc}.local.count}{-1}
  \ifnum \value{pagesLTS.pnc.\pagesLTS@pnc}>1%
    \mathchardef\pagesLTS@tmpD=\arabic{pagesLTS.pnc.0}%
    \setcounter{pagesLTS.pnc.0}{\value{pagesLTS.pnc.\pagesLTS@pnc}}%
    \@tempcnta=\value{pagesLTS.pnc.0}\relax%
    \loop%
      \ifnum\@tempcnta>1\relax%
        \addtocounter{pagesLTS.pnc.0}{-1}%
        \addtocounter{pagesLTS.\pagesLTS@pnc.\arabic{pagesLTS.pnc.\pagesLTS@pnc}.local.count}{%
          -\value{pagesLTS.\pagesLTS@pnc.\arabic{pagesLTS.pnc.0}.local.count}}%
        \@tempcnta=\value{pagesLTS.pnc.0}\relax%
    \repeat%
    \setcounter{pagesLTS.pnc.0}{\pagesLTS@tmpD}%
  \fi%
  \if@filesw%
    \immediate\write\@auxout{\string
      \pagesLTS@ifcounter{pagesLTS.\pagesLTS@pnc.\arabic{pagesLTS.pnc.\pagesLTS@pnc}.local.cnt}}%
    \edef\pagesLTS@tmpA{\arabic{pagesLTS.\pagesLTS@pnc.\arabic{pagesLTS.pnc.\pagesLTS@pnc}.local.count}}%
    \immediate\write\@auxout{\string
      \setcounter{pagesLTS.\pagesLTS@pnc.\arabic{pagesLTS.pnc.\pagesLTS@pnc}.local.cnt}{\pagesLTS@tmpA}}%
    \let\pagesLTS@tmpA\undefined%
  \fi%
%    \end{macrocode}
%
% We need to save (via the \xfile{.aux} file) the page name |\thepage| and
% the page number |\arabic{CurrentPage}| of the last page,
% in case the last page has \xpackage{fnsymbol} page numbering scheme.
%
%    \begin{macrocode}
  \addtocounter{page}{-1}%
  \edef\pagesLTS@tmpA{\thepage}%
  \if@filesw%
    \immediate\write\@auxout{\string
      \gdef\string\pagesLTS.lastpage{\pagesLTS@tmpA}}%
  \fi%
  \addtocounter{page}{+1}%
  \addtocounter{CurrentPage}{-1}%
  \edef\pagesLTS@tmpB{\arabic{CurrentPage}}%
  \if@filesw%
    \immediate\write\@auxout{\string
      \setcounter{pagesLTS.pagenr}{\pagesLTS@tmpB}}%
  \fi%
  \addtocounter{CurrentPage}{+1}%
%    \end{macrocode}
%
% The \texttt{VeryLastPage} label is set here, and when
% |\lastpageref{VeryLastPage}| instead of |\lastpageref{LastPage}| is used,
% it should really point to the last page.
% |LastPage| and |VeryLastPage| should be identical,
% unless a package was active with output |\AtEndDocument|
% \textit{after} the \xpackage{pageslts} package.
%
%    \begin{macrocode}
  \message{^^J%
    AED: pageslts setting VeryLastPage via AfterLastShipout ^^J}%
  \pagesLTS@putlabel{VeryLastPage}{\thepage}{1}%
%    \end{macrocode}
%
% The \texttt{LastPages} label is set here, and
% |\lastpageref{LastPages}| gives the total number of pages
% and points to the (very) last page.
%
%    \begin{macrocode}
  \message{^^J%
    AED: pageslts setting LastPages via AfterLastShipout ^^J}%
  \pagesLTS@putlabels%
  \typeout{^^J}%
  \ifodd\pagesLTS@tmpB%
    \@PackageInfoNoLine{pageslts}{Total number of pages is odd}%
  \else%
    \@PackageInfoNoLine{pageslts}{Total number of pages is even}%
  \fi%
  \typeout{^^J}%
%    \end{macrocode}
%
% We do not need the temporary definitions any more.
%
%    \begin{macrocode}
  \let\pagesLTS@tmpA\undefined%
  \let\pagesLTS@tmpB\undefined%
  }

%    \end{macrocode}
% \end{macro}
%
% \pagebreak
%
% \begin{macro}{\AtEndAfterFileList}
% \indent |\AtEndAfterFileList{...}| is even later:
% \begin{quote}
% \textquotedblleft After the .aux file closing and reading \LaTeX{} prints the
% file list if requested by |\listfiles|. Then this hook is executed.\textquotedblright
% \end{quote}
% (\xpackage{atveryend} package of \textsc{Heiko Oberdiek}, v1.7 as of 2011/04/23,
% newer version available.) Here it is used for a rerun hint.\\
% For example if the page numbering scheme of the last page of the
% \textsf{pageslts-example.tex} file is changed to |fnsymbol| and two runs
% of \pdfLaTeX{} are done, \pdfLaTeX{} will be happy and will not complain
% about changed labels. But indeed, a \textit{third} run is necessary
% and indicated by the warning message below.
%
%    \begin{macrocode}
\AtEndAfterFileList{%
  \ifx\pagesLTS@rerun\pagesLTS@one%
    \PackageWarningNoLine{pageslts}{%
      Label(s) may have changed.\MessageBreak%
      Rerun to get cross-references right%
     }%
  \fi%
  }

%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\frontmatter}
% \indent |\frontmatter| often contains |\pagenumbering|, but for some unknown reason
% there are problems when another |\pagenumbering| with different page numbering scheme
% has been used before on the same page. (This would not make any sense anyway,
% because one page can only have one page numbering scheme.) This problem does not
% occur when two |\pagenumbering| commands are used inside normal text.
% Thus we need to check whether |\frontmatter| has been defined,
% whether it changes the page numbering scheme, and whether the page numbering scheme
% before |\frontmatter| was initiated at the same page.
% \end{macro}
%
% We need an |\ifundefined|, which neither requires \eTeX{} nor
% defines the command, which is to be tested, to |\relax| (in which case
% it would be no longer undefined for further tests). For this we use
% code from \textsc{Markus Kohm} similar to his |\scr@ifundefinedorrelax| from %
% \xpackage{scrbase.sty} of the KOMA script bundle,
% but without the necessarity to use \eTeX :
%
%    \begin{macrocode}
\newcommand{\pagesLTS@ifundefinedorrelax}[1]{%
  % Modified Markus Kohm code for use without e-TeX
  \begingroup\expandafter\expandafter\expandafter\endgroup
  \expandafter\ifx\csname #1\endcsname\relax%
    \expandafter\ifx\csname #1\endcsname\relax%
      \expandafter\expandafter\expandafter\@firstoftwo
    \else%
      \expandafter\expandafter\expandafter\@secondoftwo
    \fi%
  \else%
    \expandafter\@firstoftwo
  \fi%
  }

\pagesLTS@ifundefinedorrelax{frontmatter}{% \relax
}{% else
  \ltx@GlobalPrependToMacro{\frontmatter}{\pagesLTS@prefrontmatter}%
  \ltx@GlobalAppendToMacro{\frontmatter}{\pagesLTS@postfrontmatter}%
 }

%    \end{macrocode}
%
% \begin{macro}{\pagesLTS@prefrontmatter}
%
% At the beginning of the real (i.e. unchanged) |\frontmatter| (FMB), we remember the
% current (c) page numbering (pn) scheme: its name (n) and page number (p).
% |\pagesLTS@FMBpncp| would be |1| if the according |\pagenumbering| command
% was used on the same page at the |\frontmatter|.
%
%    \begin{macrocode}
\newcommand{\pagesLTS@prefrontmatter}{%
  \xdef\pagesLTS@FMBpncn{\pagesLTS@pnc}%
  \xdef\pagesLTS@FMBpncp{\arabic{pagesLTS.current.local.\pagesLTS@pnc}}%
  }

%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\pagesLTS@postfrontmatter}
%
% The named checks are performed and in case of the named problem an error message
% is given. Any idea how to automatically solve this issue?
%
%    \begin{macrocode}
\newcommand{\pagesLTS@postfrontmatter}{%
  \xdef\pagesLTS@FMEpncn{\pagesLTS@pnc}%
  \ifx\pagesLTS@FMBpncn\pagesLTS@FMEpncn%
  \else%
    \ifx\pagesLTS@FMBpncn\pagesLTS@zero%
    \else%
      \ifx\pagesLTS@FMBpncp\pagesLTS@one%
        \PackageError{pageslts}{\string\pagenumbering\space before \string\frontmatter}{%
          Do not use \string\pagenumbering{\pagesLTS@FMBpncn} before \string\frontmatter \MessageBreak%
          on the same page!\MessageBreak%
          \string\frontmatter\space (re)defines the page numbering scheme to \pagesLTS@FMEpncn , \MessageBreak%
          thus earlier use of \string\pagenumbering{\pagesLTS@FMBpncn} on the same page is useless anyway.}%
      \fi%
    \fi%
  \fi%
}

%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
%</package>
%    \end{macrocode}
%
% \newpage
%
% \section{Installation}
%
% \subsection{Downloads\label{ss:Downloads}}
%
% Everything is available at \url{https://www.ctan.org},
% but may need additional packages themselves.\\
%
% \DescribeMacro{pageslts.dtx}
% For unpacking the |thumbs.dtx| file and constructing the documentation it is required:
% \begin{description}
% \item[-] \TeX Format \LaTeXe{}: \url{https://www.CTAN.org}
%
% \item[-] document class \xclass{ltxdoc}, 2015-03-26, 2.0w, \url{https://www.ctan.org/pkg/ltxdoc}
%
% \item[-] package \xpackage{holtxdoc}, 2012/03/21, v0.24, \url{https://www.ctan.org/pkg/holtxdoc}
%
% \item[-] package \xpackage{hypdoc}, 2011/08/19, v1.11, \url{https://www.ctan.org/pkg/hypdoc}
%
% \item[-] package \xpackage{geometry}, 2010/09/12, v5.6, \url{https://www.ctan.org/pkg/geometry}
%
% \item[-] package \xpackage{ulem}, 2012/05/18, no version number given, \url{https://www.ctan.org/pkg/ulem}
% \end{description}
%
% \DescribeMacro{pageslts.sty}
% The |pageslts.sty| for \LaTeXe{} (i.\,e. all documents using
% the \xpackage{pageslts} package) requires:
% \begin{description}
% \item[-] \TeX{} Format \LaTeXe{}, \url{https://www.CTAN.org}
%
% \item[-] package \xpackage{atveryend}, 2011/06/30, v1.8, \url{https://www.ctan.org/pkg/atveryend}
%
% \item[-] package \xpackage{everyshi}, 2001/05/15, v3.00, \url{https://www.ctan.org/pkg/everyshi}
%
% \item[-] package \xpackage{kvoptions}, 2011/06/30, v3.11, \url{https://www.ctan.org/pkg/kvoptions}
%
% \item[-] package \xpackage{letltxmacro}, 2010/09/02, v1.4, \url{https://www.ctan.org/pkg/letltxmacro}
%
% \item[-] package \xpackage{ltxcmds}, 2011/11/09, v1.22, \url{https://www.ctan.org/pkg/ltxcmds}
%
% \item[-] package \xpackage{rerunfilecheck}, 2011/04/15, v1.7, \url{https://www.ctan.org/pkg/rerunfilecheck}
%
% \item[-] package \xpackage{undolabl}, 2015/03/29, v1.0l, \url{https://www.ctan.org/pkg/undolabl}\\
% \end{description}
%
% \DescribeMacro{pageslts-example.tex}
% The |pageslts-example.tex| requires the same files as all
% documents using the \xpackage{pageslts} package, and additionally:
% \begin{description}
% \item[-] class \textsf{article}, 2014/09/29, v1.4h, from \textsf{classes.dtx}: \url{https://www.ctan.org/pkg/classes}
%
% \item[-] package \xpackage{alphalph}, 2011/05/13, v2.4, \url{https://www.ctan.org/pkg/alphalph}
%
% \item[-] package \xpackage{lipsum}, 2014/07/27, v1.3, \url{https://www.ctan.org/pkg/lipsum}
%
% \item[-] package \xpackage{showkeys}, 2014/10/28, v3.17, \url{https://www.ctan.org/pkg/showkeys}
%
% \item[-] package \xpackage{hyperref}, 2012/11/06, v6.83m, \url{https://www.ctan.org/pkg/hyperref}
%
% \item[-] package \xpackage{pageslts}, 2015/12/21, v1.2f, \url{https://www.ctan.org/pkg/pageslts}\\
%   (Well, it is the example file for this package, and because you are reading the
%    documentation for the \xpackage{pageslts} package, it can be assumed that you already
%    have some version of it~-- is it the current one?)
% \end{description}
%
% \pagebreak
%
% \DescribeMacro{papermas}
% The \xpackage{papermas} package is not required, but requires itself the
% the \xpackage{pageslts} package and can be considered as kind of add-on:
% \begin{description}
% \item[-] package \xpackage{papermas}, 2011/08/22, v1.0h, \url{https://www.ctan.org/pkg/papermas}
% \end{description}
%
% \DescribeMacro{endfloat}
% The \xpackage{endfloat} package is not required, but because
% the \xpackage{pageslts} package is incompatibel with very old versions
% of the \xpackage{endfloat} package (see subsection~\ref{sec:endfloat}),
% here the recent one is listed:
% \begin{description}
% \item[-] package \xpackage{endfloat}, 2011/12/25, v2.5d, \url{https://www.ctan.org/pkg/endfloat}
% \end{description}
%
% \DescribeMacro{prelim2e}
% The \xpackage{prelim2e} package is not required either, but because
% |Prelim@EveryShipout| code was taken from that package, it is listed, too:
% \begin{description}
% \item[-] package \xpackage{prelim2e}, 2009/05/29, v1.3, \url{https://www.ctan.org/pkg/prelim2e}
% \end{description}
%
% \DescribeMacro{fancyhdr}
% \DescribeMacro{nccfancyhdr}
% Neither \xpackage{fancyhdr} nor \xpackage{nccfancyhdr} package is required
% (the \xpackage{lastpage} package used its predecessor \xpackage{fancyheadings}),
% but because they were mentioned, also they are listed here:
% \begin{description}
% \item[-] package \xpackage{fancyhdr}, \url{https://www.ctan.org/pkg/fancyhdr}
%
% \item[-] package \xpackage{nccfancyhdr}, \url{https://www.ctan.org/pkg/nccfancyhdr}
% \end{description}
%
% \DescribeMacro{lastpage}
% \DescribeMacro{totpages}
% \DescribeMacro{totcount}
% \DescribeMacro{nofm}
% \DescribeMacro{count1to}
% \DescribeMacro{zref}
% As possible alternatives in section \ref{sec:Alternatives} there are listed
% \begin{description}
% \item[-] package \xpackage{lastpage}, 2015/03/29, v1.2m, \url{https://www.ctan.org/pkg/lastpage}
%
% \item[-] package \xpackage{totpages}, 2005/09/19, v2.00, \url{https://www.ctan.org/pkg/totpages}
%
% \item[-] package \xpackage{totcount}, 2011/01/25, v1.2, \url{https://www.ctan.org/pkg/totcount}
%
% \item[-] package \xpackage{nofm}, 1991/02/25, without version number,
%  \url{http://mirror.ctan.org/obsolete/macros/latex209/contrib/misc/nofm.sty},
%  does not work with e.\,g. \xpackage{hyperref}
%
% \item[-] package \xpackage{count1to}, 2009/05/24, v2.1, \url{https://www.ctan.org/pkg/count1to}
%
% \item[-] package \xpackage{zref}, 2012/04/04, v2.24, \url{https://www.ctan.org/pkg/zref}
% \end{description}
%
% \DescribeMacro{Oberdiek}
% \DescribeMacro{alphalph}
% \DescribeMacro{atveryend}
% \DescribeMacro{holtxdoc}
% \DescribeMacro{letltxmacro}
% \DescribeMacro{ltxcmds}
% \DescribeMacro{kvoptions}
% \DescribeMacro{rerunfilecheck}
% \DescribeMacro{zref}
% All packages of \textsc{Heiko Oberdiek's} bundle `oberdiek'
% (especially \xpackage{alphalph}, \xpackage{atveryend}, \xpackage{holtxdoc}, \xpackage{letltxmacro},
% \xpackage{ltxcmds}, \xpackage{kvoptions}, \xpackage{rerunfilecheck}, and \xpackage{zref})
% are also available in a TDS compliant ZIP archive:\\
% \url{http://mirrors.ctan.org/install/macros/latex/contrib/oberdiek.tds.zip}.\\
% It is probably best to download and use this, because the packages in there
% are quite probably both recent and compatible among themselves.
%
% \DescribeMacro{hyperref}
% \noindent \xpackage{hyperref} is not included in that bundle and needs to be
% downloaded separately,\\
% \url{http://mirrors.ctan.org/install/macros/latex/contrib/hyperref.tds.zip}.
%
% \DescribeMacro{M\"{u}nch}
% A hyperlinked list of my (other) packages can be found at
% \url{https://www.ctan.org/author/muench-hm}.
%
% \subsection{Package, unpacking TDS}
% \paragraph{Package.} This package is available on \url{CTAN.org}.
% \begin{description}
% \item[\url{http://mirrors.ctan.org/macros/latex/contrib/pageslts/pageslts.dtx}]\hspace*{0.1cm} \\
%       The source file.
% \item[\url{http://mirrors.ctan.org/macros/latex/contrib/pageslts/pageslts.pdf}]\hspace*{0.1cm} \\
%       The documentation.
% \item[\url{http://mirrors.ctan.org/macros/latex/contrib/pageslts/pageslts-example.pdf}]\hspace*{0.1cm} \\
%       The compiled example file, as it should look like.
% \item[\url{http://mirrors.ctan.org/macros/latex/contrib/pageslts/README}]\hspace*{0.1cm} \\
%       The README file.
% \end{description}
% There is also a |thumbs.tds.zip| available:
% \begin{description}
% \item[\url{http://mirror.ctan.org/install/macros/latex/contrib/pageslts.tds.zip}]\hspace*{0.1cm} \\
%       Everything in TDS compliant, compiled format.
% \end{description}
% which additionally contains\\
% \begin{tabular}{ll}
% pageslts.ins & The installation file.\\
% pageslts.drv & The driver to generate the documentation.\\
% pageslts.sty & The \xext{sty}le file.\\
% pageslts-example.tex & The example file.%
% \end{tabular}
%
% \bigskip
%
% \noindent For required other packages see the preceding subsection.
%
% \paragraph{Unpacking.} The \xfile{.dtx} file is a self-extracting
% \docstrip{} archive. The files are extracted by running the
% \xfile{.dtx} through \plainTeX :
% \begin{quote}
%   \verb|tex pageslts.dtx|
% \end{quote}
%
% About generating the documentation see paragraph~\ref{GenDoc} below.\\
%
% \paragraph{TDS.} Now the different files must be moved into
% the different directories in your installation TDS tree
% (also known as \xfile{texmf} tree):
% \begin{quote}
% \def\t{^^A
% \begin{tabular}{@{}>{\ttfamily}l@{ $\rightarrow$ }>{\ttfamily}l@{}}
%   pageslts.sty & tex/latex/pageslts.sty\\
%   pageslts.pdf & doc/latex/pageslts.pdf\\
%   pageslts-example.tex & doc/latex/pageslts-example.tex\\
%   pageslts-example.pdf & doc/latex/pageslts-example.pdf\\
%   pageslts.dtx & source/latex/pageslts.dtx\\
% \end{tabular}^^A
% }^^A
% \sbox0{\t}^^A
% \ifdim\wd0>\linewidth
%   \begingroup
%     \advance\linewidth by\leftmargin
%     \advance\linewidth by\rightmargin
%   \edef\x{\endgroup
%     \def\noexpand\lw{\the\linewidth}^^A
%   }\x
%   \def\lwbox{^^A
%     \leavevmode
%     \hbox to \linewidth{^^A
%       \kern-\leftmargin\relax
%       \hss
%       \usebox0
%       \hss
%       \kern-\rightmargin\relax
%     }^^A
%   }^^A
%   \ifdim\wd0>\lw
%     \sbox0{\small\t}^^A
%     \ifdim\wd0>\linewidth
%       \ifdim\wd0>\lw
%         \sbox0{\footnotesize\t}^^A
%         \ifdim\wd0>\linewidth
%           \ifdim\wd0>\lw
%             \sbox0{\scriptsize\t}^^A
%             \ifdim\wd0>\linewidth
%               \ifdim\wd0>\lw
%                 \sbox0{\tiny\t}^^A
%                 \ifdim\wd0>\linewidth
%                   \lwbox
%                 \else
%                   \usebox0
%                 \fi
%               \else
%                 \lwbox
%               \fi
%             \else
%               \usebox0
%             \fi
%           \else
%             \lwbox
%           \fi
%         \else
%           \usebox0
%         \fi
%       \else
%         \lwbox
%       \fi
%     \else
%       \usebox0
%     \fi
%   \else
%     \lwbox
%   \fi
% \else
%   \usebox0
% \fi
% \end{quote}
% If you have a \xfile{docstrip.cfg} that configures and enables \docstrip's
% TDS installing feature, then some files can already be in the right
% place, see the documentation of \docstrip.
%
% \subsection{Refresh file name databases}
%
% If your \TeX~distribution (\teTeX, \mikTeX,\dots) relies on file name
% databases, you must refresh these. For example, \teTeX\ users run
% \verb|texhash| or \verb|mktexlsr|.
%
% \subsection{Some details for the interested}
%
% \paragraph{Unpacking with \LaTeX.}
% The \xfile{.dtx} chooses its action depending on the format:
% \begin{description}
% \item[\plainTeX:] Run \docstrip\ and extract the files.
% \item[\LaTeX:] Generate the documentation.
% \end{description}
% If you insist on using \LaTeX\ for \docstrip\ (really,
% \docstrip\ does not need \LaTeX), then inform the autodetect routine
% about your intention:
% \begin{quote}
%   \verb|latex \let\install=y\input{pageslts.dtx}|
% \end{quote}
% Do not forget to quote the argument according to the demands
% of your shell.
%
% \paragraph{Generating the documentation.\label{GenDoc}}
% You can use both the \xfile{.dtx} or the \xfile{.drv} to generate
% the documentation. The process can be configured by the
% configuration file \xfile{ltxdoc.cfg}. For instance, put the following
% line into this file, if you want to have A4 as paper format:
% \begin{quote}
%   \verb|\PassOptionsToClass{a4paper}{article}|
% \end{quote}
%
% \noindent An example follows how to generate the
% documentation with \pdfLaTeX :
%
% \begin{quote}
%\begin{verbatim}
%pdflatex pageslts.dtx
%makeindex -s gind.ist pageslts.idx
%pdflatex pageslts.dtx
%makeindex -s gind.ist pageslts.idx
%pdflatex pageslts.dtx
%\end{verbatim}
% \end{quote}
%
% \subsection{Compiling the example}
%
% The example file, \textsf{pageslts-example.tex}, can be compiled via\\
% \indent |latex pageslts-example.tex|\\
% or (recommended)\\
% \indent |pdflatex pageslts-example.tex|\\
% and will need \textit{at least} (!) three compiler runs to get
% all references right.
%
% \pagebreak
%
% \section{Acknowledgements}
%
% I (H.-Martin M\"{u}nch) would like to thank \textsc{Jeffrey P. Goldberg}
% for inventing the \xpackage{lastpage} package. This package first started
% as a revision of the \xpackage{lastpage} package, but it became obvious
% that a replacement was needed to accomplish what this package does.
% Further I would like to thank \textsc{Heiko Oberdiek} for providing the
% |\erroralphalph| command as well as a~lot~(!) of useful packages
% (from which I also got everything I know about creating a file in
% \xfile{dtx} format, ok, say it: copying), \textsc{Martin Schr\"{o}der}
% for his \xpackage{prelim2e} package, from which I got the
% |Prelim@EveryShipout| code, \textsc{Ulrich Diez} for his code for the
% \xpackage{undolabl} package, which allows overwriting of labels,
% \textsc{Andres L\"{o}h} for the code to determine the current page
% numbering scheme, and the \Newsgroup{comp.text.tex} and
% \Newsgroup{de.comp.text.tex} newsgroups for their help in all things \TeX{}.
% For bug reports I thank Micha\l{} Herman, kwikwi, Joshua Ellis,
% and Dr. Clea F. Rees. For telling me how to fix a bug
% (and for all his shared whisdom at \url{https://tex.stackexchange.com})
% thanks go to Prof. Enrico Gregorio.
%
% \phantomsection
% \begin{History}\label{History}
%
%   Some old versions have been archived at
%   \url{http://ctanhg.scharrer-online.de/pkg/pageslts.html}.
%
%   \begin{Version}{1994/06/17, \xpackage{lastpage}}
%     \item \xpackage{lastpage} v0.99a: First shot by \textsc{Jeffrey P. Goldberg}.
%   \end{Version}
%   \begin{Version}{1994/06/25, \xpackage{lastpage}}
%     \item \xpackage{lastpage} v0.1b: Last version number created by \textsc{Jeffrey P. Goldberg}.
%   \end{Version}
%   \begin{Version}{1994/07/20, \xpackage{lastpage}}
%     \item \xpackage{lastpage} v0.1b (again): Documentation updated by \textsc{Jeffrey P. Goldberg}.\\
%       The main source code of the \xpackage{lastpage} package 1994/07/20 v0.1b was:\\
%       \begin{verbatim}
%        \NeedsTeXFormat{LaTeX2e}[1994/06/01]
%        \ProvidesPackage{lastpage}[1994/07/20 v0.1b
%          LaTeX2e package for refs to last page number (JPG)]
%        \def\lastpage@putlabel{\addtocounter{page}{-1}%
%          \immediate\write\@auxout{\string
%          \newlabel{LastPage}{{}{\thepage}}}%
%          \addtocounter{page}{1}}
%        \AtEndDocument{%
%          \message{AED: lastpage setting LastPage}%
%          \clearpage\lastpage@putlabel}%
%        \endinput
%       \end{verbatim}
%       and then \xpackage{hyperref} and \xpackage{revtex} even redefine |\lastpage@putlabel|.
%   \end{Version}
%   \begin{Version}{2010/02/18, \xpackage{lastpage}}
%     \item \xpackage{lastpage} v1.1: Proposed |LastPages| label by H.-Martin M\"{u}nch
%       on \Newsgroup{comp.text.tex}, see e.\,g.
%       \url{http://groups.google.com/group/comp.text.tex/msg/4407493da9c747f0?dmode=source};
%       now available in this \xpackage{pageslts} package.
%   \end{Version}
%   \begin{Version}{2010/05/15 v1.0 \xpackage{pagesLTS}}
%     \item \xpackage{pagesLTS} Complete rewriting of the package, so as to work with
%       \textbf{more than one page numbering scheme}; using |\AtVeryEnd|
%       for \texttt{VeryLastPage}; upgrade from \xpackage{fancyheadings} to
%       \xpackage{fancyhdr} package, then removed the need for a \xpackage{fancyhdr}
%       package at all.
%     \item Rewriting of the package, so as to work with the \xpackage{fnsymbol}
%       page numbering scheme (even on the last page).
%     \item Introduction of \xpackage{kvoptions} into this package.
%     \item Check for incompatible \xpackage{endfloat} package.
%     \item \xpackage{lastpage209.sty} for \LaTeX209 .
%     \item Replacement of |\filedate|, |-version|, |-name|,\ldots{} because
%       of \LaTeX~bug 2705:\\
%       Synopsis: Possible problem with |\fileversion| and |\filedate|\\
%       \url{http://www.latex-project.org/cgi-bin/ltxbugs2html?category=LaTeX&responsible=anyone&state=anything&keyword=lastpage&pr=latex%2F2705&search=}
%     \item \xpackage{alphalph} support included.
%     \item Page numbering extension |\erroralph| by \textsc{Heiko Oberdiek} included.
%     \item (Page-) Numbering extension for |roman| and |Roman| numbers included.
%     \item Incompatible, old \xpackage{lastpage} package \textquotedblleft killed\textquotedblright .
%     \item Example |pagesLTS-example.tex| added.
%     \item Alternatives listing (section \ref{sec:Alternatives}).
%     \item Listing of \TeX{} sources (subsection \ref{ss:Downloads}).
%     \item Complete rewriting of the documentation.
%     \item Everything in DTX framework.
%     \item New package name: \xpackage{pagesLTS} for Last, Total,
%            and page numbering Schemes pages.
%   \end{Version}
%   \begin{Version}{2010/06/01 v1.1(a) \xpackage{pagesLTS}}
%     \item Abstract changed: Negative \texttt{roman} and \texttt{Roman} page
%            numbers are now possible.
%     \item Some references to other packages have been updated.
%     \item Several typing mistakes have been corrected~-
%            both in the \xfile{sty}le file as well as in this documentation.
%   \end{Version}
%   \begin{Version}{2010/06/03 v1.1b \xpackage{pagesLTS}}
%     \item Corrected a bug in |\XXRoman|, where |\roman| instead of |\Roman| had been used.
%     \item New \xpackage{papermas} package mentioned.
%     \item Several changes in the documentation and the Readme file.
%   \end{Version}
%   \begin{Version}{2010/06/24 v1.1c \xpackage{pagesLTS}}
%     \item \xpackage{holtxdoc} warning in \xfile{drv} updated.
%     \item Removed CRLF line endings from the \xfile{dtx} file.
%     \item Corrected the location of the package at CTAN.
%           (In this version \xfile{TDS} was still missing due to packaging error.)
%     \item Corrected Message format in pagesLTS.\xfile{ins}.
%     \item Updates to the documentation.
%   \end{Version}
%   \begin{Version}{2010/07/15 v1.1d \xpackage{pagesLTS}}
%     \item Added the |\@ifclassloaded{revtex4}| code for |\lastpage@putlabel| (changed to
%            |\pagesLTS@putlabelhyper|) from the \xpackage{hyperref} package \textbf{as comment}~-
%            what is the meaning of that code?
%     \item In the documentation added the explanation of the occurence of multiply definitions
%            of the |LastPage| label with \xpackage{lastpage}, \xpackage{pagesLTS}, \xpackage{hyperref}
%            package (in that order).
%     \item Updated to (then) new version of \xpackage{undolabl} package [2010/07/15] v1.0d,
%            which uses |\undonewlabel| with only one instead of two arguments.
%     \item Added a warning message, if \xpackage{hyperref} \textit{and} \xpackage{pdfpages} are \textit{both} used.
%            (Should not \xpackage{hyperref} give this warning?)
%     \item Updates to the documentation.
%   \end{Version}
%   \begin{Version}{2010/07/29 v1.1e \xpackage{pagesLTS}}
%     \item Removed \xpackage{lastpage209.sty}, because it is now contained
%             in the \xpackage{lastpage}\xfile{.dtx}\ file, v\,$\geq 1.2$a.
%     \item Removed the |\@ifclassloaded{revtex4}| code for |\lastpage@putlabel|.
%     \item Handling of \xpackage{lastpage} package adapted to updated version~1.2(a).
%     \item Corrected error in \xpackage{lastpage} code [1994/07/20 v0.1b] given in \ref{History}~History.
%     \item Version handling for \xpackage{undolabl} package updated.
%     \item Included a |\CheckSum|.
%     \item Some minor details.
%   \end{Version}
%   \begin{Version}{2010/08/08 v1.1f \xpackage{pagesLTS}}
%     \item Version 1.1e had a bug: AlphAlph was replaced by alphalph (because that package is named like this),
%             but this was done also in commands and definitions~- now reverted.
%     \item Updates to the documentation.
%   \end{Version}
%   \begin{Version}{2010/08/12 v1.1g \xpackage{pagesLTS}}
%     \item Now the rerun warning is given \textit{after} e.\,g. the |\listfiles|,
%             increasing the chance of the user to read it (trick found in
%             \textsc{Harald Harders'} \xpackage{fnbreak} package, thanks!).
%   \end{Version}
%   \begin{Version}{2010/08/23 v1.1h \xpackage{pagesLTS}}
%     \item Renamed |\XXRoman| to |\XRoman|.
%     \item Reduced the number of needed counters.
%     \item Removed wrong \% from the driver file.
%     \item Changed the |\unit| definition (got rid of an old |\rm|).
%     \item Without use of the \xpackage{hyperref} package, labels of type
%             \texttt{pagesLTS.}\meta{page numbering scheme}\texttt{.local}
%             became multiply defined. Now an |\undolabl| was inserted.
%     \item Diverse details.
%   \end{Version}
%   \begin{Version}{2010/08/25 v1.1i \xpackage{pagesLTS}}
%     \item Bug fix: \textsf{tcilatex} defines the |\hyperref| command, therefore
%             for \xpackage{hyperref} package detection this had to be changed to
%             |\Hy@Warning|.
%   \end{Version}
%   \begin{Version}{2010/09/12 v1.1j \xpackage{pagesLTS}}
%     \item Bug fix: \LaTeX{} issued a \textquotedblleft \texttt{Label(s) may have changed.%
%             Rerun to get cross-references right.}\textquotedblright -warning,
%             even if labels had not changed but were overwritten.
%     \item Starred version of |\lastpageref| for suppressing hyperlinks introduced.
%     \item A lot of details.
%   \end{Version}
%   \begin{Version}{2010/09/22 v1.1k \xpackage{pagesLTS}}
%     \item When no \texttt{fnsymbol} pagenumbering scheme is used, the respective
%             counters are not defined, saving three counters.
%     \item Moved the package from \texttt{.../latex/muench/pagesLTS/...} to
%             \texttt{.../latex/pagesLTS/...}.\\
%             (Please make sure that the old version of the \xpackage{pagesLTS} package
%              was properly uninstalled from your system.)
%   \end{Version}
%   \begin{Version}{2010/09/27 v1.1l \xpackage{pagesLTS}}
%     \item Bug fix: |\PackageError{pagesLTS}{pagenumbering missing}{\pagesLTS@messageNPN }|
%             had to be moved to the outside of |\EveryShipout|, because it wrote its
%             message into the document instead to the screen and the \xfile{.log}-file.
%     \item Updated to version 2010/04/24 v0.19 of the \xpackage{holtxdoc} package.
%   \end{Version}
%   \begin{Version}{2011/02/01 v1.1m \xpackage{pagesLTS}}
%     \item Added a new warning subsection about \xpackage{hyperref} and repeated page
%             numbers.
%     \item Bug fix: Missing \% after |-\romannumeral\number-\arabic{#1}| added.
%     \item The (then) new version v2.4i of the \xpackage{endfloat} package was then
%             even older than 15~years.
%     \item Put a warning in the documentation as well as in the \xfile{log}-file and
%             at the screen during compilation about the \xpackage{showkeys} package.
%             (The labels of the \xpackage{pagesLTS} package cannot be shown by the
%             \xpackage{showkeys} package.)
%     \item Bug fix: In some situations a rerun warning was given even if no rerun
%             was necessary.
%     \item The recent version of the Adobe Reader \sout{\ is}\uwave{\ was} X (10.0.0)
%             (instead of 9.3.3). Its handling of special page numbers was improved.
%     \item The option \texttt{alphMult}\ \ is now set to \texttt{ab} by default.
%     \item The option \texttt{AlphMulti}\ is now set to \texttt{AB} by default.
%     \item Some details.
%   \end{Version}
%   \begin{Version}{2011/03/16 v1.1n \xpackage{pagesLTS}}
%     \item Bug fix: Handling of option |pagecontinue=false| changed.
%             When |pagecontinue=false| was used, but also a
%             |alphMult|, |AlphMulti|, |fnsymbolmult|, |romanMult| or |RomanMulti| option
%             other than |0| or |false|, respectively, was used, the page numbering
%             \textit{was} continued/extended. Now a warning is issued in case of such
%             option clash and |pagecontinue=false| is heeded, disabling all continuation.
%     \item Bug fix: |\ProvidesPackage{pagesLTS}| contained an older date (2010/09/27 of v1.1l
%             instead of 2011/02/01 of v1.1m).
%     \item Bug fix: The \xpackage{ulem} package is needed to generate the documentation from the
%             \xfile{pagesLTS.dtx} file, but was not listed as necessary package.
%     \item Bug fix: One reference to an outdated version of \xpackage{undolabl} package,
%             replaced by the (then) recent version.
%     \item Some minor details.
%   \end{Version}
%   \begin{Version}{2011/03/17 v1.1o \xpackage{pagesLTS}}
%     \item Documentation and ReadMe bug fix: This \xpackage{pagesLTS} package is located at
%             \url{https://www.ctan.org/pkg/pageslts} instead of \ldots /pagesLTS/.
%     \item There is a new (possible) alternative package, \xpackage{totcount},
%             see section~\ref{sec:Alternatives}.
%     \item Bug fix: There was a reference to \xpackage{lastpage} 1994/07/20, v0.1b,
%             instead of the current version.
%   \end{Version}
%   \begin{Version}{2011/08/08 v1.2a}
%     \item \textbf{Renamed the package from \xpackage{pagesLTS} to \xpackage{pageslts}
%             (keeping family, prefix, internal commands,\ldots{} as |pagesLTS|).}
%             Added checking against double loading as \xpackage{pagesLTS} and \xpackage{pageslts}.
%     \item The \xpackage{holtxdoc} package was fixed (recent: 2011/02/04, v0.21), therefore
%             the warning in \xfile{drv} could be removed.
%     \item |\AtEndAfterFileList| from the \uwave{then} new version of the \xpackage{atveryend} package,
%             2011/04/23, v1.7, by \textsc{Heiko Oberdiek}, is now used for the rerun hint
%             instead of appending to |\@dofilelist|.
%     \item Now defining $2$: |\def\pagesLTS@two{2}| (for example for the
%             \xpackage{thumbs} package) and $3$: |\def\pagesLTS@three{3}|.
%     \item Replaced |\texttt{\textbackslash|\ldots|}| by
%             \textbar \textbackslash \ldots \textbar{} in the \xfile{dtx} and by
%             |\verb|\textbar \textbackslash \ldots \textbar{} in the example (where possible).
%     \item When the \xpackage{alphalph} package is needed, it is loaded via |\RequirePackage|
%             instead of crashing with an error message.
%     \item A lot of details (also in the documentation).
%   \end{Version}
%   \begin{Version}{2013/01/28 v1.2b}
%     \item Updated to \TeX{} live 2012 (for compiling the documentation and example)
%             and installed the available updates. Therefore I can no longer test
%             whether \xpackage{pageslts} works with earlier versions of \LaTeX{}.
%     \item Replaced |\let| by |\LetLtxMacro|.
%     \item The \xpackage{nameref} package redefines |\label| to have five arguments
%             instead of two, therefore |\newlabel{LastPage}{{}{\thepage}{}{}{}}| instead of
%             |\newlabel{LastPage}{{}{\thepage}}| must be used.
%             (Bug reported at \url{http://tex.stackexchange.com/q/95541/6865},
%             thanks to Micha\l{} Herman!) Fixed.
%     \item Updates to a lot of details, also in the documentation.
%   \end{Version}
%   \begin{Version}{2014/01/19 v1.2c}
%     \item Bug: missing loop, fix: inserted.
%     \item Bug: when option |pagecontinue=false| was set, the extension of the
%             page numbering schemes was disabled by mistake, fixed.
%     \item Now using |\ltx@ifpackageloaded| from the \xpackage{ltxcmds} package
%             for checking (even \emph{after} |\AtBeginDocument|)
%             whether a package has been loaded.
%     \item Bug: incompatibility with \xpackage{lineno} because of a mistake
%             in the redefined |\pagenumbering|, fixed. (Bug reported by kwikwi, thanks!)
%     \item Bug: When |\pagenumbering| preceded |\frontmatter| on the same page
%             but with different argument than the |\pagenumbering|, which was inside
%             |\frontmatter|, then some labelling got mixed up.
%             (Also this bug reported by kwikwi, thanks!) While this is not fixed automatically,
%             now an appropriate error message is given. (Two different page numbering schemes
%             on the same page make no sense anyway.)
%     \item Updates of minor details.
%   \end{Version}
%   \begin{Version}{2015/08/02 v1.2d}
%     \item Updated to \TeX{} Live 2015 (for compiling the documentation and example)
%             and installed the available updates. Therefore I can no longer test
%             whether \xpackage{thumbs} works with earlier versions of \LaTeX .
%            (It probably does, but there is no guarantee.)
%     \item A |ifundefinedorrelax| similar to the one from \xpackage{scrbase.sty}
%             of the KOMA script bundle as 2013/12/19 v3.12 is used now,
%             without the need for \eTeX .
%     \item New versions of Adobe Reader and of some packages have become available.
%     \item Changed the message (type) to be displayed if writing to files is disallowed
%             (as pointed out by Joshua Ellis, thanks!).
%     \item Updates to several details, also in the documentation.
%   \end{Version}
%   \begin{Version}{2015/08/17 v1.2e}
%     \item Bug fix, see \url{https://tex.stackexchange.com/q/261445/6865},
%             thank you to \textsc{Prof. Enrico Gregorio} for providing the fix
%             and to \textsc{Dr. Clea F. Rees} for bringing this to my attention.
%   \end{Version}
%   \begin{Version}{2015/12/21 v1.2f}
%     \item Replaced |\next| with |\@pageslts@currname|.
%     \item Bug fix, see \url{https://tex.stackexchange.com/q/140235/6865}.
%             If the bug had been actually reported (instead of waiting until I see
%             the question), I would have fixed it earlier, of course.
%     \item Changed minor details like fixing urls in the manual.
%   \end{Version}
% \end{History}
%
% \bigskip
%
% When you find a mistake or have a suggestion for an improvement of this package,
% please send an e-mail to the maintainer, thanks!\\
% (Please see BUG REPORTS in the README.)
%
% \bigskip
%
% Note: \textsf{Y} is not missing in the following index, but no command beginning
% with this letter has been used in this \xpackage{pageslts} package.
%
% \pagebreak
%
% \PrintIndex
%
% \Finale
\endinput