summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/teubner/teubner.dtx
blob: 37e205bf2fab9221f83f511a5e7a6225201ead5d (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
% \iffalse meta comment
% File: teubner.dtx Copyright (C) 2001-2004 Claudio Beccari
%
% It may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
%    http://www.latex-project.org/lppl.txt
%
% \fi
%
%% \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         \~}
% \iffalse
%<*dtx>
\ProvidesFile{teubner.dtx}
%</dtx>
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{teubner}
%<driver>\ProvidesFile{teubner.dtx}
              [2008/02/10 v.2.2d extensions for Greek philology]
%
%<*driver>
\documentclass{ltxdoc}
\GetFileInfo{teubner.dtx}
  \title{The \textsf{teubner} package\\
        Extensions for Greek philology%
        \thanks{This file
        has version number \fileversion, last
        revised on \filedate.}}
 \author{Claudio Beccari\\\texttt{claudio.beccari@gmail.com}}
 \date{}
 \providecommand\babel{\textsf{babel}}
 \newcommand\lbr{\char123\relax}\newcommand\rbr{\char125\relax}
 \newenvironment{sintassi}{%
      \begin{quote}\parskip0pt\hfuzz10pt\ttfamily\obeylines
      }{%
      \end{quote}\ignorespaces
      }
 \newcommand*\acro[1]{\expandafter\textsc\expandafter{\MakeLowercase{#1}}}
\begin{document}
 \maketitle
 \DocInput{teubner.dtx}
\end{document}
%</driver>
% \fi
%
% \CheckSum{4013}
%
% \begin{abstract}
% This extension package complements the greek option of the \babel\
% package so as to enable the use of the Lipsian\footnote{What here
% are called Lipsian fonts are a family of fonts that in Greece are
% called ``Lipsiakos''; they are similar to the ones that were being
% used in the Teubner Printing Company of Lipsia from mid XIX century on.}
% fonts and to use several macros for inserting special annotations
% in the written text, as well as to typeset verses with special
% layout. Metric sequences may be defined and typeset by means of a
% companion font \texttt{gmtr????} that follows the same conventions
% as the CB fonts that are normally used when the \babel\ greek
% option is in force.
%
% Examples and lists of commands are available in the file
% \texttt{teubner-doc.pdf} which, as a regular pdf file, embeds all
% the necessary fonts and may be read on screen as well as printed on paper;
% beware, though, that the PostScript fonts that are being used
% in \texttt{teubner-doc.pdf} are not distributed with the package.
% While this documentation is being written the \TeX{}-Live Team is trying
% to reduce the size of the distribution and one of the proposals is to reduce
% the number of Greek fonts distributed on \TeX-Live; therefore it might
% be necessary that the users of this \textsf{teubner} package download the
% missing fonts directly from one of the \acro{CTAN} archives.
% \end{abstract}
%
% \section{Introduction}
% Philologists in general have the necessity of using special
% alphabets and several special symbols in order to mark up their
% texts and to typeset them in a special way. Greek philology makes
% no exception, therefore I prepared this file and some extra fonts
% in order to complement what is already available with the greek
% option of the \babel\ package.
%
% I must warmly thank Paolo Ciacchi of the University of Trieste who
% invited me in this ``adventure'', since I know nothing about
% philology; he assisted me with all his competence, so that I
% could learn so many new things and I could appreciate the world of
% philologists.
%
% Paolo Ciacchi's ``invitation'' arrived when I was almost finished
% with the design of the Lipsian font family; I was working on this new
% typeface after a kind request of Dimitri Filippou, with whom I
% already collaborated for other questions related to Greek
% typesetting. I warmly thank also Dimitri Filippou for the
% patience with which he revised every single glyph of the new
% typeface. Paolo Ciacchi added his constructive criticism to the
% typeface, especially for what concerns diacritical marks. At the
% end I think that the new typeface turned out pretty well thanks to
% both my friends.
%
% The Lipsian font, also called Leipzig or Lipsiakos in Greece, is one of the oblique
% fonts that used to be employed by the typesetters working in the
% German city of Leipzig, among which the Teubner Printing Company.
% This Company's classical works of ancient Greek poetry are considered among
% the best ever published. The name of this file and this extension
% package is in honor of that printing company.
%
% This package documentation does not contain any example written in
% Greek, because when you process this file it is very likely that
% you don't have the suitable Greek fonts and you must still download
% all or some of them. Therefore a companion
% file \texttt{teubner-doc.pdf} is included in this bundle where most,
% if not all, the new commands are documented and suitably shown.
%
% This package contains new environments and new commands; it presumes
% the user invokes it after declaring the \texttt{greek} option to the \babel\
% package; should he forget, this package will complain. But once the
% \texttt{greek} option is properly declared, this package verifies that the
% |polutonikogreek| dialect is selected, or that the |polutoniko| attribute
% is set. This choice depends on the particular version of the \babel\
% package, but should not concern the user; switching back and forth
% between classical Greek and some modern western language is performed
% in a transparent way; possibly there might be some problem switching
% from classical to modern spelling in Greek itself, but since in modern
% spelling the multiplicity of Greek diacritical mark is not forbidden,
% it's the author choice to select classical or modern words, Lipsian or
% Didot fonts, polytonic or monotonic accentuation. The worst it can happen
% is that \babel\ might use just one hyphenation pattern set, so that in
% one of the two Greek versions some words might turn out with the wrong
% hyphens.
%
% The CB Greek fonts, which have been available for some years now on
% \acro{ctan} in the directory \texttt{/tex-archive/fonts/greek/cb} have
% been completed with the new files for the Lipsian fonts,and the metric
% symbols font \texttt{gmtr????.*}; 
% the latter does not need a formal font definition file, because
% the necessary definitions are included in this package.
% All fonts are available also as Type~1 scalable fonts. In general, recent
% distributions of the \TeX\ system already contain the necessary
% configuration to use the Type~1 font in one size, 10\,pt, but, thanks
% scaling, these can be used at any size; this version of \textsf{teubner}
% is compatible with this reduced set. If optical sizes are desired for
% a more professional typesetting, the \acro{ctan} archives contain also
% the \textsf{cbgreek-full} package, which includes also all the Type~1
% fonts at the various standard (EC) sizes, plus other facilities that allow
% to use the CB fonts also in conjunction with the Latin Modern ones.
%
% The CB Greek fonts allow to input Greek text with a Latin keyboard and
% by employing the prefix notation; with a Greek keyboard and file
% \texttt{iso-8859-7.def} it is possible to directly input Greek text with the
% monotonic spelling; if polytonic spelling is required I fear that the above
% file is of little help and that a Latin keyboard does the job without
% an excessive burden.
%
% Nevertheless there is a little point to observe; Lipsian fonts are very
% nice but show most kerning errors with more evidence than the traditional
% Didot Greek fonts. With the prefix notation in force, kerning programs may result disabled
% and some diphthongs and some consonant-vowel combinations appear poorly matched when
% the second letter caries any diacritical mark. In order to avoid this
% ``feature'', the accented vowels may be input by means of macros, that
% directly translate to the accented glyph, rather than invoking the ligature
% programs that are implied by the prefix notation; reading a Greek text
% on the screen while editing the input \texttt{.tex} file when a Latin
% keyboard and such macros are used may be very strange, but authors get
% used to it, and agree that the effort is worth the result.
%
% \section{Environments}
% I apologize if I chose Italian names for verse environments; I wanted to
% use names very different from the corresponding English ones, but at the
% same time easily recognizable.
%
% \DescribeEnv{versi}\DescribeMacro{\verso}  The environment \texttt{versi}
% is used to typeset verses
% in line, without an end of line at the end of each verse; a vertical bar
% with a number on top of it marks the verse limit while allowing a numeric
% reference to a specific verse; the opening environment statement requires
% a string, a short text, in order to indent the verse lines the amount of
% this string width; the syntax is the following
% \begin{sintassi}
% \bslash begin\lbr versi\rbr\lbr\meta{string}\rbr{}
% \meta{verse}\bslash verso[\meta{starting number}]\meta{verse}\bslash verso
% \meta{verse}\bslash verso\meta{verse}\dots{}
% \bslash end\lbr versi\rbr
% \end{sintassi}
% where, of course, \meta{starting number} is required only for the first
% instance of |\verso| or when numbering must be restarted, for example
% after an ellipsis.
%
% \DescribeEnv{Versi} The environment \texttt{Versi} is similar to the
% standard \LaTeX\ environment \texttt{verse}, except verses are numbered
% on multiples of~5; the opening statement requires the \meta{starting
% number} as an optional argument; if this optional argument is not specified,
% the starting number is assumed to be~1.
% \begin{sintassi}
% \bslash begin\lbr Versi\rbr[\meta{starting number}]
% \meta{verse}\bslash\bslash{}\meta{*}[\meta{vertical space}]
% \meta{verse}\bslash\bslash{}
% \dots{}
% \bslash end\lbr Versi\rbr
%\end{sintassi}
%
% \DescribeEnv{VERSI}\DescribeMacro{\SubVerso}\DescribeMacro{\NoSubVerso}
% The environment \texttt{VERSI} allows for two verse
% enumerations; the main enumeration is identical to the one performed by
% the previous environment \texttt{Versi}, while the secondary enumeration
% is in smaller digits and normally numbers consecutive verses, except
% that it can be turned on and off; the verses that lack the secondary
% enumeration are indented by moving them to the right.
% \begin{sintassi}
% \bslash begin\lbr VERSI\rbr[\meta{starting principal number}]
% \meta{verse}\bslash\bslash\meta{*}[\meta{vertical space}]
% \bslash SubVerso[\meta{starting secondary number}]
% \meta{verse}\bslash\bslash\meta{*}[\meta{vertical space}]
% \dots{}
% \bslash NoSubVerso
% \meta{verse}\bslash\bslash\meta{*}[\meta{vertical space}]
% \dots
% \bslash end\lbr VERSI\rbr
% \end{sintassi}
% where if \meta{starting principal number} is missing, 1 is assumed,
% while if \meta{starting secondary number} is missing, the enumeration
% is continued from the next available integer. Of course
% \meta{starting secondary number} is used again when the secondary
% enumeration must be restarted; there are no means to restart the
% principal enumeration.
%
% \DescribeEnv{bracedmetrics} The previous environments accept \meta{verses}
% in any language and in any alphabet, the one that is in force before opening
% the environment; the language and, even less, the alphabet cannot be
% globally changed within the above environments; if such a change is performed,
% it is valid only for one verse, or for the remaining fraction of the verse
% after the language or font change. This means, among the other things, that
% if the default ``alphabet'' is the one that shows the metric symbols,
% the above environments may be used to display ``metric verses'', that is the
% pattern of long, short or ancipital symbols, together with any other metric symbol
% so as to display the metrics without disturbing the written text; when doing
% this metric typesetting, it may happen that some verse patterns exhibit some variants;
% in this case the \texttt{bracedmetrics} environment comes handy, because it
% can display such variants in separate lines but grouped with a large right
% brace; some commands allow to roughly align these variants, so as to
% allow to nest several such environments as if they were single blocks of metric
% symbols. The argument of the opening statement specifies the width of the
% block so as to align properly all the symbols even in nested environments.
% \begin{sintassi}
% \bslash begin\lbr bracedmetrics\rbr\lbr\meta{length}\rbr{}
% \meta{metric pattern}\bslash\bslash
% \meta{metric pattern}\bslash\bslash
% \dots{}
% \bslash end\lbr bracedmetrics\rbr
% \end{sintassi}
% \DescribeMacro{\verseskip}\DescribeMacro{\Hfill} Within the \meta{metric pattern}
% it is possible to flush right the symbols
% by prefixing the whole string with a |\Hfill| command; the \meta{length} may
% be specified as an integer multiple of a ``long'' symbol by means of
%\begin{sintassi}
% \bslash verseskip\lbr\meta{number}\rbr
%\end{sintassi}
% The macro |\verseskip| can be used also within \meta{metric pattern}
% in order to space out metric symbols.
%
% \section{Commands and symbols}
% This package defines a lot of commands for inserting special signs in the middle
% of regular text, for marking zeugmas and synizeses, for putting unusual accents
% on any symbol, for inserting special ``parentheses'' that are used by philologists
% for marking blocks of letters or blocks of text. I suggest that the user consults
% the documentation file \texttt{teubner-doc.pdf} for a complete list of commands
% and symbols.
%
% \DescribeMacro{\newmetrics} Here it might be useful to describe a command
% for defining metric sequences, so as to shorten the definition of metric verses;
% this new command is |\newmetrics| and may be used for the definition of new commands
% whose name \emph{may start with one digit}: precisely this digit may be one
% of~2, 3,~4. Even if \LaTeX\ does not allow macros to contain both digits
% and letters, other service macros have been defined so as to handle these
% special control sequences even if they start with \emph{one} digit strictly lower
% than~5. The syntax is:
% \begin{sintassi}
% \bslash newmetrics\lbr\meta{control sequence}\rbr\lbr\meta{definition}\rbr
% \end{sintassi}
% where \meta{definition} consists in general of a sequence of metric commands such as
% |\longa|, |\brevis|, |\anceps|, etc.
%
% \StopEventually{}
%
% \section{Code}
% The beginning of the file starts with the traditional stuff;
% as usual we provide also the means for avoiding reading this file again.
%    \begin{macrocode}
%<*package>
\ifx\teubner\undefined
    \def\teubner{teubner}\else\expandafter\endinput
\fi
%    \end{macrocode}
% In order to use the PostScript pfb fonts (CM, EC, and CB) it is necessary to know if
% we are dealing with \LaTeX\ or pdf\LaTeX; this is necessary because apparently the
% pfb math extensible fonts derived from the \textsf{META\-FONT} counterparts do not have exactly the same
% effective dimensions; this is why the ``zeugma'' and the ``synizesis'' signs have to be corrected
% when the pfb fonts are used; with these, in facts, the black leader that joins the curved
% extremities appears a little too fat and does not join exactly le left mark. Therefore we
% define a new boolean\footnote{Thanks to Yuqing Deng who spotted an error somewhere else,
% that followed from an improper definition of the state variable \texttt{\string\ifPDF} such
% that the program performed correctly under \texttt{pdflatex} and crashed under \texttt{latex}.}:
%    \begin{macrocode}
\newif\ifPDF \PDFfalse
\@ifundefined{pdfoutput}{\PDFfalse}{\ifnum\pdfoutput>\z@\PDFtrue\fi}
%    \end{macrocode}
% When \texttt{teubner.sty} is input the language Greek must have been already defined;
% otherwise an error message is issued and processing is terminated.
%    \begin{macrocode}
\ifx\captionsgreek\undefined
\PackageError{teubner}{Greek language unknown!\MessageBreak
I am not going to use Lipsian fonts and Scholars' signs\MessageBreak
if Greek is unknown.\MessageBreak
Use the babel package with the \texttt{greek} option.\MessageBreak
Type X <return> to exit.}%
{Type X <return> to exit.}
\fi
%    \end{macrocode}
% If this test is passed, this means that not only the greek option to the \babel\ package
% is set, but also that all the \babel\ machinery is available.
%
%  Since \texttt{teubner.sty} accepts some options it is necessary to provide
% their definitions; in particular the |\or| control sequence conflicts
% with the |\or| primitive command used within the syntax of |\ifcase|\footnote{With
% version 2002/07/18 v.1.0d this has been eliminated; the option remains for
% compatibility with older versions, but the only legal command is now \texttt{\string\oR}.};
% |\oR|is a little exception since all the other accent-vowel macros
% contain only lowercase letters. The point is that accent vowel sequences
% that directly access the accented glyph are made up as such:
% \begin{sintassi}
% \bslash \meta{vowel}\meta{first diacritic}\meta{second diacritic}\meta{third diacritic}
% \textrm{where}
% \meta{first diacritic} \textrm{is \texttt{d} or \texttt{r}  or \texttt{s} for diaeresis, rough or smooth breadth}
% \meta{second diacritic} \textrm{is \texttt{c} or \texttt{a} or \texttt{g} for circumflex or acute or grave}
% \meta{third diacritic} \textrm{is \texttt{i} for iota subscript or adscript}
% \end{sintassi}
% Evidently none of the diacritical marks is compulsory, but at least one must
% be present; if more than one is present it must be given in that sequence. Since |\oR|
% means omicron with rough breath, it is not very important that it is declared
% with the standard sequence |<o| or with |\oR|, because it never
% falls after another letter, so that it never breaks any ligature or kerning command.
% At the same time since all accent combinations are defined as ``text commands'', in \LaTeX\ jargon,
% when their commands are followed by a vowel they define a ``text symbol'' that is directly the
% glyph of the accented vowel; therefore |<o|, |\oR| and |\r{o}| are all equivalent (at the beginning of a word
% where omicron with rough breath is the only place where you can find it). See more on this
% point in the sequel.
%
% At the same time, from July 2005, The full collection of the complete size set of
% the CB fonts is not available any more as the default; only the 10pt size are available; for this reason
% anew option is needed in order to instruct \texttt{teubner.sty} to use the specific file \texttt{type1ec.sty}
% dated at least 2002/09/07, so as to scale all EC and CB fonts from an original at 10\.pt. IN order that
% the \texttt{10pt} plays its role correctly, it is convenient, if not compulsory, to require first the
% \texttt{babel} package, then the \texttt{teubner} one with the option \texttt{10pt}, then all other packages
% required for a specifica document, in particular the \texttt{fontenc} one if the \texttt{T1} encoding
% is requested; this happens when the typesetting with fonts such as the EC, TX, PX, LM, ZE,~\dots\ ones is required.
%    \begin{macrocode}
\newif\ifor\orfalse % Compatibility with older versions
\DeclareOption{or}{\relax}
\newif\ifonesizetypeone
\DeclareOption{10pt}{\onesizetypeonetrue}
\ProcessOptions*
%    \end{macrocode}
%
% In the sequel we frequently use the acronym for the Greek font encoding; we hope
% it will eventually become \texttt{GR} or, following the actual 256 glyph font
% encodings, \texttt{T7} or \texttt{X7}\footnote{Apparently \texttt{T7} has been chosen
% to define an encoding where the first 128 glyphs are the standard \texttt{OT1}
% encoded Latin fonts, and the second group again of 128 glyphs contains the Greek
% characters; therefore, since polytonic spelling requires more than 128 glyphs, the extended
% encoding \texttt{X7} will probably become the one applicable to the whole set of the CB fonts.}.
% Meanwhile the acronym is \texttt{LGR}, so we'd better
% define a symbolic name, so that we can change the definitive name in just one place.
%    \begin{macrocode}
\def\GRencoding@name{LGR}
%    \end{macrocode}
%
% Now the default Olga Greek fonts, used for rendering the ``Greek italic shape''
% are substituted with the Lipsian ones; this simply requires to reenter the
% shape definition commands used in the font description file with new commands
% that refer to the Lipsian fonts; the font encoding is already known to the package
% so that any encoding dependent name is correctly defined. If the \texttt{10pt} option was specified
% it is necessary to load also the package \texttt{type1ec.sty}:
% \begin{macrocode}
\ifonesizetypeone\RequirePackage[10pt]{type1ec}[2002/09/07]\fi
\input{lgrcmr.fd}
\expandafter\EC@family\expandafter{\GRencoding@name}{cmr}{m}{it}  {grml}
\expandafter\EC@family\expandafter{\GRencoding@name}{cmr}{bx}{it} {grxl}
%    \end{macrocode}
%
% \begin{macro}{\metricsfont} Similarly the metric symbol font is declared together
% with a command for selecting it:
% \begin{macrocode}
\DeclareFontFamily{U}{mtr}{\hyphenchar\font\m@ne}
\EC@family{U}{mtr}{m}{n}{gmtr}
\DeclareFontShape{U}{mtr}{m}{it}{<->ssub*mtr/m/n}{}
\newcommand*\metricsfont{\fontencoding{U}\fontfamily{mtr}\upshape}
%    \end{macrocode}
% \end{macro}
% Next we require the package for extensible math fonts; it might be strange to use
% extensible math fonts in Greek philology, but a certain command must be picked up
% from such fonts, with the assurance that it changes size together with the current
% font size.
% \begin{macrocode}
\RequirePackage{exscale}
%    \end{macrocode}
%
% Some macros are necessary to switch languages; such macros must be independent
% (at least for now) from the particular \babel\ version, whether it be version 3.6
% or~3.7; in the former the concept of language attribute is unknown, while the latter
% recognizes varieties of the same language by the attribute setting. Such macros,
% besides being as robust as possible, must provide the alphabet changes as required.
%\begin{macro}{\GreekName} During the language switching operations  |\GreekName|
% distinguishes the dialect or the main language whose attribute
% gets set and, evidently, becomes effective when the main language \texttt{greek}
% is in force.
%    \begin{macrocode}
\ifx\languageattribute\undefined
 \def\GreekName{polutonikogreek}%
\else
 \languageattribute{greek}{polutoniko}\def\GreekName{greek}%
\fi
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\previouslanguage}
%\begin{macro}{\previousencoding} The ``default'' language is defined as the ``previous''
% language; similarly the ``default'' encoding is defined as the ``previous'' encoding; these
% are the language and the encoding in force when the document starts; this is why such macros
% are defined at the beginning of the document:
%    \begin{macrocode}
\AtBeginDocument{%
    \edef\previouslanguage{\languagename}%
    \edef\previousencoding{\f@encoding}%
}
%    \end{macrocode}
% Nevertheless this requires a minimum of attention in specifying the options for the
% \babel\ package and in the order extensions packages are read in. The |teubner.sty| package
% should be read \emph{after} any other package that sets o resets font definitions,
% in particular if font encoding is defined; for example if the T1 encoding is selected
% as the default one, in place of the OT1 encoding, then this choice must be made before
% this package is read in. Similarly when the \babel\ options are specified, remember that
% the last language name becomes the default language at begin document; never
% specify \texttt{greek} as the last language option\dots, well, unless you are going to write
% all your document in Greek; in this case the only switching you need is between
% Didot characters and Lipsian characters (which is simply done by means of |\upshape|
% and |\itshape|); in any case specify the polytonic spelling.
%\end{macro}
%\end{macro}
%
%\begin{macro}{\Lipsiakostext} |\Lipsiakostext| is a declaration stating that from now on
% typesetting will be done with the Lipsian fonts; notice that the encoding and the
% language name in force before this declaration are memorized, then the current
% Greek version is selected; the |\let\~\GRcirc| is required because swithching
% on and off may reset the active tilde and connected macros definitions. |\~| in Greek
% must set the circumflex accent, so we make sure that this really occurs.
%    \begin{macrocode}
\DeclareRobustCommand\Lipsiakostext{\edef\previouslanguage{\languagename}%
    \edef\previousencoding{\f@encoding}%
    \expandafter\select@language\expandafter{\GreekName}%
    \let\~\GRcirc\let~\greek@tilde\itshape}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\NoLipsiakostext} |\NoLipsiakostext| is the opposite declaration
% that undoes everything that was done with |\Lipsiakostext|.
%    \begin{macrocode}
\DeclareRobustCommand\NoLipsiakostext{%
    \expandafter\select@language\expandafter{\previouslanguage}%
    \expandafter\fontencoding\expandafter{\previousencoding}\upshape
    \edef\previouslanguage{\languagename}%
    \edef\previousencoding{\f@encoding}\bbl@activate{~}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\textLipsias} |\textLipsias| is a command that typesets its argument
% with the |\Lipsiakostext| declaration in force; actually the external font encoding
% and language are not memorized, because the pertinent Greek commands are just local.
%    \begin{macrocode}
\DeclareRobustCommand\textLipsias[1]{{%
    \expandafter\select@language\expandafter{\GreekName}%
    \expandafter\fontencoding\expandafter{\GRencoding@name}%
    \itshape\let\~\GRcirc\let~\greek@tilde#1}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\textDidot} |\textDidot| is a similar macro where the common upright
% Greek characters are selected; it goes by itself that if |\textit| is specified
% within the |\textDidot| argument, the typesetting is or becomes identical with what
% one can obtain with the |\textLipsias| command.
%    \begin{macrocode}
\DeclareRobustCommand\textDidot[1]{{%
    \expandafter\select@language\expandafter{\GreekName}%
    \expandafter\fontencoding\expandafter{\GRencoding@name}%
    \upshape\let\~\GRcirc\let~\greek@tilde#1}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\textlatin} |\textlatin| is a redefinition of the standard \babel\
% macro that is adapted to the present situation, where it may be called behind the
% scenes in certain situations that are beyond the control of the typesetter. Therefore
% every precaution is taken in order to be sure that the composition of the command
% argument is really done with the default encoding.
%    \begin{macrocode}
\DeclareRobustCommand\textlatin[1]{\edef\externalencoding{\f@encoding}{%
    \expandafter\select@language\expandafter{\previouslanguage}%
    \expandafter\fontencoding\expandafter{\previousencoding}%
    \bbl@activate{~}\upshape#1}%
    \expandafter\fontencoding\expandafter{\externalencoding}\selectfont}
%    \end{macrocode}
%\end{macro}
%
% Now we start the specific additions introduced with this package.
%
% \begin{macro}{\numero}
% We define a short macro |\numero| used to strip off the pt part of a dimension value
% as displayed by \TeX\ itself; this service macro is going to be used quite a lot for
% getting the font slant per point parameter so as to be able to put in their correct
% position various signs over or under other signs.
% \begin{macrocode}
{%
\catcode`p=12\catcode`t=12\gdef\numero#1pt{#1}%
}
%    \end{macrocode}
% \end{macro}
%
% With the help of such service macro we are going to define a certain number of
% ``lift accent'' macros or ``put cedilla'' macros that work with both upright and
% slanted fonts, although they contain different parameters for Latin compared to
% Greek alphabets.
% \begin{macro}{\lift@accent} The first ``lift accent'' macro just puts an accent over
% a letter, without inserting any space between them; the first argument is the accent
% code (decimal, hexadecimal or octal; I prefer decimal), while the second argument
% is the letter --~any letter, even if it is not a vowel!
% \begin{macrocode}
\newcommand*\lift@accent[2]{\leavevmode
{\edef\slant@{\expandafter\numero\the\fontdimen1\font}%
\dimen@=\z@\setbox\z@\hbox{\char#1}\advance\dimen@-.5\wd\z@
\setbox\tw@\hbox{i}\setbox\z@\hbox{#2}%
\ifdim\wd\z@>\wd\tw@\advance\dimen@ .5\wd\z@
    \else\advance\dimen@ .3\wd\z@\fi
\ifx#2a\advance\dimen@-.1\wd\z@\fi
\ifx#2h\advance\dimen@.05\wd\z@\fi
\@tempdima\ht\z@\advance\@tempdima-1ex\relax
\advance\dimen@\slant@\@tempdima
\raise\@tempdima\hbox to\z@{\kern\dimen@\char#1\relax\hss}\box\z@}}
%    \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\Lift@accent} The second ``lift accent'' macro behaves
% as the first one except it interposes a small
% vertical distance between the accent and the letter:
% \begin{macrocode}
\newcommand*\Lift@accent[2]{\leavevmode
{\edef\slant@{\expandafter\numero\the\fontdimen1\font}%
\dimen@=\z@\setbox\z@\hbox{\char#1}\advance\dimen@-.5\wd\z@
\setbox\tw@\hbox{i}\setbox\z@\hbox{#2}%
\ifdim\wd\z@>\wd\tw@\advance\dimen@ .5\wd\z@
\else\advance\dimen@ .3\wd\z@\fi
\ifx#2a\advance\dimen@-.1\wd\z@\fi
\ifx#2h\advance\dimen@.05\wd\z@\fi
\@tempdima\ht\z@\advance\@tempdima-1ex\advance\@tempdima.1ex\relax
\advance\dimen@\slant@\@tempdima
\raise\@tempdima\hbox to\z@{\kern\dimen@\char#1\relax\hss}\box\z@}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\LIFT@accent} The third ``lift accent'' macro behaves as the first one,
% except it interposes a specified vertical space between the letter and the accent;
% this space is specified as the second argument:
% \begin{macrocode}
\newcommand*\LIFT@accent[3]{\leavevmode
{\edef\slant@{\expandafter\numero\the\fontdimen1\font}%
\dimen@=\z@\setbox\z@\hbox{\char#1}\advance\dimen@-.5\wd\z@
\setbox\tw@\hbox{i}\setbox\z@\hbox{#3}%
\ifdim\wd\z@>\wd\tw@\advance\dimen@ .5\wd\z@
\else\advance\dimen@ .3\wd\z@\fi
\ifx#2a\advance\dimen@-.1\wd\z@\fi
\ifx#2h\advance\dimen@.05\wd\z@\fi
\@tempdima\ht\z@\advance\@tempdima-1ex\relax
\def\@tempA{#2}\ifx\@tempA\undefined\else
\advance\@tempdima#2\fi\let\@tempA\undefined
\advance\dimen@\slant@\@tempdima
\raise\@tempdima\hbox to\z@{\kern\dimen@\char#1\relax\hss}\box\z@}}
%    \end{macrocode}
% \end{macro}
%
% All these macros will be used in subsequent ``put accent'' macros, that will
% stack also several accents one above the other; the necessity arises for example
% when the macron or breve diacritical marks have to be put over accented letters;
% according to typographical practice the accents must go over the macron or the breve.
% In a similar way philologists often must use other diacritical marks in addition
% to the traditional Greek ones, therefore these macros will be used, for example, for
% setting the Scandinavian ring (from a Latin font) over a Greek letter (from a Greek font).
%
% \begin{macro}{\cap@} The first such unusual diacritical mark is a small cap,
% a small upside down breve sign, that is in position~1 of the Greek font table.
% \begin{macrocode}
\DeclareRobustCommand{\cap@}[1]{\leavevmode
{\edef\slant@{\expandafter\numero\the\fontdimen1\font}%
\setbox\tw@\hbox{\fontencoding{\GRencoding@name}\selectfont
    \char1}\dimen@-.5\wd\tw@
\setbox\z@\hbox{#1}%
\advance\dimen@ .5\wd\z@
\@tempdima\ht\z@\advance\@tempdima.55ex\relax
\advance\dimen@\slant@\@tempdima
\ifx\cf@encoding\GRencoding@name\else
\ifx#1k\advance\dimen@-.3\wd\tw@\fi\fi
\raise\@tempdima\hbox to\z@{\kern\dimen@\box\tw@\relax\hss}\box\z@}}
%    \end{macrocode}
% The |\ifx\cf@encoding\GRencoding@name| conditional construct shows that this
% macro behaves differently with different font encodings; the following |\ifx#1k|
% checks the argument against the Greek letter kappa, which shows very clearly
% that these macros operate on any letter, not only vowels.
% \end{macro}
% \begin{macro}{\cap} By means of the above |\cap@| macro we can define three equivalent
% commands to be used either when the Greek encoding is in force, or when one of the
% Latin encodings is in force:
%    \begin{macrocode}
\DeclareTextCommand{\cap}{\GRencoding@name}{\cap@}
\DeclareTextCommand{\cap}{OT1}{\cap@}
\DeclareTextCommand{\cap}{T1}{\cap@}
%    \end{macrocode}
% Probably one definition would be sufficient, but on one side the presence
% of three encoding dependent macros are the remains of initial works, while on the other
% side they prevent to use these macros with encodings for which the macro might not
% work well, because it was not tested with other encodings.
% \end{macro}
%
% \begin{macro}{\cap@cedilla} Similarly a small cap can be put under another letter
% as it was a cedilla; for this task another macro is defined, which makes use of
% the same glyph in position~1 in the Greek font table:
% \begin{macrocode}
\newcommand*\cap@cedilla[1]{\leavevmode
{\setbox4\hbox{\fontencoding{\GRencoding@name}\selectfont\char1}%
\dimen@-.5\wd4
\setbox\z@\hbox{#1}%
\ifx\cf@encoding\GRencoding@name
\ifx#1i\advance\dimen@ .65\wd\z@\else\advance\dimen@ .6\wd\z@\fi
\else
\ifx#1i\advance\dimen@ .55\wd\z@\else\advance\dimen@ .5\wd\z@\fi
\fi
\hbox to\z@{\kern\dimen@\box4\hss}\unhbox\z@}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ring@cedilla} Another cedilla like diacritical mark is the
% Scandinavian ring put under a letter; the correct positioning requires
% careful examination of the letter under which it is to be placed, distinguishing
% the Greek from the Latin encodings:
% \begin{macrocode}
\newcommand*\ring@cedilla[1]{\leavevmode
{\setbox4\hbox{\metricsfont\char26}%
\edef\slant@{\expandafter\numero\the\fontdimen1\font}%
\dimen@-.5\wd4\ifdim\slant@\p@>\z@\advance\dimen@-.04ex\fi
\setbox\z@\hbox{#1}%
\ifx\cf@encoding\GRencoding@name
    \advance\dimen@ .45\wd\z@
    \ifx#1h\advance\dimen@-.13\wd\z@\fi
    \ifx#1a\advance\dimen@-.07\wd\z@\fi
    \ifx#1o\advance\dimen@-.07\wd\z@\fi
    \ifx#1u\advance\dimen@+.07\wd\z@\fi
    \ifx#1w\advance\dimen@+.03\wd\z@\fi
\else
    \ifx#1i\advance\dimen@ .55\wd\z@\else
    \ifx#1r\advance\dimen@.38\wd\z@\else
    \ifx#1o\advance\dimen@.47\wd\z@\else
           \advance\dimen@ .5\wd\z@
    \fi\fi\fi
\fi
\hbox to\z@{\kern\dimen@\box4\hss}\unhbox\z@}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\dot@cedilla} Even the standard \LaTeX\ macro |dot| must be redefined
% with a cedilla like macro, so as to make use of a special dot from the
% metric symbols font:
% \begin{macrocode}
\newcommand*\dot@cedilla[1]{\leavevmode
{\setbox4\hbox{\metricsfont\char27}%
\dimen@-.5\wd4
\setbox\tw@\hbox{i}\setbox\z@\hbox{#1}%
\ifx\cf@encoding\GRencoding@name
    \advance\dimen@ .5\wd\z@
    \ifx#1h\advance\dimen@-.13\wd\z@\fi
\else
    \ifdim\wd\z@>\wd\tw@\advance\dimen@.55\wd\z@
        \else\advance\dimen@.5\wd\tw@\fi
\fi
\setbox\tw@\hbox{o}\ifdim\wd\z@=\wd\tw@\advance\dimen@-.05\wd\z@\fi
\hbox to\z@{\kern\dimen@\box4\hss}\unhbox\z@}}
%    \end{macrocode}
%\end{macro}
%
% \begin{macro}{\tie@cedilla} \LaTeX\ has the macro |\t| for placing a ``tie'' over two
% letters; philologists require also a tie under two letters; this is why another
% cedilla like macro is needed:
% \begin{macrocode}
\newcommand*\tie@cedilla[1]{\leavevmode % mette un tie sotto l'argomento
{\setbox4\hbox{\fontencoding{\GRencoding@name}\selectfont\char20}%
\dimen@-.5\wd4
\setbox\tw@\hbox{i}\setbox\z@\hbox{#1}%
\ifx\cf@encoding\GRencoding@name
    \advance\dimen@.5\wd\z@
    \ifx#1h\advance\dimen@-.1\wd\z@\fi
    \ifx#1u\advance\dimen@.15\wd\z@\fi
\else
    \ifdim\wd\z@>\wd\tw@\advance\dimen@ .55\wd\z@
        \else\advance\dimen@ .5\wd\tw@\fi
\fi
\setbox\tw@\hbox{o}\ifdim\wd\z@=\wd\tw@\advance\dimen@-.05\wd\z@\fi
\hbox to\z@{\kern\dimen@\box4\hss}\unhbox\z@}}
%    \end{macrocode}
% \end{macro}
% All these accent like and cedilla like macros will be extensively used in the following
% definitions.
%    \begin{macrocode}
% grave
\DeclareTextCommand{\`}{\GRencoding@name}[1]{\lift@accent{96}{#1}}
% acute
\DeclareTextCommand{\'}{\GRencoding@name}[1]{\lift@accent{39}{#1}}
% circumflex
\DeclareTextCommand{\GRcirc}{\GRencoding@name}[1]{\lift@accent{126}{#1}}
\DeclareTextCommand{\~}{\GRencoding@name}[1]{\lift@accent{126}{#1}}
%    \end{macrocode}
% For the diaeresis we need to put an invisible character (|v| in the LGR encoded CB fonts)
% in order to avoid any ligature with an implied end of word (boundarychar) that turns
% the diaeresis into an apostrophe.
%    \begin{macrocode}
% diaeresis
\DeclareTextCommand{\"}{\GRencoding@name}[1]{\lift@accent{34v}{#1}}
% breve
\DeclareTextCommand{\u}{\GRencoding@name}[1]{\lift@accent{30}{#1}}
%    \end{macrocode}
% Besides the normal |\u| command for setting a breve command, another ``big breve''
% is required by philologists, who need to mark a diphthong, or in general two letters;
% the macro |\U| does the job, but it is the typesetter's responsibility to input
% the macro argument as made of two letters (possibly with their own accents)
% \begin{macrocode}
\DeclareTextCommand{\U}{\GRencoding@name}[1]{\lift@accent{151}{#1}}
% macron
\DeclareTextCommand{\=}{\GRencoding@name}[1]{\lift@accent{31}{#1}}
% rough
\DeclareTextCommand{\r}{\GRencoding@name}[1]{\lift@accent{60}{#1}}
% smooth
\DeclareTextCommand{\s}{\GRencoding@name}[1]{\lift@accent{62}{#1}}
% acute+diaeresis
\DeclareTextCommand{\Ad}{\GRencoding@name}[1]{\lift@accent{35}{#1}}
% grave+diaeresis
\DeclareTextCommand{\Gd}{\GRencoding@name}[1]{\lift@accent{36}{#1}}
% circumflex+diaeresis
\DeclareTextCommand{\Cd}{\GRencoding@name}[1]{\lift@accent{32}{#1}}
% acute+rough
\DeclareTextCommand{\Ar}{\GRencoding@name}[1]{\lift@accent{86}{#1}}
% grave+rough
\DeclareTextCommand{\Gr}{\GRencoding@name}[1]{\lift@accent{67}{#1}}
% circumflex+rough
\DeclareTextCommand{\Cr}{\GRencoding@name}[1]{\lift@accent{64}{#1}}
% acute+smooth
\DeclareTextCommand{\As}{\GRencoding@name}[1]{\lift@accent{94}{#1}}
% grave+smooth
\DeclareTextCommand{\Gs}{\GRencoding@name}[1]{\lift@accent{95}{#1}}
% circumflex+smooth
\DeclareTextCommand{\Cs}{\GRencoding@name}[1]{\lift@accent{92}{#1}}
%    \end{macrocode}
% Most of the above accent commands are used again in order to tie
% a text symbol meaning to certain combinations, that is when they receive as argument
% a vowel whose accented glyph is present in the font; in this way in order to type
% ``alpha with rough breath, acute accent and iota subscript'' you can type \verb"<'a|",
% or \verb"\Ar{a}|" or |\arai|; the advantage of using the first notation is its
% short string; the advantage of the second is that it does not break kerning
% commands with a preceeding letter; the advantage of the third is that it
% does not break any kerning either before or after. With the Lipsian font
% this trick is particularly useful for any sequence of alpha and upsilon each
% one with its own accents and/or diaresis.
%
% In Greek the regular cedilla is meaningless, so that |\c| may be redefined
% as a semivowel command; at the same time the typesetter might be more
% comfortable if he could use always the same, although longer, macro for
% marking a vowel as a semivowel one; therefore |\c| plays the same role
% in Greek as |\semiv|.
% \begin{macrocode}
% cap cedilla
\DeclareTextCommand{\c}{\GRencoding@name}[1]{\cap@cedilla{#1}}
\DeclareTextCommand{\semiv}{\GRencoding@name}[1]{\cap@cedilla{#1}}
\DeclareTextCommand{\semiv}{OT1}[1]{\cap@cedilla{#1}}
\DeclareTextCommand{\semiv}{T1}[1]{\cap@cedilla{#1}}
% ring cedilla
\DeclareTextCommand{\ring}{\GRencoding@name}[1]{\ring@cedilla{#1}}
\DeclareTextCommand{\ring}{OT1}[1]{\ring@cedilla{#1}}
\DeclareTextCommand{\ring}{T1}[1]{\ring@cedilla{#1}}
% dot cedilla
\DeclareTextCommand{\Dot}{\GRencoding@name}[1]{\dot@cedilla{#1}}
\DeclareTextCommand{\Dot}{OT1}[1]{\dot@cedilla{#1}}
\DeclareTextCommand{\Dot}{T1}[1]{\dot@cedilla{#1}}
% tie cedilla
\DeclareTextCommand{\ut}{\GRencoding@name}[1]{\tie@cedilla{#1}}
\DeclareTextCommand{\ut}{OT1}[1]{\tie@cedilla{#1}}
\DeclareTextCommand{\ut}{T1}[1]{\tie@cedilla{#1}}
%
% Acute breve
\DeclareTextCommand{\Ab}{\GRencoding@name}[1]%
    {\LIFT@accent{39}{-.15ex}{\lift@accent{30}{#1}}}
% Grave breve
\DeclareTextCommand{\Gb}{\GRencoding@name}[1]%
    {\LIFT@accent{96}{-.15ex}{\lift@accent{30}{#1}}}
% Acute rough breve
\DeclareTextCommand{\Arb}{\GRencoding@name}[1]%
    {\LIFT@accent{86}{-.15ex}{\lift@accent{30}{#1}}}
% Grave rough breve
\DeclareTextCommand{\Grb}{\GRencoding@name}[1]%
    {\LIFT@accent{67}{-.15ex}{\lift@accent{30}{#1}}}
% Acute smooth breve
\DeclareTextCommand{\Asb}{\GRencoding@name}[1]%
    {\LIFT@accent{94}{-.15ex}{\lift@accent{30}{#1}}}
% Grave smooth breve
\DeclareTextCommand{\Gsb}{\GRencoding@name}[1]%
    {\LIFT@accent{95}{-.15ex}{\lift@accent{30}{#1}}}
%
% Acute macron
\DeclareTextCommand{\Am}{\GRencoding@name}[1]%
    {\Lift@accent{39}{\lift@accent{31}{#1}}}
% Grave macron
\DeclareTextCommand{\Gm}{\GRencoding@name}[1]%
    {\Lift@accent{96}{\lift@accent{31}{#1}}}
% Circumflex macron
\DeclareTextCommand{\Cm}{\GRencoding@name}[1]%
    {\Lift@accent{126}{\lift@accent{31}{#1}}}
% Acute rough macron
\DeclareTextCommand{\Arm}{\GRencoding@name}[1]%
    {\Lift@accent{86}{\lift@accent{31}{#1}}}
% Grave rough macron
\DeclareTextCommand{\Grm}{\GRencoding@name}[1]%
    {\Lift@accent{67}{\lift@accent{31}{#1}}}
% Circumflex rough macron
\DeclareTextCommand{\Crm}{\GRencoding@name}[1]%
    {\Lift@accent{64}{\lift@accent{31}{#1}}}
% Acute smooth macron
\DeclareTextCommand{\Asm}{\GRencoding@name}[1]%
    {\Lift@accent{94}{\lift@accent{31}{#1}}}
% Grave smooth macron
\DeclareTextCommand{\Gsm}{\GRencoding@name}[1]%
    {\Lift@accent{95}{\lift@accent{31}{#1}}}
% Circumflex smooth macron
\DeclareTextCommand{\Csm}{\GRencoding@name}[1]%
    {\Lift@accent{92}{\lift@accent{31}{#1}}}
% smooth macron
\DeclareTextCommand{\Sm}{\GRencoding@name}[1]%
    {\Lift@accent{62}{\lift@accent{31}{#1}}}
% rough macron
\DeclareTextCommand{\Rm}{\GRencoding@name}[1]%
    {\Lift@accent{60}{\lift@accent{31}{#1}}}
% breve and dieresis
\DeclareTextCommand{\bd}{\GRencoding@name}[1]%
    {\LIFT@accent{30}{-.1ex}{\lift@accent{34v}{#1}}}
%
% iota subscript
\DeclareTextCommand{\iS}{\GRencoding@name}[1]
   {\ooalign{#1\crcr\hidewidth\char124\hidewidth}}
%    \end{macrocode}
%
% \begin{macro}{\d} The |\d| macro must be made available also with the Greek encoding
%    \begin{macrocode}
\DeclareTextCommand{\d}{\GRencoding@name}[1]%
   {\leavevmode\bgroup\o@lign{\relax#1\crcr
    \hidewidth\sh@ft{10}.\hidewidth}\egroup}
%    \end{macrocode}
% \end{macro}
%
% Some other philologist diacritical marks are needed.
% \begin {macro}{\Open} The |\Open| macro sets a special sign under a letter in  order
% to mark it with an open pronunciation.
% \begin{macrocode}
\DeclareRobustCommand{\Open}[1]{\leavevmode
{\setbox4\hbox{\raise-.33ex\hbox{\metricsfont\char14}}%
\dimen@-.5\wd4
\setbox\tw@\hbox{i}\setbox\z@\hbox{#1}%
\ifx\cf@encoding\GRencoding@name
    \advance\dimen@ .5\wd\z@
    \setbox\tw@\hbox{h}\ifdim\wd\z@=\wd\tw@\advance\dimen@-.13\wd\z@\fi
\else
    \ifdim\wd\z@>\wd\tw@\advance\dimen@ .55\wd\z@
        \else\advance\dimen@ .5\wd\tw@\fi
\fi
\setbox\tw@\hbox{o}\ifdim\wd\z@=\wd\tw@\advance\dimen@-.05\wd\z@\fi
\hbox to\z@{\kern\dimen@\box4\hss}\unhbox\z@}}
%    \end{macrocode}
% \end{macro}
% \begin {macro}{\nasal} The macro |\nasal| marks a letter for a nasal pronunciation.
% \begin{macrocode}
\DeclareRobustCommand{\nasal}[1]{\leavevmode
{\setbox4\hbox{\raise-1.7ex\hbox{\GEcq}}%
\dimen@-.5\wd4
\setbox\tw@\hbox{i}\setbox\z@\hbox{#1}%
\ifx\cf@encoding\GRencoding@name
    \advance\dimen@ .5\wd\z@
    \setbox\tw@\hbox{h}\ifdim\wd\z@=\wd\tw@\advance\dimen@-.13\wd\z@\fi
\else
    \ifdim\wd\z@>\wd\tw@\advance\dimen@ .55\wd\z@
        \else\advance\dimen@ .5\wd\tw@\fi
\fi
\setbox\tw@\hbox{o}\ifdim\wd\z@=\wd\tw@\advance\dimen@-.05\wd\z@\fi
\hbox to\z@{\kern\dimen@\box4\hss}\unhbox\z@}}
%    \end{macrocode}
% \end{macro}
%\begin {macro}{\tenaspir} Similarly |\tenaspir| marks a ``tenuis aspiratio''
% \begin{macrocode}
\DeclareRobustCommand{\tenaspir}[1]{#1\/%
    {\fontencoding{\GRencoding@name}\selectfont<v}}
%    \end{macrocode}
% \end{macro}
%\begin{macro}{\palat} |\palat| marks a palatal pronunciation of some consonants.
%    \begin{macrocode}
\DeclareRobustCommand{\palat}[1]{#1{%
    \expandafter\fontencoding\expandafter{\GRencoding@name}\selectfont
    \anwtonos}}
%    \end{macrocode}
%\end{macro}
%
% With the help of some of the previous macros some new commands get defined so as to
% use a simple more or less mnemonic macro instead of having the typesetter type in
% nested macros; these macros are valid only in the Greek and Latin encodings.
%    \begin{macrocode}
% dot and breve
\DeclareTextCommand{\Ud}{\GRencoding@name}[1]{\d{\u{#1}}}
% dot and macron
\DeclareTextCommand{\md}{\GRencoding@name}[1]{\d{\={#1}}}
% open and breve
\DeclareTextCommand{\UO}{\GRencoding@name}[1]{\Open{\u{#1}}}
% open and macron
\DeclareTextCommand{\mO}{\GRencoding@name}[1]{\Open{\={#1}}}
%
\DeclareTextCommand{\Ud}{T1}[1]{\d{\u{#1}}}
\DeclareTextCommand{\md}{T1}[1]{\d{\={#1}}}
\DeclareTextCommand{\UO}{T1}[1]{\Open{\u{#1}}}
\DeclareTextCommand{\mO}{T1}[1]{\Open{\={#1}}}
%
\DeclareTextCommand{\Ud}{OT1}[1]{\d{\u{#1}}}
\DeclareTextCommand{\md}{OT1}[1]{\d{\={#1}}}
\DeclareTextCommand{\UO}{OT1}[1]{\Open{\u{#1}}}
\DeclareTextCommand{\mO}{OT1}[1]{\Open{\={#1}}}
%    \end{macrocode}
%
% \begin{macro}{\greekquoteleft}
%\begin{macro}{\greekquoteleft}
%\begin{macro}{\textcompwordmark}
%\begin{macro}{\textemdash}
%\begin{macro}{emdash}
%\begin{macro}{\textendash}
% Several macros are traditionally defined for every encoding; we do not make exceptions.
% Actually all the symbols defined here can be obtained with the regular CB font ligatures
% so the macros are sort of superfluous. Nevertheless, in case any of the component symbols
% is made active and defined to perform something different, these macros can overcome
% the difficulty of producing the ligated glyphs. Even the |\textcompwordmark| macro,
% although the compound word mark is sort of unusual, could have been omitted, because
% with a Latin keyboard this symbol gets input by pressing the ``v'' key (``v'' stands
% for ``void''); all the hyphenation pattern files for the Greek language recognize
% ``v'' as a letter, an invisible letter, that breaks any ligature, that hides the end
% of the word, that allows hyphenation (if the rest of the word is taken as a
% \emph{word} by \TeX\ itself, which does not happen all the time!).
% \begin{macrocode}
\DeclareTextSymbol{\greekquoteleft}{\GRencoding@name}{123}
\DeclareTextSymbol{\greekquoteright}{\GRencoding@name}{125}
\DeclareTextSymbol{\textcompwordmark}{\GRencoding@name}{118}
\DeclareTextSymbol{\textemdash}{\GRencoding@name}{127}
\let\emdash\textemdash
\DeclareTextSymbol{\textendash}{\GRencoding@name}{0}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
%\begin{macro}{\stigma}
%\begin{macro}{\varstigma}
%\begin{macro}{\koppa}
%\begin{macro}{\coppa}
%\begin{macro}{\varkoppa}
%\begin{macro}{\sampi}
%\begin{macro}{\Coppa}
%\begin{macro}{\Stigma}
%\begin{macro}{\Sampi}
%\begin{macro}{\Euro}
%\begin{macro}{\permill} Some other Greek symbols are defined; some deal with the
% lowercase and upper case Milesian numerals, that are not accessible in the
% font matrix with a normal keyboard stroke, and some deal with the Euro symbol and
% the permill symbol, that are unlikely to be used in a philological text,
% but, who knows\dots
%    \begin{macrocode}
\DeclareTextSymbol{\stigma}{\GRencoding@name}{006}
\DeclareTextSymbol{\varstigma}{\GRencoding@name}{007}
\DeclareTextSymbol{\koppa}{\GRencoding@name}{18}
\DeclareTextSymbol{\varkoppa}{\GRencoding@name}{19}
\let\coppa\varkoppa
\DeclareTextSymbol{\sampi}{\GRencoding@name}{27}
\DeclareTextSymbol{\Coppa}{\GRencoding@name}{21}\let\Koppa\Coppa
\DeclareTextSymbol{\Stigma}{\GRencoding@name}{22}
\DeclareTextSymbol{\Sampi}{\GRencoding@name}{23}
\DeclareTextSymbol{\Euro}{\GRencoding@name}{24}
\DeclareTextSymbol{\permill}{\GRencoding@name}{25}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\begin{macro}{\textdollar}
%\begin{macro}{\textsection}
%\begin{macro}{\textsterling}
%\begin{macro}{\textunderscore}
%\begin{macro}{\textvisiblespace} More important, although unlikely to be found in
% a philological text, is the question of standard \LaTeX\ commands that are defined
% with reference to some encoding; if Greek text is being typeset, the Greek encoding
% is being used and such symbols would not be available any more; \LaTeX would issue
% warning messages complaining for their absence. Therefore we redefined them also
% for the Greek encoding.
%    \begin{macrocode}
\DeclareTextCommand{\textdollar}{\GRencoding@name}%
    {{\fontencoding{T1}\selectfont\char36}}
\DeclareTextCommand{\textsection}{\GRencoding@name}%
    {{\fontencoding{T1}\selectfont\char159}}
\DeclareTextCommand{\textsterling}{\GRencoding@name}%
    {{\fontencoding{T1}\selectfont\char191}}
\DeclareTextCommand{\textunderscore}{\GRencoding@name}%
    {{\fontencoding{T1}\selectfont\char95}}
\DeclareTextCommand{\textvisiblespace}{\GRencoding@name}%
    {{\fontencoding{T1}\selectfont\char32}}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%
% Now come the dozens of macros that allow to access Greek accented vowels (plus rho with
% rough and smooth breaths) with macros instead of ligatures; such macros allow the
% kerning information to be used by \TeX, while the ligature mechanism would sometimes
% impeach the use of such kerning information. Notice that the same glyphs are often accessed
% with a ``text symbol'' or a ``text composite symbol''; as explained above the opportunity
% of using either one derives from the necessity of maintaining the kerning mechanism embedded in
% the font; if the CB fonts had a postfixed accent notation, instead of a prefixed one, none of
% these macros would be necessary (probably\dots!), but there would be other inconveniences.
%    \begin{macrocode}
\DeclareTextSymbol{\ag}{\GRencoding@name}{128}
\DeclareTextComposite{\`}{\GRencoding@name}{a}{128}
\DeclareTextSymbol{\ar}{\GRencoding@name}{129}
\DeclareTextComposite{\r}{\GRencoding@name}{a}{129}
\DeclareTextSymbol{\as}{\GRencoding@name}{130}
\DeclareTextComposite{\s}{\GRencoding@name}{a}{130}
\DeclareTextSymbol{\aa}{\GRencoding@name}{136}
\DeclareTextComposite{\'}{\GRencoding@name}{a}{136}
\DeclareTextSymbol{\ac}{\GRencoding@name}{144}
\DeclareTextComposite{\~}{\GRencoding@name}{a}{144}
\DeclareTextSymbol{\ai}{\GRencoding@name}{248}
\DeclareTextSymbol{\aai}{\GRencoding@name}{140}
\DeclareTextSymbol{\aci}{\GRencoding@name}{148}
\DeclareTextSymbol{\agi}{\GRencoding@name}{132}
\DeclareTextSymbol{\ara}{\GRencoding@name}{137}
\DeclareTextComposite{\Ar}{\GRencoding@name}{a}{137}
\DeclareTextSymbol{\arc}{\GRencoding@name}{145}
\DeclareTextComposite{\Cr}{\GRencoding@name}{a}{145}
\DeclareTextSymbol{\arg}{\GRencoding@name}{131}
\DeclareTextComposite{\Gr}{\GRencoding@name}{a}{131}
\DeclareTextSymbol{\ari}{\GRencoding@name}{133}
\DeclareTextSymbol{\asa}{\GRencoding@name}{138}
\DeclareTextComposite{\As}{\GRencoding@name}{a}{138}
\DeclareTextSymbol{\asc}{\GRencoding@name}{146}
\DeclareTextComposite{\Cs}{\GRencoding@name}{a}{146}
\DeclareTextSymbol{\asg}{\GRencoding@name}{139}
\DeclareTextComposite{\Gs}{\GRencoding@name}{a}{139}
\DeclareTextSymbol{\asi}{\GRencoding@name}{134}
\DeclareTextSymbol{\argi}{\GRencoding@name}{135}
\DeclareTextSymbol{\arai}{\GRencoding@name}{141}
\DeclareTextSymbol{\arci}{\GRencoding@name}{149}
\DeclareTextSymbol{\asai}{\GRencoding@name}{142}
\DeclareTextSymbol{\asgi}{\GRencoding@name}{143}
\DeclareTextSymbol{\asci}{\GRencoding@name}{150}
\DeclareTextSymbol{\hg}{\GRencoding@name}{152}
\DeclareTextComposite{\`}{\GRencoding@name}{h}{152}
\DeclareTextSymbol{\hr}{\GRencoding@name}{153}
\DeclareTextComposite{\r}{\GRencoding@name}{h}{153}
\DeclareTextSymbol{\hs}{\GRencoding@name}{154}
\DeclareTextComposite{\s}{\GRencoding@name}{h}{154}
\DeclareTextSymbol{\hrg}{\GRencoding@name}{163}
\DeclareTextComposite{\Gr}{\GRencoding@name}{h}{163}
\DeclareTextSymbol{\hgi}{\GRencoding@name}{156}
\DeclareTextSymbol{\hri}{\GRencoding@name}{157}
\DeclareTextSymbol{\hsi}{\GRencoding@name}{158}
\DeclareTextSymbol{\hrgi}{\GRencoding@name}{167}
\DeclareTextSymbol{\ha}{\GRencoding@name}{160}
\DeclareTextComposite{\'}{\GRencoding@name}{h}{160}
\DeclareTextSymbol{\hra}{\GRencoding@name}{161}
\DeclareTextComposite{\Ar}{\GRencoding@name}{h}{161}
\DeclareTextSymbol{\hsa}{\GRencoding@name}{162}
\DeclareTextComposite{\As}{\GRencoding@name}{h}{162}
\DeclareTextSymbol{\hsg}{\GRencoding@name}{171}
\DeclareTextComposite{\Gs}{\GRencoding@name}{h}{171}
\DeclareTextSymbol{\hai}{\GRencoding@name}{164}
\DeclareTextSymbol{\hrai}{\GRencoding@name}{165}
\DeclareTextSymbol{\hsai}{\GRencoding@name}{166}
\DeclareTextSymbol{\hsgi}{\GRencoding@name}{175}
\DeclareTextSymbol{\hc}{\GRencoding@name}{168}
\DeclareTextComposite{\~}{\GRencoding@name}{h}{168}
\DeclareTextSymbol{\hrc}{\GRencoding@name}{169}
\DeclareTextComposite{\Cr}{\GRencoding@name}{h}{169}
\DeclareTextSymbol{\hsc}{\GRencoding@name}{170}
\DeclareTextComposite{\Cs}{\GRencoding@name}{h}{170}
\DeclareTextSymbol{\hci}{\GRencoding@name}{172}
\DeclareTextSymbol{\hrci}{\GRencoding@name}{173}
\DeclareTextSymbol{\hsci}{\GRencoding@name}{174}
\DeclareTextSymbol{\hi}{\GRencoding@name}{249}
\DeclareTextSymbol{\wg}{\GRencoding@name}{176}
\DeclareTextComposite{\`}{\GRencoding@name}{w}{176}
\DeclareTextSymbol{\wr}{\GRencoding@name}{177}
\DeclareTextComposite{\r}{\GRencoding@name}{w}{177}
\DeclareTextSymbol{\ws}{\GRencoding@name}{178}
\DeclareTextComposite{\s}{\GRencoding@name}{w}{178}
\DeclareTextSymbol{\wrg}{\GRencoding@name}{179}
\DeclareTextComposite{\Gr}{\GRencoding@name}{w}{179}
\DeclareTextSymbol{\wgi}{\GRencoding@name}{180}
\DeclareTextSymbol{\wri}{\GRencoding@name}{181}
\DeclareTextSymbol{\wsi}{\GRencoding@name}{182}
\DeclareTextSymbol{\wrgi}{\GRencoding@name}{183}
\DeclareTextSymbol{\wa}{\GRencoding@name}{184}
\DeclareTextComposite{\'}{\GRencoding@name}{w}{184}
\DeclareTextSymbol{\wra}{\GRencoding@name}{185}
\DeclareTextComposite{\Ar}{\GRencoding@name}{w}{185}
\DeclareTextSymbol{\wsa}{\GRencoding@name}{186}
\DeclareTextComposite{\As}{\GRencoding@name}{w}{186}
\DeclareTextSymbol{\wsg}{\GRencoding@name}{187}
\DeclareTextComposite{\Gs}{\GRencoding@name}{w}{187}
\DeclareTextSymbol{\wai}{\GRencoding@name}{188}
\DeclareTextSymbol{\wrai}{\GRencoding@name}{189}
\DeclareTextSymbol{\wsai}{\GRencoding@name}{190}
\DeclareTextSymbol{\wsgi}{\GRencoding@name}{191}
\DeclareTextSymbol{\wc}{\GRencoding@name}{192}
\DeclareTextComposite{\~}{\GRencoding@name}{w}{192}
\DeclareTextSymbol{\wrc}{\GRencoding@name}{193}
\DeclareTextComposite{\Cr}{\GRencoding@name}{w}{193}
\DeclareTextSymbol{\wsc}{\GRencoding@name}{194}
\DeclareTextComposite{\Cs}{\GRencoding@name}{w}{194}
\DeclareTextSymbol{\wci}{\GRencoding@name}{196}
\DeclareTextSymbol{\wrci}{\GRencoding@name}{197}
\DeclareTextSymbol{\wsci}{\GRencoding@name}{198}
\DeclareTextSymbol{\wi}{\GRencoding@name}{250}
\DeclareTextSymbol{\ig}{\GRencoding@name}{200}
\DeclareTextComposite{\`}{\GRencoding@name}{i}{200}
\DeclareTextSymbol{\ir}{\GRencoding@name}{201}
\DeclareTextComposite{\r}{\GRencoding@name}{i}{201}
\DeclareTextSymbol{\is}{\GRencoding@name}{202}
\DeclareTextComposite{\s}{\GRencoding@name}{i}{202}
\DeclareTextSymbol{\irg}{\GRencoding@name}{203}
\DeclareTextComposite{\Gr}{\GRencoding@name}{i}{203}
\DeclareTextSymbol{\ia}{\GRencoding@name}{208}
\DeclareTextComposite{\'}{\GRencoding@name}{i}{208}
\DeclareTextSymbol{\ira}{\GRencoding@name}{209}
\DeclareTextComposite{\Ar}{\GRencoding@name}{i}{209}
\DeclareTextSymbol{\isa}{\GRencoding@name}{210}
\DeclareTextComposite{\As}{\GRencoding@name}{i}{210}
\DeclareTextSymbol{\isg}{\GRencoding@name}{211}
\DeclareTextComposite{\Gs}{\GRencoding@name}{i}{211}
\DeclareTextSymbol{\ic}{\GRencoding@name}{216}
\DeclareTextComposite{\~}{\GRencoding@name}{i}{216}
\DeclareTextSymbol{\irc}{\GRencoding@name}{217}
\DeclareTextComposite{\Cr}{\GRencoding@name}{i}{217}
\DeclareTextSymbol{\isc}{\GRencoding@name}{218}
\DeclareTextComposite{\Cs}{\GRencoding@name}{i}{218}
\DeclareTextSymbol{\id}{\GRencoding@name}{240}
\DeclareTextComposite{\"}{\GRencoding@name}{i}{240}
\DeclareTextSymbol{\idg}{\GRencoding@name}{241}
\DeclareTextComposite{\Gd}{\GRencoding@name}{i}{241}
\DeclareTextSymbol{\ida}{\GRencoding@name}{242}
\DeclareTextComposite{\Ad}{\GRencoding@name}{i}{242}
\DeclareTextSymbol{\idc}{\GRencoding@name}{243}
\DeclareTextComposite{\Cd}{\GRencoding@name}{i}{243}
\DeclareTextSymbol{\ug}{\GRencoding@name}{204}
\DeclareTextComposite{\`}{\GRencoding@name}{u}{204}
\DeclareTextSymbol{\ur}{\GRencoding@name}{205}
\DeclareTextComposite{\r}{\GRencoding@name}{u}{205}
\DeclareTextSymbol{\us}{\GRencoding@name}{206}
\DeclareTextComposite{\s}{\GRencoding@name}{u}{206}
\DeclareTextSymbol{\urg}{\GRencoding@name}{207}
\DeclareTextComposite{\Gr}{\GRencoding@name}{u}{207}
\DeclareTextSymbol{\ua}{\GRencoding@name}{212}
\DeclareTextComposite{\'}{\GRencoding@name}{u}{212}
\DeclareTextSymbol{\ura}{\GRencoding@name}{213}
\DeclareTextComposite{\Ar}{\GRencoding@name}{u}{213}
\DeclareTextSymbol{\usa}{\GRencoding@name}{214}
\DeclareTextComposite{\As}{\GRencoding@name}{u}{214}
\DeclareTextSymbol{\usg}{\GRencoding@name}{215}
\DeclareTextComposite{\Gs}{\GRencoding@name}{u}{215}
\DeclareTextSymbol{\uc}{\GRencoding@name}{220}
\DeclareTextComposite{\~}{\GRencoding@name}{u}{220}
\DeclareTextSymbol{\urc}{\GRencoding@name}{221}
\DeclareTextComposite{\Cr}{\GRencoding@name}{u}{221}
\DeclareTextSymbol{\usc}{\GRencoding@name}{222}
\DeclareTextComposite{\Cs}{\GRencoding@name}{u}{222}
\DeclareTextSymbol{\ud}{\GRencoding@name}{244}
\DeclareTextComposite{\"}{\GRencoding@name}{u}{244}
\DeclareTextSymbol{\udg}{\GRencoding@name}{245}
\DeclareTextComposite{\Gd}{\GRencoding@name}{u}{245}
\DeclareTextSymbol{\uda}{\GRencoding@name}{246}
\DeclareTextComposite{\Ad}{\GRencoding@name}{u}{246}
\DeclareTextSymbol{\udc}{\GRencoding@name}{247}
\DeclareTextComposite{\Cd}{\GRencoding@name}{u}{247}
\DeclareTextSymbol{\eg}{\GRencoding@name}{224}
\DeclareTextComposite{\`}{\GRencoding@name}{e}{224}
\DeclareTextSymbol{\er}{\GRencoding@name}{225}
\DeclareTextComposite{\r}{\GRencoding@name}{e}{225}
\DeclareTextSymbol{\es}{\GRencoding@name}{226}
\DeclareTextComposite{\s}{\GRencoding@name}{e}{226}
\DeclareTextSymbol{\erg}{\GRencoding@name}{227}
\DeclareTextComposite{\Gr}{\GRencoding@name}{e}{227}
\DeclareTextSymbol{\ea}{\GRencoding@name}{232}
\DeclareTextComposite{\'}{\GRencoding@name}{e}{232}
\DeclareTextSymbol{\era}{\GRencoding@name}{233}
\DeclareTextComposite{\Ar}{\GRencoding@name}{e}{233}
\DeclareTextSymbol{\esa}{\GRencoding@name}{234}
\DeclareTextComposite{\As}{\GRencoding@name}{e}{234}
\DeclareTextSymbol{\esg}{\GRencoding@name}{235}
\DeclareTextComposite{\Gs}{\GRencoding@name}{e}{235}
\DeclareTextSymbol{\oR}{\GRencoding@name}{229}
\DeclareTextComposite{\r}{\GRencoding@name}{o}{229}
\DeclareTextSymbol{\og}{\GRencoding@name}{228}
\DeclareTextComposite{\`}{\GRencoding@name}{o}{228}
\DeclareTextSymbol{\os}{\GRencoding@name}{230}
\DeclareTextComposite{\s}{\GRencoding@name}{o}{230}
\DeclareTextSymbol{\org}{\GRencoding@name}{231}
\DeclareTextComposite{\Gr}{\GRencoding@name}{o}{231}
\DeclareTextSymbol{\oa}{\GRencoding@name}{236}
\DeclareTextComposite{\'}{\GRencoding@name}{o}{236}
\DeclareTextSymbol{\ora}{\GRencoding@name}{237}
\DeclareTextComposite{\Ar}{\GRencoding@name}{o}{237}
\DeclareTextSymbol{\osa}{\GRencoding@name}{238}
\DeclareTextComposite{\As}{\GRencoding@name}{o}{238}
\DeclareTextSymbol{\osg}{\GRencoding@name}{239}
\DeclareTextComposite{\Gs}{\GRencoding@name}{o}{239}
\DeclareTextSymbol{\rr}{\GRencoding@name}{251}
\DeclareTextComposite{\r}{\GRencoding@name}{r}{251}
\DeclareTextSymbol{\rs}{\GRencoding@name}{252}
\DeclareTextComposite{\s}{\GRencoding@name}{r}{252}
\DeclareTextSymbol{\Id}{\GRencoding@name}{219}
\DeclareTextComposite{\"}{\GRencoding@name}{I}{219}
\DeclareTextSymbol{\Ud}{\GRencoding@name}{223}
\DeclareTextComposite{\"}{\GRencoding@name}{U}{223}
%
%    \end{macrocode}
%
% Next come some short macros for inserting special symbols that philologists
% use quite often in Greek.
%\begin{macro}{\h} Macro |\h| is used to insert a Latin ``h'' while typesetting in Greek.
%\begin{macro}{\q} Macro |\q| is used to insert a Latin ``q'' while typesetting in Greek.
%\begin{macro}{\yod}\begin{macro}{\iod} Macros |\yod| and |\iod| are used to insert a
% Latin ``j'' while typesetting in Greek; the control sequence |\jod| was avoided in order
% to reduce the possibility of typing |\jot| which is a \TeX\ internal dimension.
%    \begin{macrocode}
\DeclareTextCommand{\h}{\GRencoding@name}%
    {{\fontencoding{OT1}\selectfont h}}
\DeclareTextCommand{\q}{\GRencoding@name}%
    {{\fontencoding{OT1}\selectfont q}}
\DeclareTextCommand{\yod}{\GRencoding@name}%
    {{\fontencoding{OT1}\selectfont j}}%
\let\iod\yod
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\begin {macro}{\f}
%\begin {macro}{\F}
%\begin {macro}{\digamma}
%\begin {macro}{\Digamma}
% At the same time it was believed that for inserting lower
% and upper case ``digamma'' it was preferable to use short macros and to avoid
% the dilemma between the |\ddigamma| and the |\digamma| macros, the former being the
% one defined in the \texttt{greek} extension to \babel, the latter being
% a standard mathematical symbol; initially I believed that philologists do
% not use mathematical symbols so we made |\digamma| an alias for |\f|; afterwards I found out that
% mathematicians, physicists, engineers, \dots\ use the \textsf{teubner.sty} package and that the |\digamma| is a symbol
% already defined in the package \textsf{amssymb.sty}; therefore I made a
% conditional creation of this alias; this trick is delayed to the beginning of
% the document, so as to make it independent on the order with which packages
% are loaded.
%    \begin{macrocode}
\DeclareTextSymbol{\f}{\GRencoding@name}{147}
\AtBeginDocument{\@ifpackageloaded{amssymb}{\let\AMSdigamma\digamma
\def\digamma{\textormath{\f}{\AMSdigamma}}}{\let\digamma\f}}
\DeclareTextSymbol{\F}{\GRencoding@name}{195}\let\Digamma\F
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%
%\begin {macro}{\fLow}
%\begin {macro}{\fHigh}
% The digamma glyphs set forth another question because,
% according to Paolo Ciacchi, a different glyph should be used for typesetting text
% compared with the one that is used as a variant in Milesian numerals in place of the
% standard stigma symbol.
% By means of macros |\fLow| or |\fHigh| it is possible to chose the raised or the lowered
% digamma glyphs; Greek numerals always use the lowered one, while when text is being
% typeset the typesetter can chose the version he likes best.
%    \begin{macrocode}
\DeclareRobustCommand{\fLow}%
    {{\setbox\z@\hbox{\f}\dimen@\ht\z@
    \advance\dimen@-1ex\raise-\dimen@\hbox{\box\z@}}}
\DeclareRobustCommand{\fHigh}%
    {{\setbox\z@\hbox{\f}\dimen@\dp\z@\raise\dimen@\hbox{\box\z@}}}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%
%\begin{macro}{\qmark}
%\begin{macro}{\lpar}
%\begin{macro}{\rpar}
%\begin{macro}{\frapar}
% Here we start a set of miscellaneous macros. We begin with some parentheses
% that should turn out in upright shape, even if the default font is the Lipsian
% one which is oblique; its parentheses are oblique as in all oblique fonts, therefore
% we need to quietly change fonts behind the scenes. The same is true with the
% question mark that, philologically speaking, represents an uncertain element, not
% the termination of a real question; it should therefore always come out between
% parentheses and in upright shape from a Latin font. While the parenthesized
% question mark comes from the OT1 Latin upright font, the parentheses obtained with
% |\lpar| and |\rpar| are taken from the metric symbols font, as well as the
% parentheses used in the parenthesized text processed with macro |\frapar|.
%    \begin{macrocode}
\DeclareRobustCommand\qmark{\hskip.16ex{\fontencoding{OT1}\upshape(?)}}
\DeclareRobustCommand\lpar{{\metricsfont(}}
\DeclareRobustCommand\rpar{{\metricsfont)}}
\DeclareRobustCommand\frapar[1]{\lpar#1\rpar}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%
%\begin{macro}{\ap} The apex/superscript macro |\ap| does not differ much from the plain
% standard \LaTeX\ macro |\textsuperscript|, the only difference being the italic correction
% that precedes |\textsuperscript|.
%    \begin{macrocode}
\DeclareRobustCommand{\ap}[1]{\/\textsuperscript{#1}}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\Dots}
%\begin{macro}{\DOTS}
%\begin{macro}{\Dashes}
%\begin{macro}{\DASHES}
% Four macros are defined so as to insert a certain number of dots or dashes as specified
% in the optional command argument; |\Dots| and |\Dashes| fit the dots or the dashes
% pretty close together, while |\DOTS| and |\DASHES| fit them more loosely apart.
%    \begin{macrocode}
\newcommand\Dots[1][1]{{\count255=#1\@whilenum\count255>\z@
        \do{\kern.4ex\d{v}\kern.4ex\advance\count255\m@ne}}}
\newcommand\DOTS[1][1]{{\count255=#1\@whilenum\count255>\z@
        \do{\kern.8ex\d{v}\kern.8ex\advance\count255\m@ne}}}
\newcommand\Dashes[1][1]{{\count255=#1\@whilenum\count255>\z@
        \do{\kern.4ex--\kern.4ex\advance\count255\m@ne}}}
\newcommand\DASHES[1][1]{{\count255=#1\@whilenum\count255>\z@
        \do{\kern.8ex--\kern.8ex\advance\count255\m@ne}}}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%
%\begin{macro}{\:}
%\begin{macro}{\;}
%\begin{macro}{\?}
%\begin{macro}{\MutPers}
% Greek text or poetry sometimes requires some stacked dots; here we prepared macros for
% two (|\:|), three (|\;|), and four (|\?|) stacked dots. Two stacked dots in a row indicate
% that the speaker of a drama or comedy has changed (\textit{mutatio personae}). For |\:|
% and |\;| it is necessary to preserve the mathematical meaning, while |\?| apparently does
% not have any previous use in standard \LaTeX. The real macros are |\tw@dots|, |\thre@dots|,
% and |\f@urdots|.
%    \begin{macrocode}
\DeclareRobustCommand{\:}{\textormath{\tw@dots}{\mskip\medmuskip}}
\DeclareRobustCommand{\;}{\textormath{\thre@dots}{\mskip\thickmuskip}}
\DeclareRobustCommand{\?}{\f@urdots}
\DeclareRobustCommand{\mutpers}{\makebox[1ex]{\:\hfill\:}\space}
\let\MutPers\mutpers\let\antilabe\mutpers
\def\tw@dots{\mbox{\kern1\p@\vbox to1ex{\hbox{.}\vss\hbox{.}}}}
\def\thre@dots{\mbox{\kern1\p@\vbox to 2ex{\hbox{.}\vss
    \hbox{.}\vss\hbox{.}}}}
\def\f@urdots{\mbox{\kern1\p@\vbox to 2ex{\hbox{.}\vss
    \hbox{.}\vss\hbox{.}\vss\hbox{.}}}}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%
% \DeleteShortVerb{\|}
%\begin{macro}{\|}
% \MakeShortVerb{\|}
%\begin{macro}{\dBar}
%\begin{macro}{\tBar}
% Similarly Greek text and poetry require certain \emph{cesurae} indicated with
% vertical bars; we provided commands for one (\verb"\|"), two (|\dBar|), and
% three (|\tBar|) vertical bars.
%    \begin{macrocode}
\DeclareRobustCommand{\|}{\relax\ensuremath{\mskip2mu\vert}}
\DeclareRobustCommand{\dBar}{\ensuremath{\vert\vert}}
\DeclareRobustCommand{\tBar}{\ensuremath{\vert\vert\vert}}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%
%\begin{macro}{\negthinspace}
%\begin{macro}{\posthinspace}
%\begin{macro}{\posthindspace}
%\begin{macro}{\,}
%\begin{macro}{\!}
% The following are mostly service macros for adjusting the spacing within macro definitions.
% Nevertheless they are available also to the typesetter, because sometimes certain glyph
% combinations require a little adjustment. Of course the typesetter will not use them
% at the very beginning, but only during proof revision, so as to introduce them only
% where really necessary.
%    \begin{macrocode}
\def\negthinspace{\nobreak\hskip-0.07em}
\def\posthinspace{\nobreak\hskip0.07em}
\def\posthindspace{\nobreak\hskip0.14em}
\renewcommand{\,}{\textormath{\posthinspace}{\mskip\thinmuskip}}
\renewcommand{\!}{\textormath{\negthinspace}{\mskip-\thinmuskip}}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%
%\begin{macro}{\lbrk}
%\begin{macro}{\rbrk}
%\begin{macro}{\lmqi}
%\begin{macro}{\rmqi}
%\begin{macro}{\lmqs}
%\begin{macro}{\rmqs}
%\begin{macro}{\mqi}
%\begin{macro}{\mqs}
%\begin{macro}{\Ladd}
%\begin{macro}{\LLadd}
%\begin{macro}{\ladd}
%\begin{macro}{\lladd}
%\begin{macro}{\lesp}
%\begin{macro}{\ldel}
% Philologists require a certain number of special parentheses in order to
% enclose parts of text that are doubtful or that have been added although
% they are missing from the original manuscripts; even letter strings that have
% been modified under the assumption that the copyist made some error.
% Such enclosing marks include angle brackets, square brackets, upper part
% of square brackets, lower part of square brackets. Such symbols may even
% appear doubled. Most if these glyphs have been designed anew, because they
% are missing or are inadequate if they are taken from the usual CM fonts (either
% text or math fonts). Brackets for example have been designed as to be higher
% and deeper than the font total height, so as not to interfere with Greek
% accents and to accomodate for at least one level of nesting (for example square brackets
% enclosing lower part of square brackets. The single glyphs may be used directly by
% the typesetter, but we think that the commands requiring some text are fare more useful.
% |\Ladd| and its double version |\LLadd| enclose text that should be added for sure.
% |\ladd| and its double version |\lladd| enclose text that probably should be added.
% |\lesp| and its synonymous |\ldel| enclose text that should be deleted.
% |\mqi| surrounds some text with the lower part of open and closed square brackets.
% |\mqs| surrounds some text with the upper part of open and closed square brackets.
% See \texttt{teubenr-doc.pdf} for samples of such commands.
%    \begin{macrocode}
\DeclareRobustCommand{\lbrk}{{\metricsfont\posthindspace[\negthinspace}}
\DeclareRobustCommand{\rbrk}{{\metricsfont]}}
\DeclareRobustCommand\lmqi{{\metricsfont!}}
\DeclareRobustCommand\rmqi{{\metricsfont:}}
\DeclareRobustCommand\lmqs{{\metricsfont?}}
\DeclareRobustCommand\rmqs{{\metricsfont;}}
\DeclareRobustCommand\mqi[1]{\posthinspace\lmqi\negthinspace
    {#1\/}\rmqi}\let\mezzeq\mqi
\DeclareRobustCommand\mqs[1]{\lmqs{#1\/}\rmqs}
\DeclareRobustCommand{\Ladd}[1]{{\metricsfont<}{\!\!#1\/}%
    {\metricsfont>}}%                           litterae certe addendae
\DeclareRobustCommand{\LLadd}[1]{{\metricsfont<\kern-.3ex<}%subst. \hskip with \kern
    {\!\!#1\/}{\metricsfont>\kern-.3ex>}}%     litterae certe addendae
\DeclareRobustCommand{\ladd}[1]{{\metricsfont\kern.15ex[\negthinspace}%
    {#1\/}{\metricsfont]\kern-.15ex}}%          litterae addendae
\DeclareRobustCommand{\lladd}[1]{{\metricsfont\kern.15ex[\kern-.3ex[%
    \negthinspace}{#1\/}{\metricsfont]\kern-.3ex]%
    \kern-.15ex}}%                              litterae addendae
\DeclareRobustCommand{\lesp}[1]%
    {\mbox{$\{\kern-.20ex$#1\kern.16ex$\}$}}%   litterae delendae
\let\ldel\lesp
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%
%\begin{macro}{\itopenquotes}
%\begin{macro}{\itclosedquotes}
%\begin{macro}{\itoq}
%\begin{macro}{\itcq} The following macros allow to set Italian\slash English
% high quotes even while typing in Greek; such quotes are standard in Italian
% and in English typesetting and their commands preserve the font family shape
% and series of the surrounding font. In French typography, as well in the
% typographic traditions of other countries, different quotes are used. In that case
% the typesetter must resort to a change of language, for example returning to German,
% inputting the German quotes, then turning back to Greek. He might as well define
% his own macros, or he might clone the following definitions and change them
% according to his country typographic traditions. If he decides to modify these
% definitions he should either rename this file or he should put his redefinitions
% in a private package to be input \emph{after} \texttt{teubner.sty}.
%    \begin{macrocode}
\DeclareTextCommand{\itopenquotes}{\GRencoding@name}%
    {{\fontencoding{OT1}\selectfont\char92}}%
\DeclareTextCommand{\itclosedquotes}{\GRencoding@name}%
    {{\fontencoding{OT1}\selectfont\char34}}%
\let\itoq\itopenquotes
\let\itcq\itclosedquotes
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%
%\begin{macro}{\GEodq}
%\begin{macro}{\GEcdq}
%\begin{macro}{\GEdqtext}
%\begin{macro}{\GEoq}
%\begin{macro}{\GEcq}
%\begin{macro}{\GEqtext}
%\begin{macro}{\ENodq}
%\begin{macro}{\ENcdq}
%\begin{macro}{\ENdqtext} On the opposite the following German and English quotes
% are redesigned and included in the metric symbols font. Since this font is in
% one shape and one series, these quotes do not change as the outside font does, but
% remains fixed; the most useful commands are |\GEdqtext| for enclosing some text
% within German double quotes, |\GEqtext| for enclosing some text within German single
% quotes, and |\ENdqtext| for enclosing some text in English double quotes. Apparently
% while setting Greek poetry in stacked, possibly enumerated, verses German double
% or single quotes are often used, since they cannot be misunderstood with Greek
% diacritical marks. Modern Greek double quotes apparently are not appreciated by
% philologists, at least outside Greece.
%    \begin{macrocode}
\newcommand\GEodq{\bgroup\futurelet\@tempA\GE@dq}
\def\GE@dq{{\metricsfont\char18}\ifx\@tempA m\posthinspace\fi\egroup}
\newcommand\GEcdq{{\metricsfont\char16}}
\newcommand\GEdqtext[1]{\GEodq\posthinspace#1\/\posthinspace\GEcdq}
\newcommand\GEoq{\bgroup\futurelet\@tempA\GE@q}
\def\GE@q{{\metricsfont\char13}\ifx\@tempA m\posthinspace\fi\egroup}
\newcommand\GEcq{{\metricsfont\char19}}
\newcommand\GEqtext[1]{\GEoq\posthinspace#1\/\posthinspace\GEcq}
\newcommand\ENodq{{\metricsfont\char16}}
\newcommand\ENcdq{{\metricsfont\char17}}
\newcommand\ENdqtext[1]{\ENodq\negthinspace#1\/\posthinspace\ENcdq}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%
% \begin{macro}{\LitNil}
% \begin{macro}{\litnil} The next synonymous macros indicate the \emph{littera nihil}.
%    \begin{macrocode}
\DeclareRobustCommand\LitNil{\textbullet}
\let\litnil\LitNil
%    \end{macrocode}
%\end{macro}
%\end{macro}
%
%\begin{macro}{\sva}
%\begin{macro}{\shva}
%\begin{macro}{\shwa} The CB fonts include also the letter ``shwa'', the glyph that
% appears as a roman ``e'' rotated 180$^\circ$ around its center. Philologists
% need it even when writing Greek. In order to make it available also when the
% Latin encodings are in force, suitable definitions have been given so that the
% suitable CB font is changed behind the scenes without any intervention by the
% typesetter.
%    \begin{macrocode}
\DeclareTextSymbol{\sva}{\GRencoding@name}{26}
\DeclareTextCommand\sva{OT1}{{\expandafter\fontencoding
    \expandafter{\GRencoding@name}\selectfont\sva}}
\DeclareTextCommand\sva{T1}{{\expandafter\fontencoding
    \expandafter{\GRencoding@name}\selectfont\sva}}
\let\shva\sva\let\shwa\sva
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%
%\begin{macro}{\skewstack} The |\skewstack| command stacks two arguments not one on
% top of the other, but the second argument is placed to the right and upwards relative
% to the first argument. The second argument is set in script font size. Although there are
% similarities with the |\textsuperscript| command, the exact placement of the second
% argument depends on the shape (height and depth) of both arguments. This command
% will be used for creating some philologist's symbols, but is readily available to the
% typesetter both for direct use and for writing macros defining new symbols.
%    \begin{macrocode}
\DeclareRobustCommand\skewstack[2]{{%
\edef\slant@{\expandafter\numero\the\fontdimen1\font}%
\setbox\z@\hbox{#1}\dimen@\ht\z@\box\z@
\kern-.045em\setbox\@ne\hbox{\scriptsize#2}%
\ifdim\dimen@>1.2ex\advance\dimen@-\ht\@ne\else
    \dimen@1ex\advance\dimen@-.5\ht\@ne\fi
\kern\slant@\dimen@\raise\dimen@\hbox{\box\@ne}}}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\hv}
%\begin{macro}{\qw}
%\begin{macro}{\gw}
%\begin{macro}{\gusv}
%\begin{macro}{\qusv}
%\begin{macro}{\qu} Matter of fact some common Latin stacked symbols are defined here in
% terms of |\skewstack|. As it may bee seen, the second argument (the first as well,
% but here there are no examples) may in turn contain other macros for composite symbols.
%    \begin{macrocode}
\DeclareRobustCommand\hv{{\fontencoding{OT1}\selectfont
    \skewstack{h}{v}}}
\DeclareRobustCommand\qw{{\fontencoding{OT1}\selectfont
    \skewstack{q}{w}}}
\DeclareRobustCommand\gw{{\fontencoding{OT1}\selectfont
    \skewstack{g}{w}}}
\DeclareRobustCommand\gusv{{\fontencoding{OT1}\selectfont
    \skewstack{g}{\semiv{u}}}}
\DeclareRobustCommand\qusv{{\fontencoding{OT1}\selectfont
    \skewstack{q}{\semiv{u}}}}
\DeclareRobustCommand\qu{{\fontencoding{OT1}\selectfont
    \skewstack{q}{u}}}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%
%\begin{macro}{\dz} Without using |\skewstack| other symbols may be defined;
% here |\dz| is just an example, where the kerning between `d' and `z' has
% been found by cut and try. With other glyphs may be other kernings
% are necessary.
%    \begin{macrocode}
\DeclareRobustCommand\dz{{\fontencoding{OT1}\selectfont d\kern-.33ex z}}
%    \end{macrocode}
%\end{macro}
%
% Now we come to another set of commands like the ones needed to mark the syneresis
% or the zeugma and other similar marks.
%\begin{macro}{\Utie} This first macro sets a ``smile'' symbol under a couple of
% letters. The glyph is fine but is good only for two adjacent letters, therefore
% it is necessary to have a stretchable symbol.
%    \begin{macrocode}
\DeclareRobustCommand\Utie[1]{%
\mbox{\vtop{\ialign{##\crcr
   \hfil#1\hfil\crcr
   \noalign{\kern.3ex\nointerlineskip}%
   \hfil$\smile$\hfil\crcr}}}}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\siner}
%\begin{macro}{\siniz} This is why the |\siner| and |\siniz| synonymous commands
% have been defined; in place of the ``smile'' symbol they contain a stretchable
% filler |\upfill| that behaves almost as the stretchable horizontal brace that is
% used in the definition of the \LaTeX\ commands |\underbrace| or |\overbrace|.
%    \begin{macrocode}
\DeclareRobustCommand{\siner}[1]{%
\mbox{\vtop{\ialign{##\crcr
   \hfil#1\hfil\crcr
   \noalign{\kern.6ex\nointerlineskip}%
   \upfill\crcr}}}}
\let\siniz\siner
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\upfill} The |\upfill| is defined as a leader, the same way as the
% corresponding \LaTeX\ stretchable horizontal brace; but as mentioned before we
% introduce a correction in case we are typesetting with pdf\LaTeX, because the
% pfb extensible math fonts, from wich the curved extremities are taken from, apparently
% do not have the actual dimension declared in the tmf files.
%    \begin{macrocode}
\def\upfill{$\m@th \scriptstyle\setbox\z@\hbox{$\scriptstyle\bracelu$}%
  \kern.16ex\bracelu\ifPDF\kern-.15ex\fi
  \leaders\vrule \@height\ifPDF.85\fi\ht\z@ \@depth\z@\hfill
  \braceru\kern.16ex$}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\downfill} The down fill arc is totally similar to the  up fill one, except
% for its terminating elements that change the shape of the arc from ``up'' to ``down''; we
% introduce the same correction as in |\upfill| for the same reasons.
%    \begin{macrocode}
\def\downfill{$\m@th\scriptstyle\setbox\z@\hbox{$\scriptstyle\braceld$}%
  \kern.16ex\braceld\ifPDF\kern-.15ex\fi
  \leaders\vrule \@height\ifPDF.85\fi\ht\z@ \@depth\z@\hfill
  \bracerd\kern.16ex$}
%    \end{macrocode}
%\end{macro}
% With both macros we could have edited the pfb files, but this would have required
% to distribute the corrected |cmex10.pfb| file together with the bundle, causing possible users
% to mess up their map of PostScript fonts. Of course the chosen solution has the
% opposite draw back: when and if the corrected pfb files will be distributed with each
% more or less complete \TeX\ bundle, then this file will require to be corrected again. But
% this is simple because it suffices to eliminate the whole |\ifPFB| business.
%
%\begin{macro}{\zeugma} Similarly |\zeugma| puts a stretchable arc over its
% argument; it must take into account the slant of the argument font so
% as to skew the placement of the arc.
%    \begin{macrocode}
\newcommand*\zeugma[1]{{\vbox{\setbox\z@\hbox{#1}\dimen@=\ht\z@
      \edef\@slant{\expandafter\numero\the\fontdimen1\font}%
      \dimen\tw@=\wd\z@
      \dimen@=\@slant\dimen@\ifmetricsfont\dimen@=\z@
        \advance\dimen\tw@-.5ex\fi
      \kern-.2ex\ialign{##\crcr
      \hbox to\z@{\ifmetricsfont\kern.25ex\fi\kern\dimen@
      \hbox to\dimen\tw@{\hss\downfill\kern.2\dimen@\hss}\hss}\crcr
      \noalign{\ifmetricsfont\kern.6ex
            \else\kern.4ex\fi\nointerlineskip}%
      \hfil{#1}\hfil\crcr}}}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\slzeugma}
%\begin{macro}{\rszeugma} Although the shape of oblique zeugma arcs cannot be
% changed depending on the width and height of the zeugma argument, in certain
% circumstances the philologists want to use oblique zeugma marks. This is why
% we defined a ``sloping zeugma arc'' |\slzeugma|, and a ``rising zeugma arc''
% |\rszeugma| that can be used with poor results, if such arcs are superimposed
% over the ``wrong'' letters. There is nothing automatic in the choice of the
% oblique arc and is totally on the typesetter responsibility to use the
% correct command.
%    \begin{macrocode}
\newcommand*\slzeugma[1]{{\leavevmode
    \setbox\tw@\hbox{\metricsfont\char120}%
    \setbox\z@\hbox{#1}\dimen@.5\wd\z@\advance\dimen@-.5\wd\tw@
    \edef\@slant{\expandafter\numero\the\fontdimen1\font}%
    \advance\dimen@\@slant\ht\z@
    \hbox to\z@{\kern\dimen@\box\tw@\hss}\box\z@
    }%
}
\newcommand*\rszeugma[1]{{\leavevmode
    \setbox\tw@\hbox{\metricsfont\char122}%
    \setbox\z@\hbox{#1}\dimen@.5\wd\z@\advance\dimen@-.5\wd\tw@
    \edef\@slant{\expandafter\numero\the\fontdimen1\font}%
    \advance\dimen@\@slant\ht\z@
    \hbox to\z@{\kern\dimen@\box\tw@\hss}\box\z@
    }%
}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%
%\begin{macro}{\nexus}
%\begin{macro}{\nesso}The same line of reasoning leads us to define two different
% commands for marking nexus relationships; since such commands are not synonymous
% we had to use the Latin and (arbitrarily) the Italian name to distinguish them.
% The difference is that |\nesso| covers the nexus with a leader made of ``Latin''
% circumflex signs (hats), while |\nexus| covers the nexus with a stretchable trapeze.
%    \begin{macrocode}
\newcommand*{\nexus}[1]{{\setbox\tw@\hbox{#1}%
        \edef\slant@{\expandafter\numero\the\fontdimen1\font}%
        \@tempdima=\slant@\ht\tw@\advance\@tempdima.45ex
        \setbox4\hbox to\wd\tw@{\hss\nexusfill\hss}
        \vbox{\ialign{##\crcr%
        \kern\@tempdima\box4
        \crcr
        \noalign{\kern.15ex\nointerlineskip}%
        \hfil{#1}\hfil\crcr}}}}
\newcommand*\nesso[1]{{\setbox\tw@\hbox{#1}%
        \edef\slant@{\expandafter\numero\the\fontdimen1\font}%
        \@tempdima=\slant@\ht\tw@\advance\@tempdima.9ex
        \ifdim\wd\tw@<1ex
            \setbox4\hbox{\metricsfont\kern-.5ex\Hat}%
        \else
            \setbox4\hbox to\wd\tw@{\hss\nexfill\hss}%
        \fi
        \vbox{\ialign{##\crcr%
        \kern\@tempdima\box4
        \crcr
        \noalign{\kern.15ex\nointerlineskip}%
        \hfil\box\tw@\hfil\crcr}}}}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\nexfill}
%\begin {macro}{\nexusfill}|\nexfill| is a leader made up of ``Latin'' circumflex
% signs; since the sign has a special meaning in mathematics, the definition
% of |\nexfill| requires the temporary change of the circumflex catcode. The
% command |\nexus|, on the opposite, requires another leader definition that
% contains the oblique sides of the trapeze. The latter were defined as glyphs
% in the Greek fonts. |\nexus| is supposed to be used \emph{only} while
% typesetting Greek text or poetry.
%    \begin{macrocode}
{\catcode`\^=12\relax\global\chardef\Hat`\^
\gdef\nexfill{{\metricsfont\leaders\hbox{^}\hfill}}}
%
\newdimen\Uunit
\def\nexusfill{\setbox\z@\hbox{\char16}%
    \Uunit=0.83333\p@
    \kern.16ex\char16\kern-.08ex
    \leaders\vrule\@height\z@\@depth\Uunit\hfill
    \kern.08ex\char17\kern.16ex}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%
%\begin{macro}{\coronis}
%\begin {macro}{\Coronis}
%\begin {macro}{\paragr}
% \begin {macro}{\dpar} While setting poetry it is necessary to mark the end of
% paragraphs, which do not necessarily coincide with the ends of stanzas. After
% the verse that concludes a logical paragraph philologists insert a mark called
% ``coronis'' (synonymous of paragraph, therefore the command |\paragr|) or
% a ``stronger'' mark called ``Coronis'', which differs from the common ``coronis''
% because it bears an  inverted semilunar sign on its left. Both marks are input
% by means of their respective commands |\paragr| (preferred to |\coronis|) or
% |\Coronis| inserted \emph{at the beginning of the paragraph terminating verse}.
% The command |\dparagr| inserts a double coronis mark, which is sometimes required
% in place of the ordinary single mark.
%    \begin{macrocode}
\def\C@rule{\vrule\@height.45ex\@depth-.35ex\@width1.5em}
\def\coronis@rule{\hbox to\z@{\hss\C@rule\hss}}
\def\Coronis@rule{\hbox to\z@
    {\hss\hbox to\z@{\hss$\scriptstyle)$\kern-1.5\p@}\C@rule\hss}}
\DeclareRobustCommand\paragr{\raisebox{-1ex}[\z@][\z@]{\coronis@rule}}
\let\coronis\paragr
\DeclareRobustCommand\Coronis{\raisebox{-1ex}[\z@][\z@]{\Coronis@rule}}
\DeclareRobustCommand{\dparagr}%
    {\raisebox{-1.3ex}[\z@][\z@]{\coronis@rule}%
    \raisebox{-1.6ex}[\z@][\z@]{\coronis@rule}}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%
%\begin{macro}{\sinafia}
%\begin {macro}{\crux}
%\begin {macro}{\FinisCarmen}
%\begin {macro}{\apici}
%\begin {macro}{\positio}
%\begin {macro}{\Int}
%\begin {macro}{\star}
%\begin {macro}{\dstar}
%\begin {macro}{\tstar}
%\begin {macro}{\responsio} The next group of commands are intended to insert special
% symbols in the philological text; just the command |\apici| requires an argument,
% a block of text that shall be enclosed within straight vertical apices, irrespective
% of the font slant. The command |\FinisCarmen| although very descriptive, is long to
% type, therefore a shorter alias |\FinCar| has been defined. |\apex| was the initial
% name given to the command, but on a second time it was changed to |\positio|, and the
% latter should always be used in place of the former. For what concerns |\star| which is
% a standard \LaTeX\ math command, the original definition is saved in the service
% macro |\m@thst@r| and the command is redefined so as to perform as it should both in
% text and in math mode. The symbol $\int$, on the contrary, was redefined so as not
% to mix math with text, even if its rendering resorts to mathematics.
%    \begin{macrocode}
\DeclareRobustCommand*\sinafia{{\metricsfont s}}
\DeclareRobustCommand*{\crux}{{\metricsfont\char'171}}
\DeclareRobustCommand*{\FinisCarmen}{\ensuremath{\otimes}}
\let\FinCar\FinisCarmen
\DeclareRobustCommand*{\apici}[1]%
    {\posthinspace{\metricsfont\char96}\negthinspace#1%
    \posthinspace{\metricsfont\char39}\negthinspace}
\DeclareRobustCommand*{\apex}%
    {\/\hskip.5ex\vrule\@height1.7ex\@depth-1ex\hskip.2ex}
\let\positio\apex
\DeclareRobustCommand*{\Int}{\ensuremath{\int}}
\let\m@thst@r\star
\DeclareRobustCommand*{\star}{\textormath{{{\upshape *}}}{\m@thst@r}}
\DeclareRobustCommand*{\dstar}{{\upshape **}}
\DeclareRobustCommand*{\tstar}{{\upshape ***}}
\DeclareRobustCommand*{\responsio}{{\boldmath\ensuremath{\sim}}}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%
%\begin{macro}{\thorn}
%\begin{macro}{\Thorn} |\thorn| and |\Thorn| are the exact equivalents of |\th| and |\Th|
% that ere defined only for the T1 encoding. Therefore such encoding is selected
% in an implicit way.
%    \begin{macrocode}
\DeclareRobustCommand{\thorn}{{\fontencoding{T1}\selectfont\th}}
\DeclareRobustCommand{\Thorn}{{\fontencoding{T1}\selectfont\TH}}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%
%\begin{macro}{\dracma}
%\begin {macro}{\hemiobelion}
%\begin {macro}{\tetartemorion}
%\begin {macro}{\stater}
%\begin {macro}{\denarius}
%\begin {macro}{\etos} This set of symbols, taken from the metrics symbol font
% (which by this time is evident does not contain only metrics symbols) represent
% the unit symbols of some coins of ancient Greece, as they were found on many
% ``ostraka'' in many archeological sites.
%    \begin{macrocode}
\DeclareRobustCommand{\dracma}{{\metricsfont D}}
\DeclareRobustCommand{\hemiobelion}{{\metricsfont A}}
\DeclareRobustCommand{\tetartemorion}{{\metricsfont B}}
\DeclareRobustCommand{\stater}{{\metricsfont C}}
\DeclareRobustCommand{\denarius}{{\metricsfont E}}
\DeclareRobustCommand{\etos}{{\metricsfont G}}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%
%\begin{macro}{\cut}
%\begin{macro}{\dcutbar}
%\begin{macro}{\bcutbar}
%\begin{macro}{\gcutbar} The following set of macros are all connected with the principal
% macro |\cut|, which should position a horizontal tie or bar across a certain number
% of latin letters, specifically `d', `b', and `g'; due to their different shapes, such
% bars are of different length and located at different heights; if they are in italics
% the bar position must change again. Therefore even if the user command |\cut| is the
% same for all these letters, its action must change depending on different circumstances.
% It merely checks its argument (it must be \emph{one} letter and unpredictable results
% are obtained if more that one token is passed as argument to |\cut|) and selects the
% proper bar. The specific bar commands |\dcutbar|, |\bcutbar|, and |\gcutbar|, are
% defined in such a way as to cope only with the their initial letter.
%    \begin{macrocode}
\DeclareRobustCommand{\cut}[1]{%
    \ifx#1d\dcutbar\else
        \ifx#1b\bcutbar\else
            \ifx#1g\gcutbar
            \fi
        \fi
    \fi}
%
\def\dcutbar{{\edef\slant@{\expandafter\numero\the\fontdimen1\font}%
    d\dimen@1.2ex\kern\slant@\dimen@
    \llap{\vrule\@height1.3ex\@depth-\dimen@
    \ifdim\slant@\p@>\z@\@width.35em\else\@width.4em\fi\kern.03em}}}
\def\bcutbar{{\edef\slant@{\expandafter\numero\the\fontdimen1\font}%
    \rlap{\dimen@1.2ex\kern\slant@\dimen@
    \ifdim\slant@\p@=\z@\kern.03em\fi
    \vrule\@height1.3ex\@depth-\dimen@
    \ifdim\slant@\p@>\z@\@width.3em\else\@width.4em\fi}b}}
\def\gcutbar{{\edef\slant@{\expandafter\numero\the\fontdimen1\font}%
    \ifdim\slant@\p@>\z@
        g\kern-.55ex\dimen@.2ex\kern-\slant@\dimen@
        \vrule\@height-.1ex\@depth\dimen@\@width.6ex
    \else
        \dimen@.2ex\kern\slant@\dimen@\vrule\@height.3ex\@depth-\dimen@
        \@width.6ex\kern-.55ex\relax g
    \fi}}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%
%\begin{macro}{\OSN} The next macro is just a shortcut instead of using
% |\oldstylenums|. We do not remember why we defined a whole command, instead
% of just |\let|ting the new control sequence be a synonym for the existing
% one.
%    \begin{macrocode}
\newcommand*{\OSN}[1]{\oldstylenums{#1}}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\splus}
%\begin{macro}{\stimes}
%\begin{macro}{\kclick}
% The next three macros are used in glottology; the first two ones are used to
% mark special pronunciations of the sibilant, while the last one is used to mark
% a special pronunciation of the guttural that produces a ``click''.
%\begin{macrocode}
\newcommand\splus{\leavevmode{%
    \edef\slant@{\expandafter\numero\the\fontdimen1\font}%
    \setbox\z@\hbox{s}%
    \dimen@=\wd\z@
    \setbox\tw@\hbox{$\scriptscriptstyle+$}%
    \advance\dimen@.35\ht\tw@
    \raisebox{\dimen@}[\z@][\z@]{%
        \makebox[\z@][l]{\kern.5\wd\z@
         \kern\slant@\dimen@\kern-.5\wd\tw@\box\tw@}}%
    \box\z@}}%
\newcommand\stimes{\leavevmode{%
    \edef\slant@{\expandafter\numero\the\fontdimen1\font}%
    \setbox\z@\hbox{s}%
    \dimen@=\wd\z@
    \setbox\tw@\hbox{$\scriptscriptstyle\times$}%
    \advance\dimen@.2\ht\tw@
    \raisebox{\dimen@}[\z@][\z@]{%
        \makebox[\z@][l]{\kern.5\wd\z@
            \kern\slant@\dimen@\kern-.5\wd\tw@\box\tw@}}%
    \box\z@}}%
\newcommand\kclick{\leavevmode{%
    \edef\slant@{\expandafter\numero\the\fontdimen1\font}%
    \setbox\z@\hbox{k}%
    \setbox\tw@\hbox{\fontencoding\GRencoding@name\selectfont\s{v}}%
    \dimen@\wd\z@
    \ifdim\slant@\p@=\z@
        \advance\dimen@-.1\wd\z@\else\advance\dimen@\wd\tw@
    \fi
    k\makebox[\z@][r]{\unhcopy\tw@\kern.5\dimen@}%
    }}%
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}

%
%\begin {macro}{\verso}
%\begin{environment}{versi} Here we start with verse environments; we already explained
% we defined three new verse environments that typeset verses in ``in-line'' verses,
% ``numbered by five'' verses, and ``numbered by five and subnumbered'' verses.
% For the environment |versi| we first need a counter and a little macro for
% generating the short bar that has to receive the verse number as a ``limits''
% superscript.
%    \begin{macrocode}
%%%%%%%%%%%%%%%%%%%%%%%%%% verse environments
\newcounter{verso}\setcounter{verso}{0}
\newcommand{\smallvert}{\vrule\@height1ex}
%    \end{macrocode}
% Next we define the macro |\verso| that sets the small bar with the verse number on top.
% Since the initial numbering might be different from~1, |\verso| accepts an optional
% argument, which is intended to be the initial counter value. Since |\verso| steps up
% the counter a different action must be taken if the optional argument is present;
% in order to be able to reference such verse by means of the |\label|--|\ref| cross reference
% mechanism, this stepping up must be done by means of |\refstepcounter|; therefore we
% have to leave |\refstepcounter| outside the conditional code, and step down the counter
% by one unit only in case the initial value is specified.
%    \begin{macrocode}
\DeclareRobustCommand\verso[1][]{%
    \def\@tempA{#1}\ifx\@tempA\empty
    \else
        \setcounter{verso}{#1}\addtocounter{verso}{\m@ne}%
    \fi
    \refstepcounter{verso}%
    \ensuremath{\mathop{\smallvert}\limits^{\theverso}}%
    \space\ignorespaces
}
%    \end{macrocode}
% Now that the verse separation macro is ready we can define the environment; the required
% opening statement argument represents a short text whose width is taken as a measure
% for indentation, so that verses are typeset with a left margin that leaves out this
% short text. Substantially this environment is a \texttt{list} one, and the left
% margin variable width is totally similar to the one used in |thebibiography| environment.
% Also the |\makelabel| command has been modified accordingly.
%    \begin{macrocode}
\newenvironment{versi}[1]{%
\def\makelabel##1{##1}
\list{}{\settowidth\labelwidth{#1}\leftmargin\labelwidth
    \advance\leftmargin\labelsep}%
}{%
\endlist
}
%    \end{macrocode}
%\end{environment}
%\end{macro}
%
%\begin{environment}{Versi} The second environment |Versi| accepts an optional
% starting number in the opening, statement, whose default value is~1: verses are
% composed as in the standard \LaTeX\ |verse| environment (with one minor difference)
% except they are numbered in the left margin with a progression of five; only verse numbers
% that are integer multiples of five are displayed. The minor difference is that stanzas
% cannot be marked with a blank line in the input |.tex| file, as it is customary with
% the standard environment, but if a visual mark is desired, such as extra vertical
% space, it is necessary to resort to the optional spacing parameter that can be specified
% to the |\\| command. This environment uses the same verse counting counter, defined for
% use with the |versi| environment.
%\begin{macro}{\BreakVersotrue}
%\begin{macro}{\BreakVersofalse}
% For specific purposes it is necessary to have a boolean
% variable for allowing or prohibiting verses to split up at the end of line; the default is not
% to split.
%    \begin{macrocode}
\newif\ifBreakVersi
\BreakVersifalse
\newenvironment{Versi}[1][1]{%
    \setcounter{verso}{#1}%
%    \end{macrocode}
% an internal macro |\writ@verso| does not actually write out the complete, possibly
% numbered verse, but provides for checking that the verse counter contains a multiple of~5,
% and to write it out using old stile numbers; in case the number is not an integer multiple
% of~5 the number is written out as the |\empty| macro.
%\end{macro}
%\end{macro}
%    \begin{macrocode}
    \def\writ@verso{%
        \count255=\value{verso}\divide\count255by5\relax
        \multiply\count255by5\relax
        \advance\count255-\value{verso}%
        \ifnum\count255=\z@
            {\small\expandafter\oldstylenums\expandafter{\the\c@verso}}%
        \else
            \empty
        \fi}%
%    \end{macrocode}
% Since the |\\| command should provide the same functionality as the regular \LaTeX\
% command, while in this environment it should provide other functionalities, such as
% triggering the display of the verse number, It is necessary to define an intermediate
% command |\v@rscr|, that examines the possible optional arguments, such as the optional
% star or the brackets enclosing vertical spacing
%    \begin{macrocode}
    \def\\{\@ifstar{\v@rscr{\@M}}{\v@rscr{\z@}}}%
    \def\v@rscr##1{\@ifnextchar[{\wr@teverse{##1}}%
        {\wr@teverse{##1}[\z@]}}%
%    \end{macrocode}
% Finally the |\wr@teverse| macro does the actual typesetting of the verse. Notice that
% the environment opening statement and every succeeding previous verse starts an
% horizontal box where the contents of the current verse is stored. Therefore the first
% thing to do is to close the box with the |\egroup| command, then a line of text is
% output that contains a possibly empty box or the verse number and the command for
% stepping up the verse counter, followed by the verse box number~0 and an end of paragraph;
% in this way the |\\| operates always in vertical mode, contrary to what happens in the |verse|
% standard \LaTeX\ environment. Even in this environment the actual typesetting is done
% within a |list| environment, whose parameters are set differently from what they are
% in the |verse| environment. Notice in any case that the command |\wr@teverse| reopens
% the~0 box, so on the last verse, upon closing the environment, it is necessary to
% remember to close such box, whose contents is irrelevant and can be thrown away.
%
% I have experienced some problems in typesetting verses in two-column format; the column width
% might be too short for setting up verses even if verses are not that long, because
% in the left margin there must be room for the verse numbering; for homogeneity the spacing
% must conform also with the following environment \texttt{VERSI} that has a secondary
% verse numbering, therefore it can't be too small. The result is that there might be a test
% for controlling the two-column format, but I think that it is more useful for the typesetter
% to be able to switch on and off the possibility of breaking long verses on more lines.
% On two-column format in any case it is better to leave the right margin to coincide with
% the column right margin.
%    \begin{macrocode}
    \def\wr@teverse##1[##2]{\egroup
        \makebox[3em][r]{%
            \writ@verso\refstepcounter{verso}\kern1.5em}
            \ifBreakVersi
                  \begingroup\raggedright
                  \hyphenpenalty \@M
                  \unhbox\z@\par
                  \endgroup
            \else
                  \rlap{\box\z@}\par
            \fi
        \penalty##1\vskip##2\relax
        \setbox\z@\hbox\bgroup\ignorespaces}%
    \list{}{\itemsep\z@\parsep\z@
    \if@twocolumn
    \itemindent   -5.3em%
    \listparindent\itemindent
      \rightmargin\z@
      \advance\leftmargin 3.3em
    \else
     \itemindent   -1.5em%
    \listparindent\itemindent
     \rightmargin  \leftmargin
      \advance\leftmargin 1.5em
    \fi
    }%
    \item\leavevmode\setbox\z@\hbox\bgroup\ignorespaces
}{%
%    \end{macrocode}
% Upon closing it is necessary to activate the writing out of the last verse that is still
% in the~0 box, but since this box is immediately reopened, it is necessary to close it
% again before exiting the environment.
%    \begin{macrocode}
    \\%
    \egroup
    \endlist
}
%    \end{macrocode}
%\end{environment}
%
%\begin{environment}{VERSI} The third environment |VERSI| set verses in the traditional
% way, but numbers them with two different enumerations; the principal one is by
% multiples of five, while the secondary one counts by units, and may be turned on and off,
% or reset at will. We therefore need another counter for the secondary enumeration
% and commands for turning it on and off and for resetting the counter. We need also
% a new length and a new boolean variable in order to manage the secondary enumeration.
% The new length represents an indentation of those verses that do no have the secondary
% enumeration, while secondary enumerated verses are not indented. For \texttt{VERSI}
% there is the same possibility of turning on and off the possibility of breaking verses
% at the end of line as it happens for the environment \texttt{Versi}.
% \begin {macro}{\SubVerso}
% \begin {macro}{\NoSubVerso} Macro |\NoSubVerso| turns off the secondary enumeration;
% macro |\SubVerso| turns on the secondary enumeration, but it accepts an optional
% argument for resetting the secondary counter; the default value is~0; if no optional
% argument is specified, and therefore if the optional argument has its default value~0,
% no resetting is performed and the enumeration keeps going from the last contents of
% the secondary counter; if the first use of |\SubVerso| does not contain the optional
% argument, the secondary enumeration keep going from the old contents of the secondary
% counter which is unpredictable, depending upon the previous occurrences of the
% environment |VERSI|. The typesetter, therefore, must remember to specify the optional
% argument to |\SubVerso| the first time he uses it in this environment.
%    \begin{macrocode}
\newcounter{subverso} \setcounter{subverso}{0}
\newif\ifSubVerso
\newlength{\versoskip}
\newcommand*\NoSubVerso{\global\SubVersofalse
    \global\versoskip1.3em\ignorespaces}
\newcommand*\SubVerso[1][0]{\global\SubVersotrue
    \ifnum#1=0\else
        \setcounter{subverso}{#1}%
        \global\protected@edef\@currentlabel{\the\c@subverso}%
    \fi
    \global\versoskip.3em\ignorespaces}
%    \end{macrocode}
%\end{macro}
%\end{macro}
% The opening environment statement accepts an optional argument (default equals~1)
% which represents the primary enumeration starting number
%    \begin{macrocode}
\newenvironment{VERSI}[1][1]{%
    \setcounter{verso}{#1}%
%    \end{macrocode}
% We need two macros |\writ@verso| and |\writ@subverso|, that typeset the primary and
% secondary enumeration; the first one is similar to the one used in the |Versi| environment,
% while the second one has no special features except the conditional construct needed
% to check if the secondary enumeration has to be printed out.
%    \begin{macrocode}
    \def\writ@verso{%
        \count255=\value{verso}\divide\count255by5\relax
        \multiply\count255by5\relax
        \advance\count255-\value{verso}%
            \ifnum\count255=0\relax
            {\small\expandafter\oldstylenums\expandafter{\the\c@verso}}%
        \else
            \empty
        \fi}%
    \NoSubVerso
    \def\writ@subverso{%
        \ifSubVerso
            {\scriptsize\expandafter\oldstylenums
                \expandafter{\the\c@subverso}}%
        \fi}%
%    \end{macrocode}
% Similarly to the previous environment, the |\\| command must be redefined
% so as to perform more or less as the standard one, while doing all the necessary
% actions needed in this environment. It must check the presence of the optional star
% and of the optional vertical skip and it has to pass control to a service macro
% |\v@rscr| that does the actual job; actually it passes control to a third macro
% |\writ@verse| that effectively outputs the current verse.
%    \begin{macrocode}
    \def\\{\@ifstar{\v@rscr{\@M}}{\v@rscr{\z@}}}%
    \def\v@rscr##1{\@ifnextchar[{\writ@verse{##1}}%
        {\writ@verse{##1}[\z@]}}%
    \def\writ@verse##1[##2]{\egroup
        \makebox[1.5em][r]{\writ@verso\refstepcounter{verso}}%
        \makebox[1.5em][r]{\writ@subverso\refstepcounter{subverso}}%
        \kern1.5ex\hskip\versoskip
            \ifBreakVersi
                  \begingroup
                  \hyphenpenalty \@M
                  \unhbox\z@\par
                  \endgroup
            \else
                  \rlap{\box\z@}\par
            \fi
        \penalty##1\vskip##2\relax
        \setbox\z@\hbox\bgroup\ignorespaces}%
%    \end{macrocode}
% For the remaining part, the environment is a normal |list| environment with specific
% initial parameters.
%    \begin{macrocode}
    \list{}{\parsep\z@\itemsep\z@
    \if@twocolumn
    \itemindent   -5.3em%
    \listparindent\itemindent
      \rightmargin\z@
      \advance\leftmargin 3.3em
    \else
     \itemindent   -1.5em%
    \listparindent\itemindent
     \rightmargin  \leftmargin
      \advance\leftmargin 1.5em
    \fi
    }%
    \item\leavevmode\setbox\z@\hbox\bgroup\ignorespaces
}{%
%    \end{macrocode}
% The closing statement must output the last verse, which is still contained in
% box~0; since box~0 is automatically reopened, it must be closed again and its
% contents, of no significance now, can be lost upon closing the environment group.
%    \begin{macrocode}
    \\%
    \egroup\endlist
}
%    \end{macrocode}
%\end{environment}
%
% Now we start defining many things concerned with metrics; the metric symbol font
% has been developed mainly for this purpose. We start defining some macros for
% inputting specific symbols; many such macros have their own aliases in Latin.
%
%\begin{macro}{\lunga}
%\begin{macro}{\longa}
%\begin{macro}{\breve}
%\begin{macro}{\brevis}
%\begin{macro}{\bbreve}
%\begin{macro}{\bbrevis}
%\begin{macro}{\barbreve}
%\begin{macro}{\barbrevis}
%\begin{macro}{\barbbrev}
%\begin{macro}{\barbbrevis}
%\begin{macro}{\ubarbreve}
%\begin{macro}{\ubarbrevis}
%\begin{macro}{\ubarbbreve}
%\begin{macro}{\ubarbbrevis}
%\begin{macro}{\ubarsbreve}
%\begin{macro}{\ubarsbrevis}
%\begin{macro}{\ubrevelunga}
%\begin{macro}{\ubrevislonga} The following definitions are straightforward; a small
% comment on |\breve|: since it is also a math command in standard \LaTeX, its meaning
% is saved in a service macro |\br@ve| and the |\breve| macro is redefined taking into
% account whether the typesetting is being done in text or in math mode. The unusual
% letters that appear in the definitions of the various metric symbols have no mysterious
% meaning; they might have been specified by |\char|\meta{number}, but it seemed shorter
% to specify the corresponding letters that would occupy the same slots in literal fonts.
%    \begin{macrocode}
\DeclareRobustCommand\lunga{{\metricsfont l}}
\let\longa\lunga
\let\br@ve\breve
\DeclareRobustCommand\breve{\textormath{{{\metricsfont b}}}{\br@ve}}
\let\brevis\breve
\DeclareRobustCommand\bbreve{{\metricsfont c}}
\let\bbrevis\bbreve
\DeclareRobustCommand\barbreve{{\metricsfont  i}}
\let\barbrevis\barbreve
\DeclareRobustCommand\barbbreve{{\metricsfont j}}
\let\barbbrevis\barbbreve
\DeclareRobustCommand\ubarbreve{{\metricsfont d}}
\let\ubarbrevis\ubarbreve
\DeclareRobustCommand\ubarbbreve{{\metricsfont e}}
\let\ubarbbrevis\ubarbbreve
\DeclareRobustCommand\ubarsbreve{{\metricsfont f}}
\let\ubarsbrevis\ubarsbreve
\DeclareRobustCommand{\ubrevelunga}{{\metricsfont\char107}}
\let\ubrevislonga\ubrevelunga
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%
%\begin {macro}{\corona}
%\begin {macro}{\ElemInd}
%\begin {macro}{\coronainv}
%\begin {macro}{\catal}
%\begin {macro}{\ipercatal}
%\begin {macro}{\hiatus}
%\begin {macro}{\Hiatus}
%\begin {macro}{\X}
%\begin {macro}{\anceps}
%\begin {macro}{\banceps}
%\begin {macro}{\ancepsdbrevis}
%\begin {macro}{\aeolicbii}
%\begin {macro}{\aeolicbiii}
%\begin {macro}{\aeolicbiv} Similarly the following symbols have straightforward
% definitions. Only |\hiatus| and |\Hiatus| require a small explanation; |\hiatus|
% inserts a small capital `H' in superscript position; in a first moment it was
% chosen the solution of designing a specific sans serif glyph in superscript position
% directly in the metric symbol font (actually this symbol is still part of the font)
% but while testing it, Paolo Ciacchi observed that a regular  `H' with serifs was
% better looking than the sans serif counterpart. Therefore the definition was
% changes in order to use the current font upright shape; by specifying `H', it is
% irrelevant if the current one is a Latin font, and the letter is a capital 'h', or
% if the current one is a Greek font and the letter is a capital `eta'. |\Hiatus|
% displays the same symbol in a zero width box so that it does not occupy any
% horizontal space; it is useful wile writing down complicated metric sequences.
% Macro|\X| may be considered, thanks to its shape, a shortcut in place of the
% full name |\anceps|.
%    \begin{macrocode}
\DeclareRobustCommand\corona{{\metricsfont\char20}}
\let\ElemInd\corona
\DeclareRobustCommand\coronainv{{\metricsfont\char21}}
\DeclareRobustCommand\catal{{\metricsfont g}}
\DeclareRobustCommand\ipercatal{{\metricsfont h}}
\DeclareRobustCommand\hiatus{\textsuperscript{\upshape H}}
\DeclareRobustCommand\Hiatus{\makebox[\z@]{\hiatus}}
\DeclareRobustCommand\X{{\metricsfont X}}
\let\anceps\X
\DeclareRobustCommand\banceps{{\metricsfont Y}}
\DeclareRobustCommand\ancepsdbrevis{{\metricsfont Z}}
\DeclareRobustCommand{\aeolicbii}{{\metricsfont I}}
\DeclareRobustCommand{\aeolicbiii}{{\metricsfont J}}
\DeclareRobustCommand{\aeolicbiv}{{\metricsfont K}}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%
%\begin{macro}{\stripsl@sh}
%\begin{macro}{\2}
%\begin{macro}{\3}
%\begin{macro}{\4} Here we prepare for the definition of a very useful macro, |\newmetrics|
% that should ease quite a lot writing complicated and repetitive metric sequences.
% We shall define |\newmetrics| by means of the internal \LaTeX\ macro |\@namedef|
% which accepts a macro name containing any character, provided this name does not
% contain the initial back slash (if it does this back slash becomes part of the
% macro name; see the \TeX{}book where there is an example for the definition of |\\TeX|).
% Therefore we need a service macro |\stripsl@sh|that strips the first token from the control sequence, so that
% the na\"{\i}f user does not have to treat the new metrics control sequence differently
% from the control sequences it uses for example with |\newcommand|. Next we define
% three numeric control sequences that should be followed by the rest of the macro name.
% The na\"{\i}f user then can type in something like \verb*+\2iamb + in order to activate
% a macro whose name is formed by the tokens |2iamb|, which is normally impossible in
% \LaTeX. Notice, though, the compulsory space after the macro name.
%    \begin{macrocode}
\newif\ifmetricsfont\metricsfontfalse
\def\stripsl@sh#1{\expandafter\@gobble\string#1}
\def\2#1 {\csname2#1\endcsname}
\def\3#1 {\csname3#1\endcsname}
\def\4#1 {\csname4#1\endcsname}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\begin {macro}{\newmetrics} Here is the user macro |\newmetrics|,
% to be used just as |\newcommand|,
% except it accepts a macro name starting with one of the digits `2', `3', or `4', and sets
% the suitable boolean variable to true so that in a long metric sequence the metric font
% might be selected just once.
%    \begin{macrocode}
\newcommand\newmetrics[2]{%
    \expandafter\@namedef\expandafter{\stripsl@sh#1}%
        {{\metricsfonttrue#2}}%
}
%    \end{macrocode}
%\end{macro}
%\begin {macro}{\iam}
%\begin {macro}{\chor}
%\begin {macro}{\enopl}
%\begin {macro}{\4MACRO}
%\begin {macro}{\aeolchorsor}
%\begin {macro}{\hexam}
%\begin {macro}{\pentam}
%\begin {macro}{\2tr} Here some common metric sequences are defined; some define single
% measures, such as the `iambus' or the `choriambus', while some define complete verses such as the
% `hexameter' or the `pentameter'
%    \begin{macrocode}
\newmetrics\iam{\barbreve\lunga\breve\lunga}
\newmetrics\chor{\lunga\breve\breve\lunga}
\newmetrics\enopl{\breve\lunga\breve\breve\lunga\breve\breve\lunga}
\newmetrics{\4MACRO}{\lunga\lunga\lunga\lunga}
\newmetrics{\aeolchorsor}{\lunga\zeugma{\breve\breve}\breve
    \breve\zeugma{\breve\breve}}
\newmetrics{\hexam}{\lunga\breve\breve\lunga\breve\breve
    \lunga\breve\breve\lunga\breve\breve\lunga\breve\breve
    \lunga\lunga}
\newmetrics{\pentam}{\lunga\barbbreve\lunga\barbbreve\lunga\dBar
    \lunga\breve\breve\lunga\breve\breve\lunga}
\newmetrics{\2tr}{\lunga\breve\lunga\X\ \lunga\breve\lunga\X\ }
%    \end{macrocode}
% As it may be seen the definition of such metric sequences may contain almost
% anything; here |\zeugma| was used as well as \verb*+\ +, but almost every
% macro defined in the previous parts may be freely used.
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%
%\begin{macro}{\metricstack} |\metricstack| is a command similar to |\shortstack|
% used to stack something over something else; specifically the second argument
% over the third one; it was specifically designed for use while typesetting
% metric sequences, but actually there is nothing that forbids to use it with
% any base character (typeset in text LR mode) and any superscript character
% belonging to a math alphabet (which is being set in script--script style, not
% in script style, as it happens with |\shortstack|.
%    \begin{macrocode}
\DeclareRobustCommand*{\metricstack}[2]%
    {$\mathord{\mathop{\hbox{#1\rule{\z@}{1ex}}}%
    \limits^{\scriptscriptstyle\relax#2\relax}}$%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\svert} |\svert| is a short vertical rule that may be used, for example
% with |\metricstack| for putting a small number over a dividing vertical bar in metric
% sequences.
%    \begin{macrocode}
\newcommand*{\svert}{\vrule\@height.8ex\@depth.2ex\relax}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\textoverline} \LaTeX\ has macro |\underline| that can be used in both
% text and math mode; there is nothing similar for overlining, therefore we defined
% a new command for this task.
%    \begin{macrocode}
\DeclareRobustCommand*{\textoverline}[1]{%
      \leavevmode\vbox{\setbox\z@\hbox{#1}
      \ialign{##\crcr
      \hbox to\wd\z@{\hrulefill}\crcr
      \noalign{\kern.4ex\nointerlineskip}%
      \hfil\box\z@\hfil\crcr}}}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\verseskip}
%\begin {environment}{bracedmetrics} The environment |bracedmetrics| is used primarily
% for setting some metric sequences one atop the other, with a certain alignment
% and grouped together with a right brace. We need therefore a length name
% |\br@cedmetrics| for measuring the width of this large metrics sequence stack; we need
% a command |\verseskip| for inserting a blank space before, after or in the middle of a metric
% sequence, that more or less is as wide as an integer number of metric symbols,
% and, last but not least, the environment itself for typesetting this large object
% containing the said metric sequences; see the documentation file \texttt{teubner-doc.pdf}
% for examining some examples.
%    \begin{macrocode}
\newlength{\br@cedmetrics}
\newcommand*{\verseskip}[1]{{%
    \setbox\z@\hbox{\longa}\dimen@\wd\z@\leavevmode\hbox to#1\dimen@{}}%
}
\newenvironment{bracedmetrics}[1]{\def\Hfill{\leavevmode\hfill}%
\settowidth{\br@cedmetrics}{#1}%
\ifvmode\vskip1ex\fi
$\displaystyle\left.%
\vcenter\bgroup\hsize\br@cedmetrics\parindent\z@\parskip\z@
}{\egroup\right\}$}
%    \end{macrocode}
%\end{environment}
%\end{macro}
%
%\begin{macro}{\TRON}
%\begin{macro}{\GTRON}
%\begin{macro}{\TROF}
%\begin{macro}{\GTROF} Here there are some macros for turning on and off the tracing
% facilities of \TeX, that turn out to be useful while debugging; they are accessible
% also to the end user. Global settings must be turned on and off globally; local settings
% die out by themselves when a group is closed, but it is a good habit to explicitly
% turn them out regardless of groups. Attention that when the tracing facilities are
% on and a page ship out takes place, the |.log| file receives a lot of material, and the
% file gets very large.
%    \begin{macrocode}
\def\GTRON{\global\tracingcommands=\tw@ \global\tracingmacros=\tw@}
\def\GTROF{\global\tracingcommands=\z@ \global\tracingmacros=\z@}
\def\TRON{\tracingcommands=\tw@ \tracingmacros=\tw@}
\def\TROF{\tracingcommands=\z@ \tracingmacros=\z@}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%
% When typesetting Greek it may occur to specify numbers written out as Milesian numerals;
% the \texttt{greek} option to the \babel\ package defines a couple of macros for transforming
% explicit arabic numerals or counter contents as Milesian numerals. Since this package
% offers more possibilities in the choice of those ``non alphabetic'' characters used in the
% Milesian notation, such macros have to be redefined. On the occasion we changed some
% little internal details so as to make such macros a little faster and more robust.
%\begin{macro}{\Greeknumeral}
%\begin{macro}{\greeknumeral}
%\begin{macro}{\@ifStar}
%\begin{macro}{\grtoday}
% Both |\gereeknumeral| and |\Greeknumeral|, the latter producing
% upper case Greek numerals, while the former produces lower case ones, resort to a service
% macro |\gr@@numeral|. But the new definition accepts the starred version; without the star
% the digit value~6 is represented with a ``stigma'', while with the star that value is
% represented with a lowered ``digamma''. The upper case version requires intermediate
% macros before using |\MakeUppercase| on the result of converting lower to upper case
% Milesian value symbols. This means that |\gr@@numeral| may work only with lower case
% symbols.
% It turned out that the normal redefinition command |\renewcommand| produced fragile
% commands that broke out when used as arguments of other commands, specifically the Greek date
% was broken when it was passed as the argument to the |\date| command of the class \textsf{memoir};
% therefore I decided to redefine the |\@ifstar| macro into another |\@ifStar| one so as not to
% fiddle with \LaTeX\ kernel commands. I defined also the lowercase version of the |\grtoday| date,
% since the \babel\ package provides only the |\today| command with no control over the use of
% which type of numerals; |\grtoday| uses the lowercase Milesian numerals through the redefined
% |\greeknumeral| macro.
%    \begin{macrocode}
\def\@ifStar#1#2{\def\@tempA{#1}\def\@tempB{#2}\futurelet\@tempC\@testStar}
\def\@testStar{\ifx\@tempC*\bbl@afterelse\expandafter\@tempA\@gobble\else
      \bbl@afterfi\@tempB\fi}
\DeclareRobustCommand*{\Greeknumeral}{%
      \let\n@vanta\Coppa\let\n@vecento\Sampi
      \@ifStar{\Gr@@kn@meral}{\Gr@@knum@ral}}
\DeclareRobustCommand*{\greeknumeral}{%
      \let\n@vanta\varkoppa\let\n@vecento\sampi
    \@ifStar{\let\s@i\stigma\gr@@numeral}{\let\s@i\fLow\gr@@numeral}}
\def\Gr@@kn@meral#1{\let\s@i\Stigma
    \expandafter\MakeUppercase\expandafter{\gr@@numeral{#1}}}
\def\Gr@@knum@ral#1{\let\s@i\Digamma
    \expandafter\MakeUppercase\expandafter{\gr@@numeral{#1}}}
\def\grtoday{{\expandafter\greeknumeral\expandafter{\the\day}} % keep the space
\gr@c@month \space {\expandafter\greeknumeral\expandafter{\the\year}}}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\begin{macro}{\gr@@numeral} |\gr@@numeral| must do most of the processing; it must check
% that the argument is within the allowable range $1\sim999\,999$ and issue suitable
% warnings if not. On the other end if the number is within the correct range it must check
% in which decade it falls and must call other macros so as to produce the correct
% decimal digit~$\leftrightarrow$ Milesian symbol. Six such macros are needed because the
% allowable range contains at maximum six decimal places. Apparently Milesian symbology
% allows to go beyond one million, but Apostolos Syropoulos, who originally wrote the code
% thought (correctly) that Milesian numbers would not be used for ``acrobatic performances''
% but possibly for writing the Greek date with the AD year; six decimal places are
% more than enough for this purpose. |\gr@ill@value| was not redefined from
% Apostolos Syropoulos' \babel\ definition; it simply issues a warning message about
% the argument out of range. The presence of the primitive command |number|
% in these macros is for two purposes: (a) transforms a counter contents into a
% sequence of digits tokens, and (b) if the argument is already a digit string,
% it removes any leading zeros. No braces are present because this string is examined
% sequentially one digit at a time from the leading position to the least significant
% position; of course this means that the decimal zero is treated correctly even
% if Milesian symbols do not have the equivalent of a zero.
%    \begin{macrocode}
\def\gr@@numeral#1{%
  \ifnum#1<\@ne\space\gr@ill@value{#1}%
  \else
    \ifnum#1<10\relax\expandafter\gr@num@i\number#1%
    \else
      \ifnum#1<100\relax\expandafter\gr@num@ii\number#1%
      \else
        \ifnum#1<\@m\relax\expandafter\gr@num@iii\number#1%
        \else
          \ifnum#1<\@M\relax\expandafter\gr@num@iv\number#1%
          \else
            \ifnum#1<100000\relax\expandafter\gr@num@v\number#1%
            \else
              \ifnum#1<1000000\relax\expandafter\gr@num@vi\number#1%
              \else
                \space\gr@ill@value{#1}%
              \fi
            \fi
          \fi
        \fi
      \fi
    \fi
  \fi
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\gr@num@i}
%\begin{macro}{\gr@num@ii}
%\begin{macro}{\gr@num@iii}
%\begin{macro}{\gr@num@iv}
%\begin{macro}{\gr@num@v}
%\begin{macro}{\gr@num@vi} The next six macros transform single decimal digits into Milesian
% symbols.
% The argument to each macro is a single decimal digit; their positional value is determined
% by the calling macro that invokes a different transformation routine for every position.
% To the right of the least significant position there must be the symbol ``anwtonos'',
% similar to an apostrophe, while to the left of each most significant symbol whose
% value is greater than 999 there must be a ``katwtonos'' symbol, similar to a lowered
% and inverted apostrophe. Zeros are examined in all macros, except the one for ``units'',
% because their value cannot be printed but there still is the possibility that there are
% no more digits higher than zero, so that the anwtonos must be set.
% Macros |\n@vanta| and |\n@vecento| are set by the calling macros so as to be the
% correct lower or upper case `qoppa' or sampi' respectively.
%    \begin{macrocode}
\def\gr@num@i#1{%
  \ifcase#1\or a\or b\or g\or d\or e%
  \or \s@i\or z\or h\or j\fi
  \ifnum#1=\z@\else\anw@true\fi\anw@print}
\def\gr@num@ii#1{%
  \ifcase#1\or i\or k\or l\or m\or n%
  \or x\or o\or p\or \n@vanta\fi
  \ifnum#1=\z@\else\anw@true\fi\gr@num@i}
\def\gr@num@iii#1{%
  \ifcase#1\or r\or s\or t\or u\or f%
  \or q\or y\or w\or \n@vecento\fi
  \ifnum#1=\z@\anw@false\else\anw@true\fi\gr@num@ii}
\def\gr@num@iv#1{%
  \ifnum#1=\z@\else\katwtonos\fi
  \ifcase#1\or a\or b\or g\or d\or e%
  \or \s@i\or z\or h\or j\fi
  \gr@num@iii}
\def\gr@num@v#1{%
  \ifnum#1=\z@\else\katwtonos\fi
  \ifcase#1\or i\or k\or l\or m\or n%
  \or x\or o\or p\or \n@vanta\fi
  \gr@num@iv}
\def\gr@num@vi#1{%
  \katwtonos
  \ifcase#1\or r\or s\or t\or u\or f%
  \or q\or y\or w\or \n@vecento\fi
  \gr@num@v}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
% \begin{macrocode}
%</package>
%    \end{macrocode}
%
% \Finale
\endinput