summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/generic/babel-greek/babel-greek.dtx
blob: 9224df9769f787cf8538abc69ec55da4019cc28d (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
% \iffalse meta-comment
% !TEX encoding = UTF-8 Unicode
%
% Copyright 1989-2008 Apostolos Syropoulos, Johannes L. Braams
% and the authors listed elsewhere in this file. All rights reserved.
%
% This file is part of the babel-greek package.
% ---------------------------------------------
%
% 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
% and version 1.3 or later is part of all distributions of LaTeX
% version 2003/12/01 or later.
%
% This work has the LPPL maintenance status "maintained".
%
% The Current Maintainer of this work is Günter Milde <milde@users.sf.net>.
%
% Babel-greek is a contributed package providing support for the Greek
% language and script via the Babel system (http://www.ctan.org/pkg/babel).
%
% The list of derived (unpacked) files belonging to this work
% and covered by LPPL is defined by the unpacking script (babel-greek.ins)
% which is part of the package.
% \fi
% \CheckSum{1547}
%
% \iffalse
%    Tell the \LaTeX\ system who we are and write an entry on the
%    transcript.
%<*dtx>
\ProvidesFile{babel-greek.dtx}
%</dtx>
%<code>\ProvidesLanguage{greek}
%\fi
%\ProvidesFile{babel-greek.dtx}
        [2020/11/10 v1.10 Greek support for the babel system]
%\iffalse
%% File `babel-greek.dtx'
%% Greek language Definition File
%% Copyright © 1997, 2005 Apostolos Syropoulos, Johannes Braams
%% Copyright © 2013, 2019 Günter Milde
%
%% Please report errors to: Günter Milde <milde@users.sf.net>
%
%    This file is part of the babel-greek package, it provides the source
%    code for the greek language definition file. The original
%    version of this file was written by Apostolos Syropoulos.
%    It was then enhanced by adding code from kdgreek.sty from David
%    Kastrup <dak@gnu.org> with his
%    consent.
%<*filedriver>
\documentclass{ltxdoc}
% \usepackage{lmodern}
\usepackage[utf8]{inputenc}
\usepackage{hyperref}
\hypersetup{colorlinks=true,linkcolor=blue,urlcolor=blue,citecolor=black}
\newcommand*{\babel}{\textsf{babel}}
\newcommand*{\note}[1]{}
\newcommand*{\Lopt}[1]{\textsf{#1}}
\newcommand*{\file}[1]{\texttt{#1}}
\newcommand*{\pkg}[1]{\texttt{#1}}
\begin{document}
 \DocInput{babel-greek.dtx}
\end{document}
%</filedriver>
%\fi
% \GetFileInfo{babel-greek.dtx}
%
% \changes{greek-1.0b}{1996/07/10}{Replaced \cs{undefined} with
%    \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
%    with \LaTeX}
% \changes{greek-1.0b}{1996/10/10}{Moved the definition of
%    \cs{atcatcode} right to the beginning}
% \changes{greek-1.2}{1997/10/28}{Classical Greek is now a dialect}
% \changes{greek-1.2b}{1997/11/01}{Classical Greek is now called
%   ``Polutoniko'' Greek. The previous name was at least misleading}
% \changes{greek-1.2c}{1998/06/26}{This version conforms to version
%   2.0 of the CB fonts and consequently we added a few new
%   symbol-producing commands}
% \changes{greek-1.3a}{1998/07/04}{polutoniko is now an attribute to
%    Greek, no longer a `dialect'}
% \changes{greek-1.4}{2013/05/17}{new maintainer}
% \changes{greek-1.5}{2013/06/21}{bugfixes,
%    change some symbol macros to aliases,
%    LGR fixes via DeclareTextCommand instead of
%    extrasgreek/noextrasgreek definitions,
%    LICR macros in string definitions,
%    LGR font encoding not used with XeTeX/LuaTeX.}
% \changes{greek-1.5a}{2013/06/27}{``extraspolutonikogreek'' definition
%    was missing with Xe/LuaTeX.
%    Replaced non-printable literal character with ^^-notation.}
% \changes{greek-1.6}{2013/07/18}{fix \cs{@roman} and \cs{@Roman}
%    redefinition (thanks to Enrico Gregorio and Claudio Beccari),
%    load LICR macro definitions for Xe/LuaTeX.}
% \changes{greek-1.7}{2013/09/09}{Do not load euenc.def with XeTeX/LuaTeX.
%    Prevent re-loading lgrenc.def.}
% \changes{greek-1.7a}{2013/09/13}{bugfix: remove spurious ``fi''.}
% \changes{greek-1.7b}{2013/10/01}{bugfix: correct upcasing of babel strings
%    with Xe/LuaTeX.}
% \changes{babel-greek-1.8}{2013/11/27}{Rename to ``babel-greek.dtx''.
%    Restore compatibility with Xe/LuaTeX in 8-bit and Unicode mode.
%    Load ``euenc.def'' if EU1 or EU2 font encoding is detected.
%    New TextCommands ``greekscript'' and ``ensuregreek''.}
% \changes{babel-greek-1.8a}{2013/12/03}{Set `encodingdefault' in `greekscript'
%   to fix Greek in footnotes etc. with document language Greek.}
% \changes{babel-greek-1.9}{2014/07/20}{Added attribute for ancient Greek.
%   Load correct hyphenation patterns. Patch by Claudio Beccari.}
% \changes{babel-greek-1.9b}{2014/09/18}{Remove spurious whitespace from
%   `extrasgreek'  definition (report Eike Schmidt).
%   Use named macros instead of non-standard short accent macros for
%   psili and dasia.}
% \changes{babel-greek-1.9c}{2014/10/21}{Fix dummy hyphenation language names
%   (report/patch Ulrike Fischer).}
% \changes{babel-greek-1.9d}{2015/07/06}{uc-/lccode corrections from xgreek are now
%   in greek-euenc.def (the polyglossia version has bugs).}
% \changes{babel-greek-1.9e}{2015/11/27}{Fix bug in lccode-setting loop
%   (patch by Enrico Gregorio).}
% \changes{babel-greek-1.9f}{2016/02/04}{Support for standard
%   Unicode text encoding ``TU'' (new in fontspec v2.5a).}
% \changes{babel-greek-1.9g}{2016/09/07}{Babel 3.9i deprecated textlatin
%   and fixed latinencoding.}
% \changes{babel-greek-1.9h}{2019/07/11}{Move breathing composite commands
%   to textalpha.}
% \changes{babel-greek-1.9i}{2020/02/28}{Update test for Unicode fonts.
%   Fix accent in seename and alsoname.}
% \changes{babel-greek-1.9j}{2020/03/17}{Fix ampersand in math mode.}
% \changes{babel-greek-1.10}{2020/11/10}{Use TU as \cs{greekfontencoding}
%   for Xe/LuaTeX. TU is the default font encoding there since 2017/01/01.
%   PDF-string secure implementation of \cs{greeknumeral}
%   (taken from ``hyperref'').
%   Use zig-zagy \cs{textkoppa} for \cs{greeknumeral{90}}.
%   This is what it looked originally and what it looks
%   in current (not classical or medieval) Greek typography.
%   Load ``puenc-greek.def`` (from greek-fontenc_) if used with hyperref.}
%
% \title{Babel support for the Greek language}
% \author{Apostolos Syropoulos, Günter Milde}
% \maketitle
%
% Babel-greek is a contributed package providing support for the Greek
% language and script via the \href{http://www.ctan.org/pkg/babel}{Babel}
% system. See the \href{README.html}{README} file for an overwiew of the
% \pkg{babel-greek} package and links to requirements and related packages.
%
% The file \file{\filename}%
%  \footnote{
%   The file described in this section has version number \fileversion\
%   and was last revised on \filedate.
%   The original author is Apostolos Syropoulos, code from \file{kdgreek.sty}
%   by David Kastrup was used.}
% is the literate source for the Babel language definition file
% \file{greek.ldf}.
%
% \section{Requirements}
%
% Typesetting Greek with Babel requires (of course) the
% \href{http://www.ctan.org/pkg/babel}{Babel core}, support for Greek font
% encodings (\href{http://www.ctan.org/pkg/greek-fontenc}{greek-fontenc})
% and a \href{README.html#greek-text-fonts}{text font supporting the
% Greek script}.
%
% The \href{http://www.ctan.org/pkg/cbgreek-complete}{CB Greek fonts}
% created by \textsc{Claudio Beccari}\footnote{Apostolos Syropoulos
%   wishes to thank Claudio Beccari for his
%   patience, collaboration, comments and suggestions.}
% are a complete set of 8-bit TeX fonts matching \textsc{Knuth}'s
% Computer Modern.
% The package \pkg{\href{http://www.ctan.org/pkg/cbfonts-fd}{cbfonts-fd}}
% sets them up as Greek substitute for the Computer Modern and Latin Modern
% font families.
% The \pkg{\href{http://www.ctan.org/pkg/substitutefont}{substitutefont}}
% package can be used to set up Greek supplements for other
% font families (like Times or Palatino).
%
% The \href{http://ctan.org/pkg/lm}{Latin Modern} OpenType font that is the
% default font for XeTeX/LuaTeX does not support the Greek script. The user
% needs to set up an alternative font like CM Unicode, Linux Libertine or
% DejaVu with \pkg{\href{http://www.ctan.org/pkg/fontspec}{fontspec}}.
%
% \section{Usage}
%
%    To activate Greek support with babel, specify the option
%    \Lopt{greek}, either as global option or as option to the
%    \pkg{babel} package. Remember, that the \emph{last} language
%    option determines the document language, e.g.
%    \begin{verbatim}
%    \usepackage[greek,english]{babel}\end{verbatim}
%    activates support for Greek in an English document.
%    The default is modern ``monotonic'' Greek, while
%    \begin{verbatim}
%      \usepackage[english,greek]{babel}
%      \languageattribute{greek}{polutoniko}
%    \end{verbatim}
%    sets the document language to modern Greek with ``polytonic''
%    spelling and
%    \begin{verbatim}
%      \usepackage[english,greek]{babel}
%      \languageattribute{greek}{ancient}
%    \end{verbatim}
%    sets the document language to ancient Greek.
%
%    Both attributes may also be used as modifiers as in
%    \begin{verbatim}
%      \usepackage[greek.polutoniko,english]{babel}
%    \end{verbatim}
%    and similarly
%    \begin{verbatim}
%      \usepackage[greek.ancient,english]{babel}
%    \end{verbatim}
%
%    By default,
%    \pkg{babel-greek} activates the modern Greek monotonic hyphenation;
%    the attribute/modifier |polutoniko| activates the modern Greek
%    polytonic hyphenation and the attribute/modifier |ancient| activates
%    the ancient Greek hyphenation.  8-bit TeX and XeTeX require the
%    hyphenation patterns to be pre-loaded in the format file.
%    This is a limitation by TeX, common to all languages.
%    The LuaTeX engine loads hyphenation patterns on demand.
%
%  \DescribeMacro\selectlanguage
%  \DescribeMacro\foreignlanguage
% The Babel core provides two commands to switch the active language:
% The declaration |\selectlanguage{greek}| switches to the Greek language.
% The macro \verb|\foreignlanguage{greek}{<some text>}| sets its second
% argument in the Greek language. This is intended for short text parts.
% For details see the \href{http://www.ctan.org/pkg/babel}{Babel}
% documentation.
%
%    For backwards compatibility, ``polytonic'' spelling can also be
%    selected via the dummy language \Lopt{polutonikogreek}. In this
%    case, the language name \Lopt{polutonikogreek} must also be
%    used for language switches with |\selectlanguage| or
%    |\foreignlanguage|.  However, it is not possible to use
%    both options, \Lopt{greek} and \Lopt{polutonikogreek} in one document.
%
% \subsection{Input of Greek text}
%
% There are several alternatives to write Greek text.
% \begin{itemize}
%  \item With the packages \pkg{inputenc} and
%    \pkg{\href{http://www.ctan.org/pkg/greek-inputenc}{greek-inputenc}},
%    literal Greek characters can be input using the utf-8, iso-8859-7,
%    or macgreek encoding.
%
%    Literal input using the utf-8 encoding is also the standard input
%    method if compiling with the XeTeX and LuaTeX engines.
%
%  \item The Latin transliteration defined by the LGR font encoding
%    is explained in the file \file{\href{usage.pdf}{usage.pdf}}.
%
%   \item The package
%    \pkg{\href{http://www.ctan.org/pkg/greek-fontenc}{greek-fontenc}}
%    defines \emph{LaTeX internal character representation} (LICR) macros
%    for Greek letters and text symbols. It is required by \pkg{babel-greek},
%    so the |\textAlpha| \ldots |\textomega|
%    macros are a safe but cumbersome method to input Greek characters.
%
%  \item The \pkg{alphabeta} package bundled with
%    \href{http://www.ctan.org/pkg/greek-fontenc}{greek-fontenc} makes the
%    short macro names |\Alpha| \ldots |\omega| available in text mode, too.
% \end{itemize}
% The \href{http://www.ctan.org/pkg/greek-fontenc}{greek-fontenc} bundle
% has details and examples for all these input methods.
%
% \subsection{Greek vs. Latin script}
%    When switching the language to Greek, \pkg{babel-greek} ensures that the
%    Greek script is supported.
%    With 8-bit LaTeX, Greek text fonts use a non-standard
%    font encoding\footnote{LaTeX font encodings are described in
%    the \emph{LaTeX font guide} (fntguide.pdf).}
%    (LGR) that misses Latin letters. Latin characters in the source are
%    instead interpreted as a transcription for Greek characters.
%    The following macros allow the use of Greek vs. Latin script without
%    changing the active language.
%  \DescribeMacro\greekscript
%  \DescribeMacro\greektext
%    The \emph{TextCommand}\footnote{For a discussion of TextCommands, see
%    the \emph{LaTeX font guide} (fntguide.pdf), too.}
%    |\greekscript| switches to a font encoding
%    supporting the Greek script.
%    The declaration |\greektext| always switches the font encoding
%    to LGR. Both declarations do not change the active language.
%  \DescribeMacro\latintext
%    |\latintext| (defined by the Babel
%    core) can be used to switch back to an encoding supporting the Latin
%    script (deprecated since Babel 3.9i from March 2014).
%
%  \DescribeMacro\ensuregreek
%  \DescribeMacro\textgreek
%    The macros |\ensuregreek| and |\textgreek| take one argument
%    which is typeset using a font encoding supporting the Greek
%    script. While |\ensuregreek| only switches the
%    font encoding if required, |\textgreek| always uses the LGR font
%    encoding.
%  \DescribeMacro\textlatin
%    The Babel core defines a corresponding |\textlatin| macro
%    (deprecated in favour of |\ensureascii| in Babel 3.9i from March 2014).
%
%  \section{Greek numbering}
%
%    The Greek alphabetical numbering system, like the Roman one, is
%    still used in everyday life for short enumerations. Unfortunately
%    most Greeks don't know how to write Greek numbers bigger than 20 or
%    30. Nevertheless, in official editions of the last century and
%    beginning of this century this numbering system was also used  for
%    dates and numbers in the range of several thousands. Nowadays
%    this numbering system is primary used by the Eastern Orthodox
%    Church and by certain scholars. It is hence necessary to be able
%    to typeset any Greek numeral up to \hbox{999\,999}. Here are the
%    conventions:
%    \begin{itemize}
%    \item There is no Greek numeral for any number less than or equal
%      to $0$.
%    \item Numbers from $1$ to $9$ are denoted by letters alpha, beta,
%      gamma,  delta, epsilon, stigma, zeta, eta, theta, followed by a
%      mark similar to the mathematical symbol ``prime''. (Nowadays
%      instead of letter stigma the digraph sigma tau is used for number
%      $6$. Mainly because the letter stigma is not always available, so
%      people opt to write down the first two letters of its name as an
%      alternative. In our implementation we produce the letter stigma,
%      not the digraph sigma tau.)
%    \item Decades from $10$ to $90$ are denoted by letters iota,
%      kappa, lambda, mu, nu, xi, omikron, pi, qoppa, again followed by
%      the numeric mark. The qoppa used for this purpose has a special
%      zig-zag form, which doesn't resemble at all the original
%      `q'-like qoppa.
%    \item Hundreds from $100$ to $900$ are denoted by letters rho,
%      sigma, tau, upsilon, phi, chi, psi, omega, sampi, followed by the
%      numeric mark.
%    \item Any number between $1$ and $999$ is obtained by a group of
%      letters denoting the hundreds decades and units, followed by a
%      numeric mark.
%    \item To denote thousands one uses the same method, but this time
%      the mark is placed in front of the letter, and under the baseline
%      (it is inverted by 180 degrees). When a group of letters denoting
%      thousands is followed by a group of letters denoting a number
%      under $1000$, then both marks are used.
%    \end{itemize}
%
%    Using these conventions one obtains numbers up to \hbox{999\,999}.
%  \DescribeMacro{\greeknumeral}
%    The command |\greeknumeral| makes it possible to typeset Greek
%    numerals. There is also an
%  \DescribeMacro{\Greeknumeral}
%    ``uppercase'' version of this macro: |\Greeknumeral|.
%
%    Another system which was in wide use only in Athens, could
%    express any positive number. This system is implemented in
%    package |athnum|.
%
% \StopEventually{}
%
%  \section{Implementation}
%
%    The macro |\LdfInit| takes care of preventing that this file is
%    loaded more than once, checking the category code of the
%    \texttt{@} sign, etc.
% \changes{greek-1.0b}{1996/11/02}{Now use \cs{LdfInit} to perform
%    initial checks}
%    \begin{macrocode}
%<*code>
\LdfInit\CurrentOption{captions\CurrentOption}
%    \end{macrocode}
%    When the option \Lopt{polutonikogreek} was used, redefine
%    |\CurrentOption| to prevent problems later on.
%    \begin{macrocode}
\gdef\CurrentOption{greek}
%    \end{macrocode}
%
%    Hyphenation patterns:
%    When this file is read as an option, i.e. by the |\usepackage|
%    command, \texttt{greek} could be an `unknown' language in
%    which case we have to make it known.  So we check for the
%    existence of the three variants of the Greek language
%    |\l@greek|, |\l@monogreek|, and |l@ancientgreek| to see whether
%    we have to do something here.
% \changes{greek-1.9}{2014/07/20}{Support all 3 language (hyphenation)
%                                 variants.}
%    \begin{macrocode}
\ifx\l@greek\@undefined
  \@nopatterns{greek}
  \adddialect\l@greek 0\fi
\ifx\l@monogreek\@undefined
  \adddialect\l@monogreek 0\fi
\ifx\l@ancientgreek\@undefined
  \adddialect\l@ancientgreek 0\fi
\newcount\bbl@monogreek \bbl@monogreek=\l@monogreek
\newcount\bbl@polygreek \bbl@polygreek=\l@greek
\newcount\bbl@ancientgreek  \bbl@ancientgreek=\l@ancientgreek
%    \end{macrocode}
% The |\extrasgreek| macro is called when switching the language to Greek.
% We collect code for polytonic and ancient greek in the macros
% |extraspolutonikogreek| and |extrasancientgreek| and add it later to
% |extrasgreek|.
%    \begin{macrocode}
\addto\extrasgreek{\let\l@greek\bbl@monogreek\relax}
\addto\extraspolutonikogreek{\l@greek=\bbl@polygreek}
\addto\extrasancientgreek{\l@greek=\bbl@ancientgreek}
%    \end{macrocode}
%
%    Now we declare the |polutoniko| language attribute.
%    \begin{macrocode}
\bbl@declare@ttribute{greek}{polutoniko}{%
%    \end{macrocode}
%    This code adds the expansion of |\extraspolutonikogreek| to
%    |\extrasgreek| and changes the definition of |\today| for Greek
%    to produce polytonic month names (by re-defining |\gr@month|).
%    \begin{macrocode}
  \expandafter\addto\expandafter\extrasgreek
    \expandafter{\extraspolutonikogreek}%
  \let\captionsgreek\captionspolutonikogreek
  \let\gr@month\gr@c@month
%    \end{macrocode}
%    We need to take some extra precautions in order not to break
%    older documents which still use the old \Lopt{polutonikogreek}
%    pseuso-language option: language switching commands like
%    |\selectlanguage{polutonikogreek}|, call the
%    |extraspolutonikogreek| macro, set the language to |\l@polutonikogreek|
%    and use |\datepolutonikogreek| for |\today|. We define aliases:
% \changes{greek-1.3f}{1999/09/29}{Added some code to make older
%    documents work}
% \changes{greek-1.3g}{2000/02/04}{\cs{noextraspolutonikogreek} was
%    missing}
%    \begin{macrocode}
  \let\l@polutonikogreek\l@greek
  \let\datepolutonikogreek\dategreek
  \let\extraspolutonikogreek\extrasgreek
  \let\noextraspolutonikogreek\noextrasgreek
  }
%    \end{macrocode}
%    The |ancient| language attribute is used for classical Greek.
% \changes{greek-1.9}{2014/07/20}{Add support for ancient Greek.}
%    \begin{macrocode}
\bbl@declare@ttribute{greek}{ancient}{%
%    \end{macrocode}
%    This attribute adds the expansion of |\extraspolutonikogreek| and
%    |\extrasancientgreek| to |\extrasgreek| to set up support for
%    multi-accented characters and ancient hyphenation patterns.
%    Auto-strings (captions) are specific to ancient Greek while |\today|
%    uses modern polytonic month names (as there existed incompatible
%    sets of month names and no common calendar in ancient Greece.
%    \begin{macrocode}
  \expandafter\addto\expandafter\extrasgreek
    \expandafter{\extraspolutonikogreek}% multi-accented letters
  \expandafter\addto\expandafter\extrasgreek
    \expandafter{\extrasancientgreek}%
  \let\captionsgreek\captionsancientgreek
  \let\gr@month\gr@c@month % (modern) polytonic month names
  }
%    \end{macrocode}
%
% \section{Font setup}
%
% Typesetting Greek texts requires a font with Greek characters:
%
% For 8-bit LaTeX, this package uses fonts with the
% \href{http://www.ctan.org/pkg/greek-fontenc}{LGR font encoding}.
% With the XeTeX or LuaTeX engines and Unicode fonts, the user must ensure
% that the selected font contains the required glyphs.
% LGR-encoded fonts can also be used alongside Unicode fonts with XeTeX/LuaTeX
% to enable the input of Greek letters via the Latin transcription provided by
% this font encoding.
%
% \changes{greek-1.2a}{1997/10/31}{filename \file{lgrenc.def} now
%    lowercase}
% \changes{greek-1.4}{2013/05/17}{\file{lgrenc.def} moved to the
%    separate package `greek-fontenc'}
% \changes{greek-1.5}{2013/06/21}{LGR setup skipped with XeTeX/LuaTeX}
% \changes{greek-1.7}{2013/09/09}{Do not load euenc.def with XeTeX/LuaTeX
%    (too complicated to get it right).}
% \changes{greek-1.8}{2013/11/30}{Check for EU1/EU2 font encoding
%    instead of engine}
% \changes{babel-greek-1.9f}{2016/02/04}{Check also for TU font encoding.}
% \changes{babel-greek-1.9i}{2020/02/27}{Update check for Unicode fonts.}
% \changes{babel-greek-1.10}{2020/11/10}{Use TU with Xe/LuaTeX.}
%
% \DescribeMacro\greekfontencoding
% We test for available font encodings and set |\greekfontencoding|
% and the internal macro |\bbl@greek@fontencdef| with the name of the
% font definition file with Greek LICR macros.
% The default is LGR for 8-bit TeX engines and TU for Xe/LuaTeX.
% (TODO: The font encoding definition file was renamed to tuenc-greek.def
%  in \emph{greek-fontenc} 0.14 (2020-02-28).)
%    \begin{macrocode}
\ifdefined \UnicodeEncodingName % set by LaTeX for Unicode-aware engines
  \providecommand*{\greekfontencoding}{\UnicodeEncodingName}
  \providecommand*{\bbl@greek@fontencdef}{tuenc-greek}
\else
  \providecommand*{\greekfontencoding}{LGR}
  \providecommand*{\bbl@greek@fontencdef}{lgrenc}
\fi
%    \end{macrocode}
% Ensure that the Greek LICR macros are available:
%    \begin{macrocode}
\@ifl@aded{def}{\bbl@greek@fontencdef}{}
{% else
  \InputIfFileExists{\bbl@greek@fontencdef .def}{}{% else
    \bbl@error{Font support for the Greek script missing.\\
               babel-greek can't typeset Greek.\\
               Install the "greek-fontenc" package\\
               or use XeTeX/LuaTeX with polyglossia.}
              {I can't find the \bbl@greek@fontencdef .def file
               for the Greek fonts (encoding \greekfontencoding)}
    \@@end
  }
}
%    \end{macrocode}
% \begin{macro}{\greekscript}
%   The TextCommand |\greekscript| is a declaration that switches the font
%   encoding to |\greekfontencoding| if the current font encoding does not
%   provide a (typically empty) local variant.
% \changes{greek-1.8.1}{2013/12/03}{Set `encodingdefault' in `greekscript'
%   to fix Greek in titles, footnotes, etc. with document language Greek.}
%    \begin{macrocode}
\ProvideTextCommandDefault{\greekscript}{%
  \fontencoding{\greekfontencoding}\selectfont
      \def\encodingdefault{\greekfontencoding}}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\ensuregreek}
%   The TextCommand |\ensuregreek| sets it argument in |\greekfontencoding|
%   if the current font encoding does not provide a (typically empty) local
%   variant.
%    \begin{macrocode}
\ProvideTextCommandDefault{\ensuregreek}[1]{%
  \leavevmode{\greekscript #1}}
%    \end{macrocode}
% \end{macro}
%
% The package hyperref defines the PU font encoding which supports
% monotonic Greek. Load support for polytonic greek, archaic symbols,
% and the |\greekscript| and |\ensuregreek| TextCommands:
% \begin{macrocode}
\AtBeginDocument{
  \@ifl@aded{def}{puenc}{
    \makeatletter % required inside \AtBeginDocument
    \InputIfFileExists{puenc-greek.def}{}{% else
      \bbl@warning{I can't find the file puenc-greek.def from "greek-fontenc".}
    }
    \makeatother
  }{}
}
% \end{macrocode}
%
% \subsection{Fixes for the LGR font encoding}
%
%    \begin{macrocode}
\@ifl@aded{def}{lgrenc}{%
%    \end{macrocode}
%
% We redefine a few commands in the LGR encoding to work around problems
% because LGR is no \emph{standard text encoding} but has Greek letters in
% the places of Latin ones.
% The ampersand must work in text and math mode. We provide the text
% command |\textampersand| and re-define |\&| to use it in text mode.
% \changes{greekfdd-2.2c}{1999/04/05}{Fixed typos, \cs{textrademark}
%    misses a `t', \cs{copyright} should be \cs{textcopyright}}
% \changes{greekfdd-2.2d}{1999/04/25}{removed redefinition of \cs{\&}}
% \changes{greek-1.4}{2013/05/17}{moved here from \file{lgrenc.def} because
%    the definitions require the \texttt{\textbackslash latintext} macro
%    defined by Babel.}
% \changes{greek-1.5}{2013/05/27}{enable use of "textcomp" characters
%    for "textcopyright" and "textregistered" macros}
% \changes{greek-1.5}{2013/06/15}{\textbackslash & made TextCommand}
% \changes{babel-greek-1.9j}{2020/03/17}{Fix ampersand in math.}
%
%    \begin{macrocode}
  \ProvideTextCommand{\textcopyright}{LGR}{\ensureascii{\textcopyright}}
  \ProvideTextCommand{\textregistered}{LGR}{\ensureascii{\textregistered}}
  \ProvideTextCommand{\texttrademark}{LGR}{\ensureascii{\texttrademark}}
  \let\ltx@amp\&
  \ProvideTextCommandDefault{\textampersand}{\ltx@amp}
  \ProvideTextCommand{\textampersand}{LGR}{\ensureascii{\ltx@amp}}
  \DeclareRobustCommand{\&}{\ifmmode\ltx@amp\else\textampersand\fi}
  \ProvideTextCommand{\SS}{LGR}{\ensureascii{\SS}}
%    \end{macrocode}
%
%  \begin{macro}{\greek@roman}
%  \begin{macro}{\greek@Roman}
% \changes{greek-1.2e}{1999/04/16}{Moved redefinition of \cs{@roman}
%    back to the language specific file}
% \changes{greek-1.3d}{1999/08/27}{\cs{@roman} and \cs{@Roman} need to
%    be added to \cs{extraspolutonikogreek}}
% \changes{greek-1.3e}{1999/09/24}{\cs{@roman} and \cs{@Roman} need
%    \emph{not} be in \cs{extraspolutonikogreek} when they are already
%    in \cs{extrasgreek}}
% \changes{greek-1.5}{2013/06/15}{\cs{@roman} and \cs{@Roman} as TextCommands
%    (BUG: this extended the expansion problem to all languages!)}
% \changes{greek-1.6}{2013/07/19}{apply a patch by Enrico Gregorio.
%    Thanks to Claudio Beccari for testing and reporting.}
%
%    To prevent roman numerals being typeset in greek letters we need
%    to adopt the internal \LaTeX\ commands |\@roman| and
%    |\@Roman|. \emph{Up to version 1.5, the definition caused errors where
%    |\@roman| ends up in a situation where the argument needs to be expanded
%    (e.g. Roman page numbers in the ToC).}
%    \begin{macrocode}
  \def\@roman#1{\expandafter\ensureascii\expandafter{\romannumeral#1}}
  \def\@Roman#1{\expandafter\ensureascii\expandafter{%
                \expandafter\@slowromancap\romannumeral#1@}}
%    \end{macrocode}
%  \end{macro}
%  \end{macro}
%
%    Now we define two commands that switch
%    to the LGR font encoding. The Babel core defines corresponding commands
%    to switch to a Latin font encoding.
%
%  \begin{macro}{\greektext}
%    The declaration |\greektext| switches to LGR.
%    For shorter pieces of text the |\textgreek| macro should be
%    used.
%    \begin{macrocode}
  \DeclareRobustCommand{\greektext}{%
    \fontencoding{LGR}\selectfont
    \def\encodingdefault{LGR}}
%    \end{macrocode}
%  \end{macro}
%
%  \begin{macro}{\textgreek}
%    This command takes an argument which is then typeset using the
%    LGR font encoding. In order to avoid many encoding switches
%    it operates in a local scope.
% \changes{greek-1.0b}{1996/09/23}{Added a level of braces to keep
%    encoding change local}
% \changes{greek-1.3k}{2003/03/19}{Added \cs{leavevmode} as was done
%    with \cs{latintext}}
%    \begin{macrocode}
  \DeclareRobustCommand{\textgreek}[1]{\leavevmode{\greektext #1}}
%    \end{macrocode}
%  \end{macro}
%
%  \begin{macro}{\textol}
%    The \href{http://www.ctan.org/pkg/cbgreek-complete}{CB Greek fonts}
%    contain an outline family. In order to make it available,
%    we define the command |\textol|. (This font-specific macro does not
%    fit in a language defintion file is and only kept for backwards
%    compatibility.)
%    \begin{macrocode}
  \def\outlfamily{\usefont{LGR}{cmro}{m}{n}}
  \DeclareTextFontCommand{\textol}{\outlfamily}
}{} % End of LGR fixes.
%    \end{macrocode}
%  \end{macro}
%
% \section{Definitions for the Greek language}
%
% The next step consists in defining commands to switch to (and
% from) the Greek language.
%
%  \begin{macro}{\greekhyphenmins}
%    This macro is used to store the correct values of the hyphenation
%    parameters |\lefthyphenmin| and |\righthyphenmin|.
% \changes{greek-1.3h}{2000/09/22}{Now use \cs{providehyphenmins} to
%    provide a default value}
%    \begin{macrocode}
% Yannis Haralambous has suggested this value
\providehyphenmins{\CurrentOption}{\@ne\@ne}
%    \end{macrocode}
%  \end{macro}
%
% \changes{greek-1.1e}{1997/10/12}{Added caption name for proof}
% \changes{greek-1.3d}{1999/08/28}{Fixed typo, \texttt{bl'epe ep'ishc}
%    instead of \texttt{bl'pe ep'ishc}}
%
%  \begin{macro}{\captionsgreek}
%    The macro |\captionsgreek| defines all strings used in the
%    four standard document classes provided with \LaTeX.
% \changes{greek-1.3h}{2000/09/20}{Added \cs{glossaryname}}
% \changes{greek-1.3i}{2000/10/02}{The final sigma in all names appears
%    as `s' instead of `c'.}
% \changes{babel-greek-1.9i}{2020/02/27}{Fix accent in seename and alsoname.}
%    \begin{macrocode}
\addto\captionsgreek{%
  \def\prefacename{\textPi\textrho\acctonos\textomicron\textlambda
    \textomicron\textgamma\textomicron\textfinalsigma}%
  \def\refname{\textAlpha\textnu\textalpha
    \textphi\textomicron\textrho\acctonos\textepsilon\textfinalsigma}%
  \def\abstractname{\textPi\textepsilon\textrho\acctonos\textiota
    \textlambda\texteta\textpsi\texteta}%
  \def\bibname{\textBeta\textiota\textbeta\textlambda\textiota\textomicron
    \textgamma\textrho\textalpha\textphi\acctonos\textiota\textalpha}%
  \def\chaptername{\textKappa\textepsilon\textphi\acctonos\textalpha
    \textlambda\textalpha\textiota\textomicron}%
  \def\appendixname{\textPi\textalpha\textrho\acctonos\textalpha\textrho
    \texttau\texteta\textmu\textalpha}%
  \def\contentsname{\textPi\textepsilon\textrho\textiota
    \textepsilon\textchi\acctonos\textomicron\textmu\textepsilon
    \textnu\textalpha}%
  \def\listfigurename{\textKappa\textalpha\texttau\acctonos\textalpha
    \textlambda\textomicron\textgamma\textomicron\textfinalsigma{}
    \textSigma\textchi\texteta\textmu\acctonos\textalpha\texttau
    \textomega\textnu}%
  \def\listtablename{\textKappa\textalpha\texttau\acctonos\textalpha
    \textlambda\textomicron\textgamma\textomicron\textfinalsigma{}
    \textPi\textiota\textnu\acctonos\textalpha\textkappa\textomega\textnu}%
  \def\indexname{\textEpsilon\textupsilon\textrho\textepsilon
    \texttau\acctonos\texteta\textrho\textiota\textomicron}%
  \def\figurename{\textSigma\textchi\acctonos\texteta\textmu\textalpha}%
  \def\tablename{\textPi\acctonos\textiota\textnu\textalpha
    \textkappa\textalpha\textfinalsigma}%
  \def\partname{\textMu\acctonos\textepsilon\textrho\textomicron
    \textfinalsigma}%
  \def\enclname{\textSigma\textupsilon\textnu\texteta\textmu
    \textmu\acctonos\textepsilon\textnu\textalpha}%
  \def\ccname{\textKappa\textomicron\textiota\textnu\textomicron
    \textpi\textomicron\acctonos\textiota\texteta\textsigma\texteta}%
  \def\headtoname{\textPi\textrho\textomicron\textfinalsigma}%
  \def\pagename{\textSigma\textepsilon\textlambda\acctonos\textiota
    \textdelta\textalpha}%
  \def\seename{\textbeta\textlambda\acctonos\textepsilon\textpi\textepsilon}%
  \def\alsoname{\textbeta\textlambda\acctonos\textepsilon\textpi\textepsilon{}
    \textepsilon\textpi\acctonos\textiota\textsigma\texteta\textfinalsigma}%
  \def\proofname{\textAlpha\textpi\acctonos\textomicron
    \textdelta\textepsilon\textiota\textxi\texteta}%
  \def\glossaryname{\textGamma\textlambda\textomega\textsigma
    \textsigma\acctonos\textalpha\textrho\textiota}%
  }
%    \end{macrocode}
%  \end{macro}
% \changes{greek-1.2}{1997/10/28}{Added caption names for
%    \cs{polutonikogreek}}
% \changes{greek-1.3d}{1999/08/28}{Fixed typo, \texttt{bl'epe >ep'ishc}
%    instead of \texttt{bl'pe >ep'ishc}}
%
%  \begin{macro}{\captionspolutonikogreek}
%    For texts written in the $\pi o\lambda\upsilon\tau
%    o\nu\kappa\acute{o}$ (polytonic greek) the translations are
%    the same as above, but some words are spelled differently. For
%    now we just add extra definitions to |\captionsgreek| in order to
%    override the earlier definitions.
%    \begin{macrocode}
\let\captionspolutonikogreek\captionsgreek
\addto\captionspolutonikogreek{%
  \def\refname{\accpsili\textAlpha\textnu\textalpha
    \textphi\textomicron\textrho\accvaria\textepsilon\textfinalsigma}%
  \def\indexname{\textEpsilon\accdasia\textupsilon\textrho\textepsilon
    \texttau\acctonos\texteta\textrho\textiota\textomicron}%
  \def\figurename{\textSigma\textchi\accperispomeni\texteta\textmu\textalpha}%
  \def\headtoname{\textPi\textrho\accvaria\textomicron\textfinalsigma}%
  \def\alsoname{\textbeta\textlambda\acctonos\textepsilon\textpi\textepsilon{}
    \accpsili\textepsilon\textpi\acctonos\textiota\textsigma\texteta\textfinalsigma}%
  \def\proofname{\accpsili\textAlpha\textpi\acctonos\textomicron
    \textdelta\textepsilon\textiota\textxi\texteta}%
}
%    \end{macrocode}
%  \end{macro}
%
% \changes{babel-greek-1.9}{2014/07/20}{Added caption names for
%    \cs{ancientgreek}}
%
%  \begin{macro}{\captionsancientgreek}
%    For texts written in ancient Greek, we took
%    the translations from Apostolos Syropoulos' |xgreek| package. For
%    now we just add extra definitions to |\captionsgreek| in order to
%    override the earlier definitions.
%    \begin{macrocode}
\let\captionsancientgreek\captionsgreek
\addto\captionsancientgreek{%
  \def\prefacename{\textPi\textrho\textomicron\textomicron\acctonos\textiota\textmu
    \textiota\textomicron\textnu}%
  \def\refname{\accpsili\textAlpha\textnu\textalpha\textphi\textomicron\textrho
    \textalpha\accvaria\textiota}%
  \def\abstractname{\textPi\textepsilon\textrho\acctonos\textiota\textlambda\texteta
    \textpsi\textiota\textvarsigma}%
  \def\bibname{\textBeta\textiota\textbeta\textlambda\textiota\textomicron
    \textgamma\textrho\textalpha\textphi\acctonos\textiota\textalpha}%
  \def\chaptername{\textKappa\textepsilon\textphi\acctonos\textalpha\textlambda
    \textalpha\textiota\textomicron\textnu}%
  \def\appendixname{\textPi\textalpha\textrho\acctonos\textalpha\textrho\texttau
    \texteta\textmu\textalpha}%
  \def\contentsname{\textPi\textepsilon\textrho\textiota\textepsilon\textchi
    \acctonos\textomicron\textmu\textepsilon\textnu\textalpha}%
  \def\listfigurename{\textKappa\textalpha\texttau\acctonos\textalpha\textlambda
    \textomicron\textgamma\textomicron\textvarsigma{}
    \textsigma\textchi\texteta\textmu\acctonos\textalpha\texttau\textomega\textnu}%
  \def\listtablename{\textKappa\textalpha\texttau\acctonos\textalpha\textlambda
    \textomicron\textgamma\textomicron\textvarsigma{}
    \textpi\textiota\textnu\acctonos\textalpha\textkappa\textomega\textnu}%
  \def\indexname{\textEpsilon\accdasia\textupsilon\textrho\textepsilon\texttau
    \acctonos\texteta\textrho\textiota\textomicron\textnu}%
  \def\figurename{\textSigma\textchi\accperispomeni\texteta\textmu\textalpha}%
  \def\tablename{\textPi\acctonos\textiota\textnu\textalpha\textxi}%
  \def\partname{\textMu\acctonos\textepsilon\textrho\textomicron\textvarsigma}%
  \def\enclname{\textSigma\textupsilon\textnu\texteta\textmu\textmu
    \acctonos\textepsilon\textnu\textomega\textvarsigma}%
  \def\ccname{\textKappa\textomicron\textiota\textnu\textomicron\textpi
    \textomicron\acctonos\textiota\texteta\textsigma\textiota\textvarsigma}%
  \def\headtoname{\textPi\textrho\accvaria\textomicron\textvarsigma}%
  \def\pagename{\textSigma\textepsilon\textlambda\accvaria\textiota\textvarsigma}%
  \def\seename{\accdasiaoxia\textomicron\textrho\textalpha}%
  \def\alsoname{\accdasiaoxia\textomicron\textrho\textalpha{} \accdasia\textomega\textsigma
    \textalpha\acctonos\textupsilon\texttau\textomega\textvarsigma}%
  \def\proofname{\accpsili\textAlpha\textpi\acctonos\textomicron\textdelta\textepsilon
    \textiota\textxi\textiota\textvarsigma}%
  \def\glossaryname{\textGamma\textlambda\textomega\textsigma\textsigma
    \acctonos\textalpha\textrho\textiota\textomicron\textnu}%
 }
%    \end{macrocode}
%  \end{macro}
%
%  \begin{macro}{\gr@month}
% \changes{greek-1.1e}{1997/10/12}{Macro added}
%  \begin{macro}{\dategreek}
%    The macro |\dategreek| redefines the command |\today| to
%    produce greek dates. The name of the month is now produced
%    by the macro |\gr@month| since it is needed in the definition
%    of the macro |\Grtoday|.
% \changes{greek-1.1a}{1997/03/03}{Fixed typo, \texttt{Oktwbr'iou}
%    instead of \texttt{Oktobr'iou}}
% \changes{greek-1.1d}{1997/10/12}{Macro \cs{gr@month} now produces
%    the  name of the month}
% \changes{greek-1.2a}{1997/10/31}{Use \cs{edef} to define \cs{today}}
% \changes{greek-1.2b}{1998/03/28}{use \cs{def} instead of \cs{edef}}
%    \begin{macrocode}
\def\gr@month{%
  \ifcase\month\or
    \textIota\textalpha\textnu\textomicron\textupsilon\textalpha
      \textrho\acctonos\textiota\textomicron\textupsilon \or
    \textPhi\textepsilon\textbeta\textrho\textomicron\textupsilon
      \textalpha\textrho\acctonos\textiota\textomicron\textupsilon \or
    \textMu\textalpha\textrho\texttau\acctonos\textiota\textomicron\textupsilon
    \or \textAlpha\textpi\textrho\textiota\textlambda\acctonos\textiota
      \textomicron\textupsilon \or
    \textMu\textalpha\'"\textiota\textomicron\textupsilon \or
    \textIota\textomicron\textupsilon\textnu\acctonos\textiota
      \textomicron\textupsilon \or
    \textIota\textomicron\textupsilon\textlambda\acctonos\textiota
      \textomicron\textupsilon \or
    \textAlpha\textupsilon\textgamma\textomicron\acctonos\textupsilon
      \textsigma\texttau\textomicron\textupsilon \or
    \textSigma\textepsilon\textpi\texttau\textepsilon\textmu
      \textbeta\textrho\acctonos\textiota\textomicron\textupsilon \or
    \textOmicron\textkappa\texttau\textomega\textbeta
      \textrho\acctonos\textiota\textomicron\textupsilon \or
    \textNu\textomicron\textepsilon\textmu\textbeta
      \textrho\acctonos\textiota\textomicron\textupsilon \or
    \textDelta\textepsilon\textkappa\textepsilon\textmu\textbeta
      \textrho\acctonos\textiota\textomicron\textupsilon
  \fi
}
\def\dategreek{%
  \def\today{\number\day \space \gr@month\space \number\year}}
%    \end{macrocode}
%  \end{macro}
%  \end{macro}
%
%  \begin{macro}{\gr@c@greek}
% \changes{greek-1.2}{1997/10/28}{Added macro \cs{gr@cl@month}}
% \changes{greek-1.2}{1997/10/28}{Added macro
%    \cs{datepolutonikogreek}}
% \changes{greek-1.3a}{1997/10/28}{removed macro
%    \cs{datepolutonikogreek}}
%    \begin{macrocode}
\def\gr@c@month{%
  \ifcase\month\or
    \accpsili\textIota\textalpha\textnu\textomicron\textupsilon\textalpha
      \textrho\acctonos\textiota\textomicron\textupsilon \or
    \textPhi\textepsilon\textbeta\textrho\textomicron\textupsilon
      \textalpha\textrho\acctonos\textiota\textomicron\textupsilon \or
    \textMu\textalpha\textrho\texttau\acctonos\textiota\textomicron
      \textupsilon \or
    \accpsili\textAlpha\textpi\textrho\textiota\textlambda
      \acctonos\textiota\textomicron\textupsilon \or
    \textMu\textalpha\"'\textiota\textomicron\textupsilon \or
    \accpsili\textIota\textomicron\textupsilon\textnu
      \acctonos\textiota\textomicron\textupsilon \or
    \accpsili\textIota\textomicron\textupsilon\textlambda
      \acctonos\textiota\textomicron\textupsilon \or
    \textAlpha\accpsili\textupsilon\textgamma\textomicron\acctonos
      \textupsilon\textsigma\texttau\textomicron\textupsilon \or
    \textSigma\textepsilon\textpi\texttau\textepsilon\textmu\textbeta
      \textrho\acctonos\textiota\textomicron\textupsilon \or
    \accpsili\textOmicron\textkappa\texttau\textomega\textbeta
      \textrho\acctonos\textiota\textomicron\textupsilon \or
    \textNu\textomicron\textepsilon\textmu\textbeta
      \textrho\acctonos\textiota\textomicron\textupsilon \or
    \textDelta\textepsilon\textkappa\textepsilon\textmu
      \textbeta\textrho\acctonos\textiota\textomicron\textupsilon
  \fi
}
%    \end{macrocode}
%  \end{macro}
%
%  \begin{macro}{\Grtoday}
% \changes{greek-1.1}{1996/10/28}{Added macro \cs{Grtoday}}
%    The macro |\Grtoday| produces the current date, only that the
%    month and the day are shown as greek numerals instead of arabic
%    as it is usually the case.
%    \begin{macrocode}
\def\Grtoday{%
  \expandafter\Greeknumeral\expandafter{\the\day}\space
  \gr@c@month \space
  \expandafter\Greeknumeral\expandafter{\the\year}}
%    \end{macrocode}
%  \end{macro}
%
%  \begin{macro}{\extrasgreek}
%  \begin{macro}{\noextrasgreek}
%    The macro |\extrasgreek| will perform all the extra definitions
%    needed for the Greek language. The macro |\noextrasgreek| is used
%    to cancel the actions of |\extrasgreek|. For the moment these
%    macros switch the fontencoding (with 8-bit TeX) and the definition of
%    the internal macros |\@alph| and |\@Alph| because in Greek we do use
%    the Greek numerals.
% \changes{greek-1.5}{2013/06/21}{LGR not used with XeTeX/LuaTeX.}
% \changes{greek-1.8}{2013/11/27}{use font-encoding specific TextCommands.
%    Use EU1 or EU2 for Latin script if available}
%    \begin{macrocode}
\addto\extrasgreek{\greekscript}
\addto\noextrasgreek{\latintext}
%    \end{macrocode}
%    TODO restore previous font encoding.
%
%  \begin{macro}{\greeknumeral}
%    The command |\greeknumeral| needs to be \emph{fully} expandable
%    in order to get the right information in auxiliary
%    files. It should also be usable in PDF-strings.
%    Therefore we use the implementation from the \cs{HyPsd@GreekPatch}
%    in \href{https://ctan.org/pkg/hyperref}{hyperref}
%    (version 7.00e 2020-05-15).
% \changes{babel-greek-1.10}{2020/11/10}{PDF-string secure implementation
%    taken from ``hyperref'' (collaboration with Ulrike Fischer).}
%    \begin{macrocode}
\def\greeknumeral#1{%
  {\greekscript
  \bbl@greek@GreekNum\@firstoftwo{#1}}%
}
%    \end{macrocode}
%  \end{macro}
%  \begin{macro}{\Greeknumeral}
%    The command |\Greeknumeral| prints uppercase greek numerals.
%    \begin{macrocode}
\def\Greeknumeral#1{%
  {\greekscript
  \bbl@greek@GreekNum\@secondoftwo{#1}}%
}
%    \end{macrocode}
%  \end{macro}
%
%  \begin{macro}{\bbl@greek@ill@value}
%    When the argument of |\greeknumeral| has a value outside of the
%    acceptable bounds ($0 < x < 999999$) a warning will be issued
%    (and the argument be printed).
%    \begin{macrocode}
\def\bbl@greek@ill@value#1{%
  \PackageWarningNoLine{babel}{Illegal value (#1) for greeknumeral}%
  \@arabic{#1}%
}
%    \end{macrocode}
%  \end{macro}
%  \begin{macro}{\bbl@greek@GreekNum}
%  \begin{macro}{\bbl@greek@@GreekNum}
%  \begin{macro}{\bbl@greek@GreekNumI}
%  \begin{macro}{\bbl@greek@GreekNumII}
%  \begin{macro}{\bbl@greek@GreekNumIII}
%  \begin{macro}{\bbl@greek@GreekNumIV}
%  \begin{macro}{\bbl@greek@GreekNumV}
%  \begin{macro}{\bbl@greek@GreekNumVI}
%    The auxiliary macros provide the actual conversion.
%    They are taken from hyperref as well.
%    \begin{macrocode}
\def\bbl@greek@GreekNum#1#2{%
    \ifnum#2<\@ne
      \bbl@greek@ill@value{#2}%
    \else
      \ifnum#2<1000000 %
        \bbl@greek@@GreekNum#1{#2}%
      \else
        \bbl@greek@ill@value{#2}%
      \fi
    \fi
}
\def\bbl@greek@@GreekNum#1#2{%
  \ifnum#2<\@m
    \ifnum#2<10 %
      \expandafter\bbl@greek@GreekNumI
          \expandafter\@gobble\expandafter#1\number#2%
    \else
      \ifnum#2<100 %
        \expandafter\bbl@greek@GreekNumII
            \expandafter\@gobble\expandafter#1\number#2%
      \else
        \expandafter\bbl@greek@GreekNumIII
            \expandafter\@gobble\expandafter#1\number#2%
      \fi
    \fi
    \ifnum#2>\z@
      \textnumeralsigngreek
    \fi
  \else
    \ifnum#2<\@M
      \expandafter\bbl@greek@GreekNumIV\expandafter#1\number#2%
    \else
      \ifnum#2<100000 %
        \expandafter\bbl@greek@GreekNumV\expandafter#1\number#2%
      \else
        \expandafter\bbl@greek@GreekNumVI\expandafter#1\number#2%
      \fi
    \fi
  \fi
}
\def\bbl@greek@GreekNumI#1#2#3{%
  #1{%
    \ifnum#3>\z@
      \textnumeralsignlowergreek
    \fi
  }%
  \expandafter#2%
  \ifcase#3 %
    {}{}%
  \or\textalpha\textAlpha
  \or\textbeta\textBeta
  \or\textgamma\textGamma
  \or\textdelta\textDelta
  \or\textepsilon\textEpsilon
  \or\textstigmagreek\textStigmagreek
  \or\textzeta\textZeta
  \or\texteta\textEta
  \or\texttheta\textTheta
  \else
    {}{}%
  \fi
}
\def\bbl@greek@GreekNumII#1#2#3#4{%
  #1{%
    \ifnum#3>\z@
      \textnumeralsignlowergreek
    \fi
  }%
  \expandafter#2%
  \ifcase#3 %
    {}{}%
  \or\textiota\textIota
  \or\textkappa\textKappa
  \or\textlambda\textLambda
  \or\textmugreek\textMu
  \or\textnu\textNu
  \or\textxi\textXi
  \or\textomicron\textOmicron
  \or\textpi\textPi
  \or\textkoppa\textKoppa
  \else
    {}{}%
  \fi
  \bbl@greek@GreekNumI#1#2#4%
}
\def\bbl@greek@GreekNumIII#1#2#3#4#5{%
  #1{%
    \ifnum#3>\z@
      \textnumeralsignlowergreek
    \fi
  }%
  \expandafter#2%
  \ifcase#3 %
    {}{}%
  \or\textrho\textRho
  \or\textsigma\textSigma
  \or\texttau\textTau
  \or\textupsilon\textUpsilon
  \or\textphi\textPhi
  \or\textchi\textChi
  \or\textpsi\textPsi
  \or\textomega\textOmega
  \or\textsampigreek\textSampigreek
  \else
    {}{}%
  \fi
  \bbl@greek@GreekNumII#1#2#4#5%
}
\def\bbl@greek@GreekNumIV#1#2#3#4#5{%
  \bbl@greek@GreekNumI\@firstofone#1#2%
  \bbl@greek@@GreekNum#1{#3#4#5}%
}
\def\bbl@greek@GreekNumV#1#2#3#4#5#6{%
  \bbl@greek@GreekNumII\@firstofone#1#2#3%
  \bbl@greek@@GreekNum#1{#4#5#6}%
}
\def\bbl@greek@GreekNumVI#1#2#3#4#5#6#7{%
  \bbl@greek@GreekNumIII\@firstofone#1#2#3#4%
  \bbl@greek@@GreekNum#1{#5#6#7}%
}
%    \end{macrocode}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%
%  \begin{macro}{\greek@alph}
%  \begin{macro}{\greek@Alph}
%    In the previous release of this language definition the
%    commands |\greek@aplh| and |\greek@Alph| were kept just for
%    reasons of compatibility. Here again they become meaningful macros.
%    They are definited in a way that even page numbering with greek
%    numerals is possible. Since the macros |\@alph| and |\@Alph| will
%    lose their original meaning while the Greek option is active, we
%    must save their original value.
%    macros |\@alph|
%    \begin{macrocode}
\let\latin@alph\@alph
\let\latin@Alph\@Alph
%    \end{macrocode}
%    Then we define the Greek versions; the additional |\expandafter|s
%    are needed in order to make sure the table of contents will be
%    correct, e.g., when we have appendixes.
%    \begin{macrocode}
\def\greek@alph#1{\expandafter\greeknumeral\expandafter{\the#1}}
\def\greek@Alph#1{\expandafter\Greeknumeral\expandafter{\the#1}}
%    \end{macrocode}
%
%    Now we can set up the switching.
% \changes{greek-1.1a}{1997/03/03}{removed two superfluous @'s which
%    made \cs{@alph} undefined}
%    \begin{macrocode}
\addto\extrasgreek{%
  \let\@alph\greek@alph
  \let\@Alph\greek@Alph}
\addto\noextrasgreek{%
  \let\@alph\latin@alph
  \let\@Alph\latin@Alph}
%    \end{macrocode}
%  \end{macro}
%  \end{macro}
%
%
% \section{Character codes}
%
%    Greek letters drop diacritics (eccept dialytika and sub-iota) in
%    UPPERCASE. This is not cared for by the Unicode standard.
%    The file \file{greek-euenc.def} from \pkg{greek-fontenc}
%    contains the required |\lccode| and |\uccode| corrections from the
%    \pkg{xgreek} package by Apostolos Syropoulos.
% \changes{greek-1.5}{2013/06/21}{Support XeTeX/LuaTeX.}
% \changes{greek-1.9d}{2015/07/06}{uclc fixes not included in greek-euenc.def}
%
%    The LGR encoded fonts that are used to typeset Greek with 8-bit TeX
%    define ligatures for characters with diacritics. In order for this to
%    work, some characters need to be considered as letters. These
%    characters are |<|, |>|, |~|, |`|, |'|, |"| and
%    \verb=|=. Therefore, their |\lccode| is changed when Greek is in
%    effect. In order to let |\uppercase| give correct results, the
%    |\uccode| of these characters is set to a non-existing character
%    to make them disappear. Of course not all characters are needed
%    when typesetting ``modern'' $\mu o\nu o\tau o\nu
%    \iota\kappa\acute{o}$. In that case we only need the |'| and |"|
%    symbols which are treated in the proper way.
%
%  \begin{macro}{\greek@tilde}
% \changes{greek-1.0c}{1997/02/19}{Added command}
%    The Greek script uses a number of characters with more
%    than one accent. In LGR encoded fonts combined diacritics can be
%    obtained using Knuth's ligature mechanism (see usage.pdf).
%    Characters we need to have ligatures with are the tilde, the
%    acute and grave accent characters, the rough and smooth breathings,
%    the subscript, and the double quote character.
%    In text input the |~| is normally used to produce an
%    unbreakable space.
% \changes{greek-1.3k}{2003/04/10}{Make sure the character `!' is not
%    active during the definition of \cs{greek@tilde}}
% \changes{greek-1.4}{2013/05/17}{do not re-define the tilde accent macro:
%    it works as expected with \file{lgrenc.def} from \pkg{greek-fontenc}.}
%    \begin{macrocode}
\@ifl@aded{def}{lgrenc}{%
  \begingroup
    \@ifundefined{active@char\string!}{}{\catcode`!=12\relax}
    \catcode`\~=12%
    \lccode`\!=`\~%
    \lowercase{\def\x{\endgroup
        \def\greek@tilde{!}}\x}
%    \end{macrocode}
%  \end{macro}
%    In order to get correct hyphenation we need to set the lower case
%    code of a number of characters. The `v' character has a special
%    usage for the |cb| fonts: in fact this ligature mechanism detects
%    the end of a word and assures that a final sigma is typeset with
%    the proper sign wich is different from that of an initial or
%    medial sigma;  the  `v  'after  an  \textit{isolated} sigma fools
%    the ligature mechanism in order to typeset $\sigma$ in place of
%    $\varsigma$. Because of this we make sure its lowercase code is
%    not changed. For ``modern'' greek we have to deal only with |'|
%    and |"| and so things are easy.
% \changes{greek-1.1c}{1997/04/30}{fixed two typos}
% \changes{greek-1.1e}{1997/10/12}{Added lowercase code for v}
% \changes{greek-1.2}{1997/10/28}{Definitions for ``modern'' Greek are
%    now the definitions of ``Polutoniko'' Greek}
% \changes{greek-1.2}{1997/10/28}{Added lowercase codes for ``modern''
%    greek}
% \changes{greek-1.3e}{1999/09/24}{\cs{extrasgreek} and
%    \cs{extraspolutonikogreek} should be complementary}
% \changes{babel-greek-1.9}{2014/07/20}{Added lc codes for chars 128 to 255}
%    In order to process the suitable characters and in such a way that
%    hyphenation patterns work also with precomposed characters, it is
%    necessary to declare the lc code for all characters, that can be part
%    of a word. We do this in |\extrasgreek| because this is a feature of
%    the LGR font encoding (which is the same in all language variants).
%    This means that multi-accented characters are regarded parts of a word
%    (and not non-word characters) also in monotonic spelling.
% \changes{babel-greek-1.9e}{2015/11/27}{Fix bug in lccode-setting loop
%   (patch by Enrico Gregorio).}
%    \begin{macrocode}
  \addto\extrasgreek{%
    \babel@savevariable{\lccode`v}\lccode`v=`v%
    \babel@savevariable{\lccode`\'}\lccode`\'=`\'%
    \babel@savevariable{\lccode`\"}\lccode`\"=`\"%
    % ``high bit characters'': set in a loop and correct exceptions
    \@tempcnta=128%
    \@whilenum\@tempcnta<253\do{%
      \expandafter\babel@savevariable\expandafter{%
                         \expandafter\lccode\the\@tempcnta}%
      \lccode\@tempcnta=\@tempcnta
      \advance\@tempcnta\@ne
    }%
    % Fix non-word characters:
    \lccode151=0%
    \lccode155=0%
    \lccode159=0%
    \lccode199=0%
    % Fix capital letters:
    \lccode195=147% GREEK LETTER DIGAMMA
    \lccode219=240% GREEK CAPITAL LETTER IOTA WITH DIALYTIKA
    \lccode223=244% GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA
  }

  \addto\extraspolutonikogreek{%
    % \l@greek=\bbl@polygreek
    \babel@savevariable{\lccode`\<}\lccode`\<=`\<%
    \babel@savevariable{\lccode`\>}\lccode`\>=`\>%
    \babel@savevariable{\lccode`\~}\lccode`\~=`\~%
    \babel@savevariable{\lccode`\|}\lccode`\|=`\|%
    \babel@savevariable{\lccode`\`}\lccode`\`=`\`%
    }
%    \end{macrocode}
%    And in order to get rid of all accents and breathings when a
%    string is |\uppercase|d we also change a number of uppercase
%    codes.
% \changes{greek-1.1b}{1997/03/06}{Added setting of \cs{uccode}s
%    (after \file{kdgreek.sty})}
% \changes{greek-1.1e}{1997/10/12}{Added uppercase code for special
%    letter ``v''. Uppercase code for accents is now \texttt{9f},
%    instead of \texttt{ff}}
% \changes{greek-1.2}{1997/10/28}{Added uppercase codes for ``modern''
%    Greek. The old codes are now for ``Polutoniko'' Greek}
% \changes{greek-1.3e}{1999/09/24}{\cs{extrasgreek} and
%    \cs{extraspolutonikogreek} should be complementary}
% {\catcode`|=12\relax\gdef\indexbar{\cs{|}}}
% \changes{greek-1.3g}{1999/11/17}{uc code of \indexbar{} is now just
%    \indexbar{} to reflect recent changes in the cb fonts}
% \changes{greek-1.3i}{2000/10/02}{uc code of `v' is switched to V
%    so that mixed text appears correctly in headers.}
% \changes{greek-1.3j}{2001/02/03}{Because other languages might
%    make the caret active, we can't use the double caret notation
%    here}
%    \begin{macrocode}
  \addto\extrasgreek{%
    \babel@savevariable{\uccode`\"}\uccode`\"=`\"%
    \babel@savevariable{\uccode`\'}\uccode`\'=159% 159 == ^^9f
    }
  \addto\extraspolutonikogreek{%
    \babel@savevariable{\uccode`\~}\uccode`\~=159%
    \babel@savevariable{\uccode`\>}\uccode`\>=159%
    \babel@savevariable{\uccode`\<}\uccode`\<=159%
    \babel@savevariable{\uccode`\|}\uccode`\|=`\|%
    \babel@savevariable{\uccode`\`}\uccode`\`=159%
    }
%    \end{macrocode}
%    For this to work we make the character |^^9f| a shorthand that
%    expands to nothing. In order for this to work we need to make a
%    character look like |^^9f| in \TeX's eyes. The trick is to have
%    another character and assign it a different lowercase code. The
%    execute the macros needed in a |\lowercase| environment. Usually
%    the tilde |~| character is used for such purposes. Before we do
%    this we save it's original lowercase code to restore it once
%    we're done.
% \changes{greek-1.1b}{1997/03/06}{Added shorthand for \cs{char255}}
% \changes{greek-1.1e}{1997/10/12}{Shorthand is changed. Active
%    character is now \cs{char159}}
% \changes{greek-1.2a}{1997/10/31}{Need shorthand to exist for
%    ``monotoniko'' Greek, not ``polutoniko'' Greek}
% \changes{greek-1.3j}{2001/02/03}{Use the tilde as an alias for
%    character 159}
%    \begin{macrocode}
  \@tempcnta=\lccode`\~
  \lccode`\~=159
  \lowercase{%
    \initiate@active@char{~}%
    \declare@shorthand{greek}{~}{}}
  \lccode`\~=\@tempcnta
%    \end{macrocode}
% Add composite commands, so that the dialytika is kept or put on the
% following character of a diphthong with |\MakeUppercase|
% (see lgrdef.enc from the the greek-fontenc package for details).
% \changes{greek-1.4}{2013/05/17}{Add TextCompositeCommands for
%     ``uppercase diacritics''.}
% \changes{greek-1.5}{2013/05/27}{Bugfix: @hiatus->LGR@hiatus}
% \changes{greek-1.5a}{2013/07/02}{Replaced non-printable literal character
%     with ^^-notation (thanks to Heiko Oberdiek for the hint).}
% \changes{greek-1.9}{2014/07/20}{The |^^|-notation seems to require lower case
%     letters. |^^9F| failed.}
%    \begin{macrocode}
  \DeclareTextCompositeCommand{\"}{LGR}{^^9f}{\accdialytika}
  \DeclareTextCompositeCommand{\'}{LGR}{^^9f}{\LGR@hiatus}
  \DeclareTextCompositeCommand{\`}{LGR}{^^9f}{\LGR@hiatus}
%    \end{macrocode}
%
%    We can also make the tilde character itself expand to a tilde with
%    category code 12 to make the typing of texts easier.
% \changes{greek-1.1b}{1997/03/06}{Made tilde expand to a tilde with
%    \cs{catcode 12}.}
% \changes{greek-1.5a}{2013/06/27}{provide ``extraspolutonikogreek'' also
%    for Xe/LuaTeX.}
%    \begin{macrocode}
  \addto\extraspolutonikogreek{\languageshorthands{greek}}%
  \declare@shorthand{greek}{~}{\greek@tilde}
}{} % End of LGR-specific code.
%    \end{macrocode}
%  \end{macro}
%  \end{macro}
%
% \section{symbol name aliases}
%    For backwards compatibility, we keep aliases for a few symbols.
% \changes{greek-1.1c}{1997/03/10}{Added a couple of symbols, needed
%    for \cs{greeknumeral}}
% \changes{greek-1.1e}{1997/10/12}{Most symbols are removed and are
%    now defined in package grsymb}
% \changes{greek-1.2c}{1998/06/26}{Package grsymb has been eliminated
%   because the CB fonts v2.0 do not inlcude certain symbols and so
%   the remaining symbol definitions have been moved here}
% \changes{greek-1.5}{2013/06/11}{change symbol macros to aliases}
% \changes{greek-1.10}{2020/11/10}{Fix: \cs{qoppa} is the legacy name of
%   \cs{textkoppa} not \cs{textqoppa}!
%   Provide fallbacks for makros required for greek numerals
%   (added in greek-fontenc 1.0 2020-09-25).}
%    \begin{macrocode}
\providecommand*{\anwtonos}{\textdexiakeraia}
\providecommand*{\katwtonos}{\textaristerikeraia}
\providecommand*{\qoppa}{\textkoppa}
\providecommand*{\varqoppa}{\textqoppa}
\providecommand*{\stigma}{\textstigma}
\providecommand*{\sampi}{\textsampi}
\providecommand*{\Digamma}{\textDigamma}
\providecommand*{\ddigamma}{\textdigamma}
\providecommand*{\vardigamma}{\textvardigamma}
\providecommand*{\euro}{\texteuro}
\providecommand*{\permill}{\textperthousand}
%    \end{macrocode}
% TODO remove the following lines once greek-fontenc 1.0 is in common use.
%    \begin{macrocode}
\@ifl@aded{def}{lgrenc}{%
  \ProvideTextCommand{\textKoppa}{LGR}{\textkoppa}
  \ProvideTextCommand{\textmugreek}{LGR}{\textmu}
}{}
\ProvideTextCommand{\textmugreek}{\greekfontencoding}{\textmu}
%    \end{macrocode}
%
% \changes{greek-1.3l}{2004/02/19}{Commented these lines out as this
%    change has made it into \LaTeX{} itself.}
% \changes{greek-1.8}{2013/11/27}{Remove the redefintion of fnum@figure
%    and fnum@table.}
%
%    The macro |\ldf@finish| takes care of looking for a
%    configuration file, setting the main language to be switched on
%    at |\begin{document}| and resetting the category code of
%    \texttt{@} to its original value.
% \changes{greek-1.0b}{1996/11/02}{Now use \cs{ldf@finish} to wrap up}
%    \begin{macrocode}
\ldf@finish{\CurrentOption}
%</code>
%    \end{macrocode}
%
% \Finale
%\endinput
%% \CharacterTable
%%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%%   Digits        \0\1\2\3\4\5\6\7\8\9
%%   Exclamation   \!     Double quote  \"     Hash (number) \#
%%   Dollar        \$     Percent       \%     Ampersand     \&
%%   Acute accent  \'     Left paren    \(     Right paren   \)
%%   Asterisk      \*     Plus          \+     Comma         \,
%%   Minus         \-     Point         \.     Solidus       \/
%%   Colon         \:     Semicolon     \;     Less than     \<
%%   Equals        \=     Greater than  \>     Question mark \?
%%   Commercial at \@     Left bracket  \[     Backslash     \\
%%   Right bracket \]     Circumflex    \^     Underscore    \_
%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%%   Right brace   \}     Tilde         \~}
%%