summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/babel-greek/test-unicode-greek.tex
blob: e0e233f03d591741f6a6944284e30bc2ff7dd6a2 (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
\documentclass[a4paper]{article}
% \usepackage{textcomp}
\usepackage{hyperref,bookmark}
\usepackage{parskip}

\usepackage{fontspec}
\setmainfont{Linux Libertine O}
\setsansfont{Linux Biolinum O}
% \setmainfont{DejaVu Serif}
% \setmainfont{Droid Serif} % only monotonic Greek (subset of Greek and Coptic)

\usepackage[greek,english]{babel}
% \languageattribute{greek}{polutoniko}

\message{greek-euenc ist}
\makeatletter
\@ifl@aded{def}{greek-fontenc}{\message{geladen}}{\message{nicht geladen}}
\makeatother


\begin{document}


\section*{Greek support for Babel with XeTeX/LuaTeX}

The babel option «greek» activates the support for the Greek language
defined in the file «greek.ldf» (source «greek.dtx»).

Typesetting Greek texts requires a font containing Greek letters. With the
XeTeX or LuaTeX engines, the user must ensure that the selected font
contains the required glyphs (the default Latin Modern fonts miss them).
Examples for suitable fonts are the «Deja Vu», «Linux Libertine», or
«Free Serif» OpenType fonts.

\section{Language Switch}

The declaration \verb|\selectlanguage| switches between languages.

\begin{quote}
  \selectlanguage{greek}
  Τί φήις; Ἱδὼν ἐνθέδε παῖδ’ ἐλευθέραν
  τὰς πλησίον Νύμφας στεφανοῦσαν, Σώστρατε,
  ἐρῶν άπῆλθες εὐθύς;
\end{quote}

The command \verb|\foreignlanguage| sets its second argument in the language
specified as first argument. This is intended for short text parts like
\foreignlanguage{greek}{Βιβλιοθήκη}.

\section{Font Encoding}

Switching to a font encoding supporting the Greek script is possible without
switching the Babel language using the declarations \verb|\greekscript| (no
switch if the current encoding supports Greek script) or \verb|\greektext|
(always switch to LGR). The corresponding macros \verb|\ensuregreek| and
\verb|\textgreek| typeset their argument in a Greek-supporting font encoding.

With XeTeX or LuaTeX, declaring the LGR font encoding is optional.
The macros \verb|\greektext| and \verb|\textgreek| are
only defined, if the LGR font encoding is declared via the \texttt{fontenc}
package \emph{before} loading babel (see test-unicode-lgr.tex).

Every language switch to \texttt{greek} calls the \verb|\extrasgreek|
command which in turn calls \verb|\greekscript| to ensure a Greek-supporting
font encoding (LGR, EU1, or EU2). (For customization, you can add to or
redefine the \verb|\extrasgreek| command.)

The LGR font encoding does not support Latin characters. Therefore, the
Babel core defines the declaration \verb|\latintext| and the command
\verb|\textlatin| to switch to the T1 or OT1 font encoding or typeset the
argument using this encoding. \texttt{greek-fontenc} adds a test for EU1 and
EU2. At this point, the «latinencoding» is \latinencoding.

Every language switch from \texttt{greek} calls the \verb|\noextrasgreek|
command which in turn calls \verb|\latintext|. (For customization, you can
add to or redefine the \verb|\noextrasgreek| command.)

% don't change the font encoding.
Latin characters can be used in Greek text parts,
input via the Latin transcription defined in LGR is not possible.%
\footnote{%
  The \emph{xunicode} package provides with the \texttt{tipa} emulation an
  example how this could be achieved if really required.
  }

\begin{quote}
  \greekscript Φίλων τοῦ \textlatin{TeX} (ΕΦΤ) --
  \latintext Friends (\ensuregreek{F\'ilwn}) of TeX.%
  \footnote{Compare the printout to the similar example in test-greek.pdf.}
\end{quote}

\section{MakeUppercase, MakeLowercase}

Capital Greek letters have diacritics (except the dialytika and sub-iota) to
the left (instead of above) and drop them in uppercase, e.g.
\ensuregreek{μαΐστρος $\mapsto$ \MakeUppercase{μαΐστρος}}.

Tonos and dasia mark a \emph{hiatus} (break-up of a diphthong) if placed on
the first vowel of a diphtong ((άι, άυ, έι, ἄι, ἄυ, ἔι). A dialytika must be
placed on the second vowel if they are dropped. This does not work (yet?)
with Unicode literals (\foreignlanguage{greek}{\MakeUppercase{άι, άυ, έι,
ἄι, ἄυ, ἔι}}). (See section «hiatus» below for a test with LICR macros.)

The following subsections test MakeUppercase and MakeLowercase with all
characters defined in lgrenc.dfu:

\subsection{Greek and Coptic}

\newcommand{\GreekAndCoptic}{
ʹ͵ͺ; ΄ ΅Ά·ΈΉΊΌΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩΪΫϘϚϜϠ}
\newcommand{\greekandcoptic}{
άέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώϙϛϝϟϡ}

Characters of the Greek and Coptic Unicode Block:

\begin{quote}
  \GreekAndCoptic\\
  \greekandcoptic
\end{quote}

MakeUppercase:

\begin{quote}
  \MakeUppercase{\GreekAndCoptic}\\
  \MakeUppercase{\greekandcoptic}
\end{quote}

Letters upcased, diacritics except dialytika dropped. OK.

Ϡ (Sampi) $\mapsto$ \MakeUppercase{Ϡ} (Kappa) and
ϡ (sampi) $\mapsto$ \MakeUppercase{ϡ} (Rho) is a bug
in xgreek-fixes.def from the polyglossia package.
% This is fixed in xgreek.sty and reported to the polyglossia author.

MakeLowercase:

\begin{quote}
  \MakeLowercase{\GreekAndCoptic}\\
  \MakeLowercase{\greekandcoptic}
\end{quote}

The lowercase of Σ is σ (GREEK SMALL LETTER SIGMA).\footnote{%
With LICRs, it is \texttt{\textbackslash textautosigma}.}
The lowercase of Ϛ (GREEK LETTER STIGMA) is \MakeLowercase{Ϛ}.

% \newpage

\subsection{Greek extended}

Characters of the Greek extended Unicode block:

\selectlanguage{greek}
ἀ ἁ ἂ ἃ ἄ ἅ ἆ ἇ Ἀ Ἁ Ἂ Ἃ Ἄ Ἅ Ἆ Ἇ \\
ἐ ἑ ἒ ἓ ἔ ἕ     Ἐ Ἑ Ἒ Ἓ Ἔ Ἕ     \\
ἠ ἡ ἢ ἣ ἤ ἥ ἦ ἧ Ἠ Ἡ Ἢ Ἣ Ἤ Ἥ Ἦ Ἧ \\
ἰ ἱ ἲ ἳ ἴ ἵ ἶ ἷ Ἰ Ἱ Ἲ Ἳ Ἴ Ἵ Ἶ Ἷ \\
ὀ ὁ ὂ ὃ ὄ ὅ     Ὀ Ὁ Ὂ Ὃ Ὄ Ὅ     \\
ὐ ὑ ὒ ὓ ὔ ὕ ὖ ὗ   Ὑ   Ὓ   Ὕ   Ὗ \\
ὠ ὡ ὢ ὣ ὤ ὥ ὦ ὧ Ὠ Ὡ Ὢ Ὣ Ὤ Ὥ Ὦ Ὧ \\
ὰ ά ὲ έ ὴ ή ὶ ί ὸ ό ὺ ύ ὼ ώ     \\
ᾀ ᾁ ᾂ ᾃ ᾄ ᾅ ᾆ ᾇ ᾈ ᾉ ᾊ ᾋ ᾌ ᾍ ᾎ ᾏ \\
ᾐ ᾑ ᾒ ᾓ ᾔ ᾕ ᾖ ᾗ ᾘ ᾙ ᾚ ᾛ ᾜ ᾝ ᾞ ᾟ \\
ᾠ ᾡ ᾢ ᾣ ᾤ ᾥ ᾦ ᾧ ᾨ ᾩ ᾪ ᾫ ᾬ ᾭ ᾮ ᾯ \\
ᾰ ᾱ ᾲ ᾳ ᾴ   ᾶ ᾷ Ᾰ Ᾱ Ὰ Ά ᾼ ᾽ ι ᾿ \\
῀ ῁ ῂ ῃ ῄ   ῆ ῇ Ὲ Έ Ὴ Ή ῌ ῍ ῎ ῏ \\
ῐ ῑ ῒ ΐ     ῖ ῗ Ῐ Ῑ Ὶ Ί   ῝ ῞ ῟ \\
ῠ ῡ ῢ ΰ ῤ ῥ ῦ ῧ Ῠ Ῡ Ὺ Ύ Ῥ ῭ ΅ ` \\
    ῲ ῳ ῴ   ῶ ῷ Ὸ Ό Ὼ Ώ ῼ ´ ῾
\selectlanguage{english}

MakeUppercase:

\selectlanguage{greek}

\MakeUppercase{ ἀ ἁ ἂ ἃ ἄ ἅ ἆ ἇ Ἀ Ἁ Ἂ Ἃ Ἄ Ἅ Ἆ Ἇ }\\
\MakeUppercase{ ἐ ἑ ἒ ἓ ἔ ἕ     Ἐ Ἑ Ἒ Ἓ Ἔ Ἕ     }\\
\MakeUppercase{ ἠ ἡ ἢ ἣ ἤ ἥ ἦ ἧ Ἠ Ἡ Ἢ Ἣ Ἤ Ἥ Ἦ Ἧ }\\
\MakeUppercase{ ἰ ἱ ἲ ἳ ἴ ἵ ἶ ἷ Ἰ Ἱ Ἲ Ἳ Ἴ Ἵ Ἶ Ἷ }\\
\MakeUppercase{ ὀ ὁ ὂ ὃ ὄ ὅ     Ὀ Ὁ Ὂ Ὃ Ὄ Ὅ     }\\
\MakeUppercase{ ὐ ὑ ὒ ὓ ὔ ὕ ὖ ὗ   Ὑ   Ὓ   Ὕ   Ὗ }\\
\MakeUppercase{ ὠ ὡ ὢ ὣ ὤ ὥ ὦ ὧ Ὠ Ὡ Ὢ Ὣ Ὤ Ὥ Ὦ Ὧ }\\
\MakeUppercase{ ὰ ά ὲ έ ὴ ή ὶ ί ὸ ό ὺ ύ ὼ ώ     }\\
\MakeUppercase{ ᾀ ᾁ ᾂ ᾃ ᾄ ᾅ ᾆ ᾇ ᾈ ᾉ ᾊ ᾋ ᾌ ᾍ ᾎ ᾏ }\\
\MakeUppercase{ ᾐ ᾑ ᾒ ᾓ ᾔ ᾕ ᾖ ᾗ ᾘ ᾙ ᾚ ᾛ ᾜ ᾝ ᾞ ᾟ }\\
\MakeUppercase{ ᾠ ᾡ ᾢ ᾣ ᾤ ᾥ ᾦ ᾧ ᾨ ᾩ ᾪ ᾫ ᾬ ᾭ ᾮ ᾯ }\\
\MakeUppercase{ ᾰ ᾱ ᾲ ᾳ ᾴ   ᾶ ᾷ Ᾰ Ᾱ Ὰ Ά ᾼ ᾽ ι ᾿ }\\
\MakeUppercase{ ῀ ῁ ῂ ῃ ῄ   ῆ ῇ Ὲ Έ Ὴ Ή ῌ ῍ ῎ ῏ }\\
\MakeUppercase{ ῐ ῑ ῒ ΐ     ῖ ῗ Ῐ Ῑ Ὶ Ί   ῝ ῞ ῟ }\\
\MakeUppercase{ ῠ ῡ ῢ ΰ ῤ ῥ ῦ ῧ Ῠ Ῡ Ὺ Ύ Ῥ ῭ ΅ ` }\\
\MakeUppercase{     ῲ ῳ ῴ   ῶ ῷ Ὸ Ό Ὼ Ώ ῼ ´ ῾   }
\selectlanguage{english}

MakeLowercase:

\selectlanguage{greek}
\MakeLowercase{ ἀ ἁ ἂ ἃ ἄ ἅ ἆ ἇ Ἀ Ἁ Ἂ Ἃ Ἄ Ἅ Ἆ Ἇ }\\
\MakeLowercase{ ἐ ἑ ἒ ἓ ἔ ἕ     Ἐ Ἑ Ἒ Ἓ Ἔ Ἕ     }\\
\MakeLowercase{ ἠ ἡ ἢ ἣ ἤ ἥ ἦ ἧ Ἠ Ἡ Ἢ Ἣ Ἤ Ἥ Ἦ Ἧ }\\
\MakeLowercase{ ἰ ἱ ἲ ἳ ἴ ἵ ἶ ἷ Ἰ Ἱ Ἲ Ἳ Ἴ Ἵ Ἶ Ἷ }\\
\MakeLowercase{ ὀ ὁ ὂ ὃ ὄ ὅ     Ὀ Ὁ Ὂ Ὃ Ὄ Ὅ     }\\
\MakeLowercase{ ὐ ὑ ὒ ὓ ὔ ὕ ὖ ὗ   Ὑ   Ὓ   Ὕ   Ὗ }\\
\MakeLowercase{ ὠ ὡ ὢ ὣ ὤ ὥ ὦ ὧ Ὠ Ὡ Ὢ Ὣ Ὤ Ὥ Ὦ Ὧ }\\
\MakeLowercase{ ὰ ά ὲ έ ὴ ή ὶ ί ὸ ό ὺ ύ ὼ ώ     }\\
\MakeLowercase{ ᾀ ᾁ ᾂ ᾃ ᾄ ᾅ ᾆ ᾇ ᾈ ᾉ ᾊ ᾋ ᾌ ᾍ ᾎ ᾏ }\\
\MakeLowercase{ ᾐ ᾑ ᾒ ᾓ ᾔ ᾕ ᾖ ᾗ ᾘ ᾙ ᾚ ᾛ ᾜ ᾝ ᾞ ᾟ }\\
\MakeLowercase{ ᾠ ᾡ ᾢ ᾣ ᾤ ᾥ ᾦ ᾧ ᾨ ᾩ ᾪ ᾫ ᾬ ᾭ ᾮ ᾯ }\\
\MakeLowercase{ ᾰ ᾱ ᾲ ᾳ ᾴ   ᾶ ᾷ Ᾰ Ᾱ Ὰ Ά ᾼ ᾽ ι ᾿ }\\
\MakeLowercase{ ῀ ῁ ῂ ῃ ῄ   ῆ ῇ Ὲ Έ Ὴ Ή ῌ ῍ ῎ ῏ }\\
\MakeLowercase{ ῐ ῑ ῒ ΐ     ῖ ῗ Ῐ Ῑ Ὶ Ί   ῝ ῞ ῟ }\\
\MakeLowercase{ ῠ ῡ ῢ ΰ ῤ ῥ ῦ ῧ Ῠ Ῡ Ὺ Ύ Ῥ ῭ ΅ ` }\\
\MakeLowercase{     ῲ ῳ ῴ   ῶ ῷ Ὸ Ό Ὼ Ώ ῼ ´ ῾   }
\selectlanguage{english}

\section{LICR Macros}

Babel defines macros for several autogenerated strings so that they may
appear in the choosen language. \emph{babel-greek} uses LICR macros in
order to let the string macros work independent of the font encoding.

If \texttt{fontspec} is loaded before babel, babel-greek loads Greek LICR
for EU1 or EU2 from the file \texttt{greek-euenc.def}
provided with \emph{greek-fontenc} since version~0.10.

\subsection{Hiatus}

The «hiatus» feature works with macro input:

\selectlanguage{greek}
% from teubner: άυλος/ΑΫΛΟΣ
\acctonos\textalpha\textupsilon λος $\mapsto$
\MakeUppercase{\acctonos\textalpha\textupsilon λος},
\>'\textalpha\textupsilon λος $\mapsto$
\MakeUppercase{\>'\textalpha\textupsilon λος},
% from http://diacritics.typo.cz/index.php?id=69  μάινα -> ΜΑΪΝΑ
m\acctonos\textalpha\textiota να $\mapsto$
\MakeUppercase{m\acctonos\textalpha\textiota να},
% from  http://de.wikipedia.org/wiki/Neugriechische_Orthographie#Das_Trema
% κέικ, ἀυπνία/αϋπνία
\textkappa\acctonos\textepsilon\textiota\textkappa $\mapsto$
\MakeUppercase{\textkappa\acctonos\textepsilon\textiota\textkappa},
\>\textalpha\textupsilon πνία $\mapsto$
\MakeUppercase{\>\textalpha\textupsilon πνία}.
\selectlanguage{english}

\subsection{Captions}

\selectlanguage{greek}
\prefacename,
\refname,
\abstractname,
\bibname,
\chaptername,
\appendixname,
\contentsname,
\listfigurename ,
\listtablename,
\indexname,
\figurename,
\tablename,
\partname,
\enclname,
\ccname,
\headtoname,
\pagename,
\seename,
\alsoname,
\proofname,
\glossaryname
\selectlanguage{english}

Test correct upcasing (dropping of accents):

\selectlanguage{greek}
\MakeUppercase{
\prefacename,
\refname,
\abstractname,
\bibname,
\chaptername,
\appendixname,
\contentsname,
\listfigurename,
\listtablename,
\indexname,
\figurename,
\tablename,
\partname,
\enclname,
\ccname,
\headtoname,
\pagename,
\seename,
\alsoname,
\proofname,
\glossaryname
}
\selectlanguage{english}


\subsection{Months}

\selectlanguage{greek}
\newcounter{foo}
\stepcounter{foo} \month=\value{foo} \today \\
\stepcounter{foo} \month=\value{foo} \today \\
\stepcounter{foo} \month=\value{foo} \today \\
\stepcounter{foo} \month=\value{foo} \today \\
\stepcounter{foo} \month=\value{foo} \today \\
\stepcounter{foo} \month=\value{foo} \today \\
\stepcounter{foo} \month=\value{foo} \today \\
\stepcounter{foo} \month=\value{foo} \today \\
\stepcounter{foo} \month=\value{foo} \today \\
\stepcounter{foo} \month=\value{foo} \today \\
\stepcounter{foo} \month=\value{foo} \today \\
\stepcounter{foo} \month=\value{foo} \today \\
\selectlanguage{english}

\section{Greek Numerals}

See greek.pdf for the formation rules of Greek numerals.
Some examples:

\selectlanguage{greek}

\greeknumeral{1},
\greeknumeral{2},
\greeknumeral{3},
\greeknumeral{4},
\greeknumeral{5},
\greeknumeral{6},
\greeknumeral{7},
\greeknumeral{8},
\greeknumeral{9},
\greeknumeral{10},
\greeknumeral{11},
\greeknumeral{12},
\greeknumeral{20},
\greeknumeral{345},
\greeknumeral{500},
\greeknumeral{1997},
\greeknumeral{2013},

\Greeknumeral{1},
\Greeknumeral{2},
\Greeknumeral{3},
\Greeknumeral{4},
\Greeknumeral{5},
\Greeknumeral{6},
\Greeknumeral{7},
\Greeknumeral{8},
\Greeknumeral{9},
\Greeknumeral{10},
\Greeknumeral{11},
\Greeknumeral{12},
\Greeknumeral{20},
\Greeknumeral{345},
\Greeknumeral{500},
\Greeknumeral{1997},
\Greeknumeral{2013},


Enumerated lists use Greek characters/numerals in the second and fourth level:

\selectlanguage{greek}
\begin{enumerate}
  \item item 1
  \begin{enumerate}
    \item item 1.1
    \begin{enumerate}
      \item item 1.1.1
       \begin{enumerate}
         \item item 1.1.1.1
         \item item 1.1.1.2
       \end{enumerate}
      \item item 1.1.2
    \end{enumerate}
  \end{enumerate}
\end{enumerate}
\selectlanguage{english}


This may be problematic with fonts that only partially support Greek and
miss the numeral signs (dexiakeraia and aristerikeraia). If you prefer the
"normal" enumeration, write in the preamble after loading babel:

\begin{verbatim}
  \makeatletter
  \addto\extrasgreek{\let\@alph\latin@alph
  		     \let\@Alph\latin@Alph}
  \makeatother
\end{verbatim}

\end{document}