summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/lgrx/diacritics.tex
blob: bef04ff61a26965dace238cde6f4c2fd8cd9a47a (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
% Test definitions for accents and composite accents in Greek
\documentclass[a4paper,british,polutonikogreek]{article}
\pagestyle{empty}
\usepackage[margin=2.5cm]{geometry}
\usepackage{cmap} % fix search and cut-and-paste in Acrobat Reader

\usepackage%
{lmodern}
% {gfsartemisia}
% {gfsbaskerville}
% [default]{gfsbodoni}
% [default]{gfscomplutum}
% {gfsdidot}
% [default]{gfsneohellenic}
% {lmodern} \usepackage{gfsporson} \renewcommand*\rmdefault{porson}
% [default]{gfssolomos}
% {kerkis}
% {teubner}
% \renewcommand{\ttdefault}{txtt}

% Load the extended font encoding definitions (after font package)
\usepackage[LGRx,T1]{fontenc}

\usepackage{listings}
\lstset{basicstyle=\ttfamily}

% Babel package::

\usepackage{babel}
% revert the polutonikogreek definition of \~:
\addto\extraspolutonikogreek{\renewcommand*{\~}{\a~}}
\addto\extrasgreek{\renewcommand*{\~}{\a~}}

% "Lipsiakos" italic font `cbleipzig`:
\newcommand*{\lishape}{\fontencoding{LGR}\fontfamily{cmr}%
		       \fontshape{li}\selectfont}
\DeclareTextFontCommand{\textli}{\lishape}


\begin{document}

\selectlanguage{british}

\section*{Greek diacritics with standard accent macros}

\texttt{lgrxenc.def} is a comprehensive font encoding definition file.
LICR macros are defined for all non-ASCII characters.
Diacritics can be input using an extension of the standard macro
commands with composite diacritics input as
backslash followed by the LGR transliteration.%
\footnote{This makes it easy to follow the advise in
	  \emph{teubner-doc}: ``typeset your paper with the regular
	  accent vowel ligatures and [{\ldots}] substitute them in the
	  final revision with the accented vowel macros only in those
	  instances where the lack of kerning is disturbing''.}

The example in greek-usage.pdf:
%
\begin{quote} \selectlanguage{greek}
    T\'i f\'hic? \<Id\`wn \>enj\'ede pa\~id''
    \>eleuj\'eran t\`ac plhs\'ion N\'umfac stefano\~usan,
    S\'wstrate, \>er\~wn \'ap\~hljec e\>uj\'uc?
\end{quote}
can be input as
\begin{lstlisting}
    T\'i f\'hic? \<Id\`wn \>enj\'ede pa\~id''
    \>eleuj\'eran t\`ac plhs\'ion N\'umfac stefano\~usan,
    S\'wstrate, \>er\~wn \'ap\~hljec e\>uj\'uc?
\end{lstlisting}
%
Improvements:
%
\begin{itemize}

\item Accents can be placed on any character:%
  \footnote{Babel's \emph{polutonikogreek} option re-defines
    \textbackslash\textasciitilde (even for
    Latin with \textbackslash textlatin).
    This document reverts the babel definition in the preamble
    to make the tilde/perispomeni-accent work as usual in both,
    English (\textgreek{ni\~n\~o} ni\~n\~o) and Greek %
    % (\foreignlanguage{greek}{ni\~n\~o \textlatin{ni\~n\~o}}).
    .}
  \textgreek{\"k \`l \'m \~<n \<o \>'p \>9 \`\>-}

\item Kerning is preserved
  \selectlanguage{greek}
  \begin{tabular}[t]{llll}
     & \textlatin{roman} & \textlatin{italic} & \textlatin{cbleipzig} \\
    \foreignlanguage{british}{accent macro:}  &
      a\>ut'os & \emph{a\>ut\'os} & \textli{a\>ut\'os} \\
    \foreignlanguage{british}{transliteration:} &
      a>ut'os & \emph{a>ut'os} & \textli{a>ut'os}\\
  \end{tabular}
  \selectlanguage{british}

  Like in any font encoding, kerning only works with pre-composed glyphs:
  \textgreek{A\"UA $\ne$ A\~UA}, AVA $\ne$ A\~VA.

\item Compatible with hyperref (see greekhyperref.pdf).

\item Following Greek typesetting convention, diacritics (except the
  dialytika) are placed to the left of capital letters and and dropped
  by \verb|\MakeUppercase|:

  \begin{quote} \selectlanguage{greek}
    \'antropos $\mapsto$ \MakeUppercase{\'antropos},
    \>'antropos $\mapsto$ \MakeUppercase{\>'antropos},\\
    Aqill\'eas $\mapsto$ \MakeUppercase{Aqill\'eas},
    \>Aqille\'us $\mapsto$ \MakeUppercase{\>Aqille\'us}.
  \end{quote}

  The dialytika is printed even in cases where it's not needed
  in lowercase: % the "hiatus" feature
  \begin{quote} \selectlanguage{greek}
    \'aulos $\mapsto$ \MakeUppercase{\'aulos},
    \'>aulos $\mapsto$ \MakeUppercase{\'\>aulos}, 
    % from http://diacritics.typo.cz/index.php?id=69  μάινα -> ΜΑΪΝΑ
    m\'aina $\mapsto$ \MakeUppercase{m\'aina},\\
    % from  http://de.wikipedia.org/wiki/Neugriechische_Orthographie#Das_Trema
    % κέικ, ἀυπνία/αϋπνία
    k\'eik, $\mapsto$ \MakeUppercase{k\'eik},
    \>aupn\'ia $\mapsto$ \MakeUppercase{\>aupn\'ia}.
  \end{quote}
\end{itemize}

\selectlanguage{british} Composite diacritics can be specified as
backslash + LGR transliteration or combined accent macros, 
e.\,g. \textgreek{\~>a} can be written as
\begin{quote}
  \verb+\~>a+, \verb+\>~a+,
  \verb+\~\>{a}+, or \verb+\~\>a+.
\end{quote}
However, braces in composite accents
(\verb+\~{\>a}+, \verb+\~{>a}+, or \verb+\~{\>{a}}+)
lead to errors.

\verb+\MakeUppercase+ works with most input variants
but fails with 
%
\begin{itemize}
\item \verb+\"`+, \verb+\"'+ or \verb+\>'+ if the language is \texttt{greek}
      or \texttt{polutonikogreek} (which maps \texttt{'} and \texttt{`}
      to an empty character preventing the correct placing of the dialytika
      via TextComposite definitions
      \foreignlanguage{polutonikogreek}{\"'u $\mapsto$ \MakeUppercase{\"'u},
      \"`u $\mapsto$ \MakeUppercase{\"`u},
      \>'aulos $\mapsto$ \MakeUppercase{\>'aulos}}),
      or
\item a tilde in a document which does \textbf{not} define
      the \texttt{greek} or \texttt{polutonikogreek} language (it will
      produce a no-break space).
\end{itemize}
%
Combining ``symbol macros'' (\verb+\"\' \>\' \>\~+) or reversing the order
(\verb+\'" \'> \~>+) resolves these cases.
% Test:
\begin{quote} \selectlanguage{greek}
    % \~>a $\mapsto$ \MakeUppercase{\~>a},
    % \'>e $\mapsto$ \MakeUppercase{\'<e},
    \'"i $\mapsto$ \MakeUppercase{\'"i},
    \"\acctonos i $\mapsto$ \MakeUppercase{\"\acctonos i},
    % \'>o $\mapsto$ \MakeUppercase{\'>o},
    \"\'u $\mapsto$ \MakeUppercase{\"\'u},
    \"\`u $\mapsto$ \MakeUppercase{\"\`u},
    % \'>w $\mapsto$ \MakeUppercase{\'>w},
    \>\'aulos $\mapsto$ \MakeUppercase{\>\'aulos}  
\end{quote}

Accent macros can start with \verb|\a| instead of \verb|\| when the
short form is redefined, e.\,g. inside a \emph{tabbing} environment.
This also works for the new-defined Dasia and Psili shortcuts
(\verb|\a<| and \verb|\a>|):
%
\begin{quote}
\selectlanguage{greek}
\begin{tabbing}
T'i f'hic? \= T\a'i f\a'hic? \\
<Id`wn \> \a>enj\a'ede pa\a~id
\end{tabbing}
\end{quote}

\end{document}