summaryrefslogtreecommitdiff
path: root/language/greek/greek-fontenc/test-diacritics.tex
blob: c06a795dcaf17d297bc8c671ad3d19ff6a8827ea (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
% Test definitions for accents and composite accents in Greek
% \RequirePackage{latexbug}
\documentclass[a4paper]{article}
\usepackage{lmodern}
\usepackage{parskip}

% Load encoding definitions
% \usepackage[LGR,T1]{fontenc}
\usepackage{textalpha}  % "Greek script everywhere"

% With TL22, the special handling of Greek UPPERCASE is only triggered
% if the text language is set to "greek" with Babel:
%
\usepackage[greek,english]{babel}  % babel-greek
% \usepackage[greek,english,provide=*]{babel}    % Babel's Greek "ini"


\IfFormatAtLeastTF{2022/06/01}
  {\newcommand*{\uppercaseversion}{new (post-2022/06/01)}}
  {\newcommand*{\uppercaseversion}{old (pre-2022/06/01)}}

\begin{document}

\section*{Test Greek diacritics with 8-bit TeX}

This document tests support for the Greek non-standard LGR fonts with the
contributed packages \emph{greek-fontenc} and \emph{greek-inputenc}.
It is compiled with the \textbf{\uppercaseversion{}} \verb|\MakeUppercase|
version.

The LGR font encoding definition file \texttt{lgrenc.def} defines LICR
macros for all non-ASCII characters in the LGR font encoding and loads
definitions shared with the TU font encoding from
\texttt{greek-fontenc.def}.

In addition to the LICR, Greek letters can also be input via a Latin
transliteration.

Greek accent macros have names starting with \verb|\acc| followed by the
Greek accent name as used in the Unicode standard (e.g. \verb|\acctonos|).
The standard symbol accents \verb|\' \` \~ \"| should behave according to
Greek typography if used with Greek letters.

Apart from the diacritical marks native to Greek itself, linguists also
regularly mark vowel length with macrons (¯) and breves (˘).
There is no established praxis regarding their handling in uppercase.

The \emph{textalpha} or \emph{alphabeta} packages define the symbol macros
\verb|\<| and \verb|\>| as alias for the breathings (Dasia and Psili).

Diacritics can be specified as named macro, short macro, or combined accent
macros, e.\,g.
\verb| \accpsiliperispomeni{w} \accpsili\accperispomeni w| and
\verb|\>\~w \~>{w} \~\>w \>~w| all become
%
\newcommand*{\accsample}{\accpsiliperispomeni{w} \accpsili\accperispomeni w
                         \>\~w \~>{w} \~\>w \>~w}
\ensuregreek{\accsample}.

The pre-June 22 version of \verb+\MakeUppercase+ works correctly, with one
exception: There is a spurious space in upcased combined accents with a
literal tilde like \verb|\>~|. This can be fixed by using a tilde accent
(\verb|\>\~| or \verb|\~>|) or loading Babel with the "greek" language option
(even in text parts only changing the font encoding without selecting the
Greek language).
\begin{quote}
  \ensuregreek{\accsample\ → \MakeUppercase{\accsample}}
\end{quote}

Test the upcasing of the different input methods:

\subsection*{Accent macro + Latin transliteration}

\begin{quotation}
  single accent (named, [alias], short)

  \ensuregreek{\acctonos w \accoxia w \'w →
     \MakeUppercase{\acctonos w \accoxia w \'w}}

  \ensuregreek{\accvaria w \`w → \MakeUppercase{\accvaria w \`w}}

  \ensuregreek{\accperispomeni w \~w → \MakeUppercase{\accperispomeni w \~w}}

  \ensuregreek{\accdasia w \<w → \MakeUppercase{\accdasia w \<w}}

  \ensuregreek{\accpsili w \>w → \MakeUppercase{\accpsili w \>w}}

  \ensuregreek{\accdialytika u \"u → \MakeUppercase{\accdialytika u \"u}}

  \ensuregreek{w\ypogegrammeni{} w| → \MakeUppercase{w\ypogegrammeni{} w|}}

  combined accents (name, name+name, short+short, short+char)

    \ensuregreek{\accdasiaperispomeni w     \accdasia\accperispomeni     w \<\~w \~<w
  → \MakeUppercase{\accdasiaperispomeni w     \accdasia\accperispomeni     w \<\~w \~<w}}

    \ensuregreek{\accdasiavaria       w     \accdasia\accvaria           w \<\`w \<`w
  → \MakeUppercase{\accdasiavaria       w     \accdasia\accvaria           w \<\`w \<`w}}

    \ensuregreek{\accdasiaoxia        w     \accdasia\accoxia            w \<\'w \<'w
  → \MakeUppercase{\accdasiaoxia        w     \accdasia\accoxia            w \<\'w \<'w}}

    \ensuregreek{\accpsiliperispomeni w     \accpsili\accperispomeni     w \>\~w \~>w
  → \MakeUppercase{\accpsiliperispomeni w     \accpsili\accperispomeni     w \>\~w \~>w}}

    \ensuregreek{\accpsilioxia        w     \accpsili\accoxia  w         \>\'w \>'w
  → \MakeUppercase{\accpsilioxia        w     \accpsili\accoxia  w         \>\'w \>'w}}

    \ensuregreek{\accpsilivaria       w     \accpsili\accvaria w         \>\`w \>`w
  → \MakeUppercase{\accpsilivaria       w     \accpsili\accvaria w         \>\`w \>`w}}

    \ensuregreek{\accdialytikaperispomeni u \accdialytika\accperispomeni u \"\~u \~"u
  → \MakeUppercase{\accdialytikaperispomeni u \accdialytika\accperispomeni u \"\~u \~"u}}

    \ensuregreek{\accdialytikatonos   u     \accdialytika\acctonos u     \"\'u \"'u
  → \MakeUppercase{\accdialytikatonos   u     \accdialytika\acctonos u     \"\'u \"'u}}

    \ensuregreek{\accdialytikavaria   u     \accdialytika\accvaria u     \"\`u \"`u
  → \MakeUppercase{\accdialytikavaria   u     \accdialytika\accvaria u     \"\`u \"`u}}

    \ensuregreek{\accpsilivaria w\ypogegrammeni{} \accpsili\accvaria w| \>\`w| \>`w|
  → \MakeUppercase{\accpsilivaria w\ypogegrammeni{} \accpsili\accvaria w| \>\`w| \>`w|}}

\end{quotation}

With TeXLive 2020 (Debian/stable), all accents except dialytika and
ypogegrammeni/prosgegrammeni are dropped in ALL CAPS.

With current (2023/01/28) TeXLive, upcasing short accent macros does no
longer work as expected: accents are not dropped.

The mute iota is kept (as expected).

\subsection*{Accent macro + Latin transliteration}

\begin{quotation}
  single accent (named, [alias], short)

  \ensuregreek{\acctonos \textomega{} \accoxia \textomega{} \'\textomega{}
     → \MakeUppercase{\acctonos \textomega{} \accoxia \textomega{} \'\textomega{}}}

  \ensuregreek{\accvaria \textomega{} \`\textomega{} → \MakeUppercase{\accvaria \textomega{} \`\textomega{}}}

  \ensuregreek{\accperispomeni \textomega{} \~\textomega{} → \MakeUppercase{\accperispomeni \textomega{} \~\textomega{}}}

  \ensuregreek{\accdasia \textomega{} \<\textomega{} → \MakeUppercase{\accdasia \textomega{} \<\textomega{}}}

  \ensuregreek{\accpsili \textomega{} \>\textomega{} → \MakeUppercase{\accpsili \textomega{} \>\textomega{}}}

  \ensuregreek{\accdialytika \textupsilon{} \"\textupsilon{} → \MakeUppercase{\accdialytika \textupsilon{} \"\textupsilon{}}}

  \ensuregreek{\textomega\ypogegrammeni{} \textomega| → \MakeUppercase{\textomega\ypogegrammeni{} \textomega|}}

  combined accents (name, name+name, short+short, short+char)

    \ensuregreek{\accdasiaperispomeni \textomega{}     \accdasia\accperispomeni     \textomega{} \<\~\textomega{} \~<\textomega{}
  → \MakeUppercase{\accdasiaperispomeni \textomega{}     \accdasia\accperispomeni     \textomega{} \<\~\textomega{} \~<\textomega{}}}

    \ensuregreek{\accdasiavaria       \textomega{}     \accdasia\accvaria           \textomega{} \<\`\textomega{} \<`\textomega{}
  → \MakeUppercase{\accdasiavaria       \textomega{}     \accdasia\accvaria           \textomega{} \<\`\textomega{} \<`\textomega{}}}

    \ensuregreek{\accdasiaoxia        \textomega{}     \accdasia\accoxia            \textomega{} \<\'\textomega{} \<'\textomega{}
  → \MakeUppercase{\accdasiaoxia        \textomega{}     \accdasia\accoxia            \textomega{} \<\'\textomega{} \<'\textomega{}}}

    \ensuregreek{\accpsiliperispomeni \textomega{}     \accpsili\accperispomeni     \textomega{} \>\~\textomega{} \~>\textomega{}
  → \MakeUppercase{\accpsiliperispomeni \textomega{}     \accpsili\accperispomeni     \textomega{} \>\~\textomega{} \~>\textomega{}}}

    \ensuregreek{\accpsilioxia        \textomega{}     \accpsili\accoxia  \textomega{}         \>\'\textomega{} \>'\textomega{}
  → \MakeUppercase{\accpsilioxia        \textomega{}     \accpsili\accoxia  \textomega{}         \>\'\textomega{} \>'\textomega{}}}

    \ensuregreek{\accpsilivaria       \textomega{}     \accpsili\accvaria \textomega{}         \>\`\textomega{} \>`\textomega{}
  → \MakeUppercase{\accpsilivaria       \textomega{}     \accpsili\accvaria \textomega{}         \>\`\textomega{} \>`\textomega{}}}

    \ensuregreek{\accdialytikaperispomeni \textupsilon{} \accdialytika\accperispomeni \textupsilon{} \"\~\textupsilon{} \~"\textupsilon{}
  → \MakeUppercase{\accdialytikaperispomeni \textupsilon{} \accdialytika\accperispomeni \textupsilon{} \"\~\textupsilon{} \~"\textupsilon{}}}

    \ensuregreek{\accdialytikatonos   \textupsilon{}     \accdialytika\acctonos \textupsilon{}     \"\'\textupsilon{} \"'\textupsilon{}
  → \MakeUppercase{\accdialytikatonos   \textupsilon{}     \accdialytika\acctonos \textupsilon{}     \"\'\textupsilon{} \"'\textupsilon{}}}

    \ensuregreek{\accdialytikavaria   \textupsilon{}     \accdialytika\accvaria \textupsilon{}     \"\`\textupsilon{} \"`\textupsilon{}
  → \MakeUppercase{\accdialytikavaria   \textupsilon{}     \accdialytika\accvaria \textupsilon{}     \"\`\textupsilon{} \"`\textupsilon{}}}

    \ensuregreek{\accpsilivaria \textomega\ypogegrammeni{} \accpsili\accvaria \textomega| \>\`\textomega| \>`\textomega|
  → \MakeUppercase{\accpsilivaria \textomega\ypogegrammeni{} \accpsili\accvaria \textomega| \>\`\textomega| \>`\textomega|}}

\end{quotation}

With TeXLive 2020 (Debian/stable), all Greek accents except dialytika and
prosgegrammeni are dropped in ALL CAPS. (The standard accents macron and
breve are kept as well.)

With current (2023/01/28) TeXLive, upcasing the \verb|\~| accent macro and
combining accents with dialytika (\verb|\~" \"' \"`|) does no longer work as
expected: accents are not dropped (only the dialytika, macron and breve must
be kept).

Upcasing keeps the mute iota (as expected).

\subsection*{Accent macro + literal Greek character}
Accent + literal Greek (utf-8) character is not supported in 8-bit TeX.


\subsection*{The hiatus feature}

Tonos and dasia mark a \emph{hiatus} (break-up of a diphthong) if
placed on the first vowel of a diphthong.
A dialytika must be placed on the second vowel if they are dropped:

\newcommand{\Hiatus}{\acctonos\textalpha\textiota,
                     \acctonos\textalpha\textupsilon,
                     \acctonos\textepsilon\textiota,
                     \accdasiaoxia\textalpha\textiota,
                     \accdasiaoxia\textalpha\textupsilon,
                     \accdasiaoxia\textepsilon\textiota}%
Named + LICR:
\ensuregreek{\Hiatus\ → \MakeUppercase{\Hiatus}}.

\renewcommand{\Hiatus}{\'\textalpha\textiota,
                       \'\textalpha\textupsilon,
     		       \'\textepsilon\textiota,
                       \'>\textalpha\textiota,
                       \'>\textalpha\textupsilon,
                       \'>\textepsilon\textiota}%
Short + LICR:
\ensuregreek{\Hiatus\ → \MakeUppercase{\Hiatus}}.

\renewcommand{\Hiatus}{\acctonos ai,
                       \acctonos au,
                       \acctonos ei,
                       \accdasiaoxia ai,
                       \accdasiaoxia au,
                       \accdasiaoxia ei}%
Named + transliteration:
\ensuregreek{\Hiatus\ → \MakeUppercase{\Hiatus}}.

\renewcommand{\Hiatus}{\'ai,
                       \'au,
                       \'ei,
                       \'>ai,
                       \'>au,
                       \'>ei}%
Short + transliteration:
\ensuregreek{\Hiatus\ → \MakeUppercase{\Hiatus}}.

In current TeXLive, the \emph{hiatus} feature keeps working with named
accend macros but fails with short accent macros.


\subsection*{Pre-composed literal Greek character}

The Greek and Coptic Unicode Block

\newcommand{\GreekAndCoptic}{%
                   ͺ ; ΄   ΅    Ά ·  Έ  Ή  Ί  Ό  Ύ  Ώ  \\
               ΐ Α Β Γ  Δ Ε Ζ Η Θ Ι  Κ  Λ  Μ  Ν  Ξ  Ο  \\
               Π Ρ   Σ  Τ Υ Φ Χ Ψ Ω  Ϊ  Ϋ  ά  έ  ή  ί  \\
               ΰ α β γ  δ ε ζ η θ ι  κ  λ  μ  ν  ξ  ο  \\
               π ρ ς σ  τ υ φ χ ψ ω  ϊ  ϋ  ό  ύ  ώ     \\
}
\begin{quote}
  \ifdefined\extrasgreek
    \selectlanguage{greek}
  \fi
  \greekscript
  \GreekAndCoptic
\end{quote}
%
MakeUppercase:
\begin{quote}
  \ifdefined\extrasgreek
    \selectlanguage{greek}
  \fi
  \greekscript
  \MakeUppercase{\GreekAndCoptic}
\end{quote}
%
% MakeLowercase:
% \begin{quote}
%   \greekscript
%   \MakeLowercase{\GreekAndCoptic}
% \end{quote}

Greek extended Unicode block

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

\begin{quote}
  \ifdefined\extrasgreek
    \selectlanguage{greek}
  \fi
  \greekscript
  \GreekExtended
\end{quote}
%
MakeUppercase:
\begin{quote}
  \ifdefined\extrasgreek
    \selectlanguage{greek}
  \fi
  \greekscript
  \MakeUppercase{\GreekExtended}
\end{quote}

% MakeLowercase:
% \begin{quote}
%   % \selectlanguage{greek}
%   \greekscript
%   \MakeLowercase{\GreekExtended}
% \end{quote}

With TeXLive 2020 (Debian/stable), all Greek accents except dialytika and
prosgegrammeni are dropped in UPPERCASE and kept in lowercase. No errors.

With current (2023/01/28) TeXLive:

Upcasing leads to ``Unicode errors'' (``combining characters not set not set
up for use with LaTeX'') although no combining characters are used in the
source.

Accents are not dropped (with some exceptions).

The sub-iota became a capital iota (solved by an update to MakeUppercase).

\end{document}