summaryrefslogtreecommitdiff
path: root/language/greek/greek-fontenc/textalpha-doc.tex
diff options
context:
space:
mode:
Diffstat (limited to 'language/greek/greek-fontenc/textalpha-doc.tex')
-rw-r--r--language/greek/greek-fontenc/textalpha-doc.tex149
1 files changed, 74 insertions, 75 deletions
diff --git a/language/greek/greek-fontenc/textalpha-doc.tex b/language/greek/greek-fontenc/textalpha-doc.tex
index 7d1992c346..da2f6725eb 100644
--- a/language/greek/greek-fontenc/textalpha-doc.tex
+++ b/language/greek/greek-fontenc/textalpha-doc.tex
@@ -1,7 +1,6 @@
\documentclass[a4paper]{article}
\usepackage{parskip}
\usepackage{booktabs}
-\usepackage{cmap}
\ifdefined \UnicodeEncodingName % set by LaTeX for Unicode-aware engines
% Setup for Unicode fonts (Xe-/LuaTeX)
@@ -17,11 +16,8 @@
\usepackage[LGR,T1]{fontenc}
\newcommand*{\greekfontencoding}{LGR}
\newcommand*{\latinencoding}{T1}
- % UTF8 input encoding for pdfTeX or LuaTeX in 8-bit compatibility mode:
- \usepackage[utf8]{luainputenc}
\fi
-
\usepackage[pdfencoding=auto,colorlinks=true,linkcolor=blue]{hyperref}
% \usepackage{bookmark}
\makeatletter
@@ -123,11 +119,12 @@ Unicode fonts in these cases.
\subsubsection{\texttt{keep-semicolon}}
-LGR is no \href{https://mirrors.ctan.org/macros/latex/base/encguide.pdf}{standard text font encoding}.
+LGR is no \href{https://mirrors.ctan.org/macros/latex/base/encguide.pdf}%
+{standard text font encoding}.
Latin characters and some other ASCII symbols are mapped to Greek
``equivalents'' if LGR is the active font encoding. (See
-\href{https://mirrors.ctan.org/language/babel/contrib/greek/usage.pdf}{usage.pdf}
-for a description of this Latin-Greek transliteration.)
+\href{https://mirrors.ctan.org/language/babel/contrib/greek/babel-greek-doc.html#lgr-latin-transliteration}%
+{babel-greek} for a description of this Latin-Greek transliteration.)
Special care is required with the question mark characters: The LGR font
encoding uses the Latin question mark as input for the \emph{erotimatiko}
@@ -167,6 +164,14 @@ Test whether this works as expected in math mode:
\ensuregreek{$a b; a\;b, (\mathrm{a;}\textrm{a;}2)$}.
+\subsection{Shortcuts for Breathings}
+
+\emph{textalpha} defines the shortcut macros \verb|\<| and \verb|\>| for the
+\href{https://en.wikipedia.org/wiki/Rough_breathing}{dasia} (rough breathing)
+and \href{https://en.wikipedia.org/wiki/Smooth_breathing}{psili} (smooth
+breathing) diacritics.
+
+
\section{Limitations \label{sec:limitations}}
If compiling with 8-bit TeX, the internal font encoding switches interfere
@@ -211,52 +216,38 @@ if you drag-and-drop text from the PDF version of this document.:
\'<\textalpha
\accdasia\acctonos\textalpha
\acctonos\accdasia\textalpha
- \accdasiaoxia\textalpha
- } (\greekfontencoding)
- vs. \accdasiaoxia\textalpha{} (\latinencoding).
+ \accdasiaoxia\textalpha{}
+ \<'\textAlpha
+ \'<\textAlpha
+ \accdasia\acctonos\textAlpha
+ \acctonos\accdasia\textAlpha
+ \accdasiaoxia\textAlpha
+ } (\greekfontencoding)
+ vs. \accdasiaoxia\textalpha{} \accdasiaoxia\textAlpha{} (\latinencoding).
\end{quote}
-Greek diacritics (except the dialytika) are placed before capital letters in
-Titlecase and dropped in UPPERCASE:
-%
-\begin{quote}
- \ensuregreek{%
- \<{\textalpha} \>{\textepsilon} \"'{\textiota} \`>\texteta{}
- \'<{\textomicron} \~<{\textupsilon} \~>{\textomega}
- \quad
- \<{\textAlpha} \>{\textEpsilon} \"{\textIota} \`>\textEta{}
- \'<{\textOmicron} \~<{\textUpsilon} \~>{\textOmega}
-
- \MakeUppercase{%
- \<{\textalpha} \>{\textepsilon} \"'{\textiota} \`\>\texteta{}
- \'<{\textomicron} \~<{\textupsilon} \~>{\textomega}
- \quad
- \<{\textAlpha} \>{\textEpsilon} \"{\textIota} \`>\textEta{}
- \'<{\textOmicron} \~<{\textUpsilon} \~>{\textOmega}
- }
- }
-\end{quote}
-%
-With the new \verb|\MakeUppercase| implementation (since 2022/06),
-Greek upcasing rules are only applied if the text language is set to Greek
-with Babel (and still need some fixes for LICR input).
+Greek diacritics (except the dialytika and sub-iota) are placed before
+capital letters in Titlecase (Ἀρχιμήδης) and and dropped in uppercase
+(ΑΡΧΙΜΗΔΗΣ). With the \verb|\MakeUppercase| implementation introduced
+2022/06, Greek upcasing rules are only applied to literal characters
+if the text language is set to Greek with Babel.
With the old \verb|\MakeUppercase| implementation, the above rules are fully
applied if the active font encoding is LGR or TU. However, accents input as
macros are misplaced if the active font encoding does not support Greek.
Pre-composed literal Unicode characters are handled correctly:
\begin{quote}
- \begin{tabular}{ccc}
- & LICR & Unicode \\ \hline
- \greekfontencoding & \ensuregreek{\'\textAlpha} & \ensuregreek{Ά} \\
- \latinencoding & \'\textAlpha & Ά
- \end{tabular}
+ \begin{tabular}{ccc}
+ & LICR & literal input \\ \hline
+ \greekfontencoding & \ensuregreek{\'\textAlpha} & \ensuregreek{Ά} \\
+ \latinencoding & \'\textAlpha & Ά
+ \end{tabular}
\end{quote}
The dialytika marks a \emph{hiatus} (break-up of a diphthong). It must be
present in UPPERCASE even where it is redundant in lowercase (the hiatus can
-also be marked by an accent on the first of two consecutive vowels). The
-auto-hiatus feature works in LGR and TU font encodings only:
+also be marked by an accent or breathing on the first of two consecutive
+vowels). The auto-hiatus feature works in LGR and TU font encodings only:
\begin{quote}
\acctonos\textalpha\textupsilon{}, \acctonos\textepsilon\textiota{} $\mapsto$
\MakeUppercase{\ensuregreek{
@@ -268,19 +259,18 @@ auto-hiatus feature works in LGR and TU font encodings only:
\end{quote}
With the old implementation of \verb|\MakeUppercase|, the auto-hiatus
-feature works with LICR commands, not Unicode literals.
-The new implementation works with Unicode literals but only if the text
+feature works with LICR macros but not Unicode literals.
+The new implementation works with Unicode literals, too, but only if the text
language is Greek (i.e. not in this document that does not load Babel).
\begin{quote}
-\ensuregreek{\accpsili{\textalpha}\textupsilon{}πνία} $\mapsto$
-\ensuregreek{\MakeUppercase{\ensuregreek{\accpsili{\textalpha}\textupsilon{}πνία}}}
-(OK)
-
-\ensuregreek{ἀ\textupsilon{}πνία} $\mapsto$
-\ensuregreek{\MakeUppercase{ἀ\textupsilon{}πνία}} (OK with LGR)
+\ensuregreek{%
+\accpsili\textalpha\textupsilon\textpi\textnu\acctonos\textiota\textalpha}
+$\mapsto$ \ensuregreek{\MakeUppercase{%
+\accpsili\textalpha\textupsilon\textpi\textnu\acctonos\textiota\textalpha}}
+(LICR macros: OK with LGR or TU)
\ensuregreek{ἀυπνία} $\mapsto$
-\ensuregreek{\MakeUppercase{ἀυπνία}} (literal characters fail without Babel)
+\ensuregreek{\MakeUppercase{ἀυπνία}} (literal characters: fails without Babel)
\end{quote}
@@ -340,7 +330,7 @@ Archaic Greek letters and Greek punctuation
Diacritics
\begin{quote}
- Symbol macros:%
+ Short macros:%
\footnote{Composite diacritics require wrapping in
\texttt{\textbackslash ensuregreek}.}
\"{} \'{} \`{} \~{} \<{} \>{} \u{} \={}
@@ -379,7 +369,6 @@ This also works for the new-defined Dasia and Psili shortcuts:
\begin{quote}
\begin{tabbing}
COL1\quad \= COL2\quad \= COL3\quad \= COL4\quad \\
- COL1 \> \> COL3 \\
Viele \> Gr\a"u\ss e
\> \greekscript \a<\textalpha{}
\> \greekscript \a>\textomega
@@ -395,32 +384,32 @@ used inside a word and \verb|\textfinalsigma| \textfinalsigma{} (or
In LGR, the Latin letter \verb|s| and the command \verb|\textautosigma|
print the ``normal'' sigma if followed by another letter and the final sigma
if followed by space or punctuation. This is implemented via the font
-ligature mechanism and works only in LGR:
+ligature mechanism in LGR:
\ensuregreek{\textautosigma\textautosigma} (\greekfontencoding) vs.
-\textautosigma{}\textautosigma{} (\latinencoding).
+\textautosigma{}\textautosigma{} (\latinencoding).%
+\footnote{TODO: Fix \texttt{\textbackslash textautosigma} with Unicode fonts.}
+
The upper case of both sigma variants is \verb|\textSigma|, the lower case
-of Sigma is \verb|\textautosigma|.
+of \verb|\textSigma| is \verb|\textautosigma|.
+
+\smallskip\noindent
+Test: Unicode literal and \verb|\text...| commands
-Test: (Unicode literal and \verb|\text...| commands in \greekfontencoding)
+\newcommand{\sample}{σ\textsigma{}
+ ς\textvarsigma \textfinalsigma \textautosigma{}
+ ΣΣ \textSigma\textSigma{}}
-original: σ\textsigma{} ς\textvarsigma \textfinalsigma \textautosigma{}
- ΣΣ \textSigma\textSigma{}
+no change: \sample
-MakeUppercase:
-\MakeUppercase{σ\textsigma{} ς\textvarsigma \textfinalsigma \textautosigma{}
- ΣΣ \textSigma\textSigma{}}
+MakeUppercase: \MakeUppercase{\sample}
-MakeLowercase:
-\MakeLowercase{σ\textsigma{} ς\textvarsigma \textfinalsigma \textautosigma{}
- \ensuregreek{ΣΣ \textSigma\textSigma{}}}
+MakeLowercase (\latinencoding): \MakeLowercase{\sample}
-TODO: With the new MakeLowercase, a literal Σ is converted according to its
-position :) but the macro \verb|\textSigma| is converted to a final sigma
-also in the middle of a word (at least with language English).
+MakeLowercase (\greekfontencoding): \ensuregreek{\MakeLowercase{\sample}}
-\subsection{Greek Unicode characters in non-Greek text}
+\subsection{Greek literal characters in non-Greek text}
With the \emph{textalpha} package,
\href{https://ctan.org/pkg/greek-inputenc}{greek-inputenc} and input
@@ -428,10 +417,12 @@ encoding \texttt{utf8}, Greek Unicode characters can be used in text with
any font encoding. See Tables \ref{tab:greek-and-coptic} and
\ref{tab:greek-extended}.
-Kerning is preserved if the active font encoding supports Greek:
-\ensuregreek{AΫA}
+Kerning is preserved if the active font encoding supports Greek. This can be
+secured by wrapping the Greek text part in \verb|\ensuregreek| or setting the
+text language with Babel: \ensuregreek{AΫA}
\begin{table}[tbp]
+\setlength{\tabcolsep}{0.45em}
\centerline{
\begin{tabular}{rrrrrrrrrrrrrrrrr}
\toprule
@@ -457,6 +448,7 @@ Kerning is preserved if the active font encoding supports Greek:
\begin{table}[tbp]
+\setlength{\tabcolsep}{0.45em}
\centerline{
\begin{tabular}{rrrrrrrrrrrrrrrrr}
\toprule
@@ -486,8 +478,13 @@ characters in \latinencoding{} font encoding.}
\label{tab:greek-extended}
\end{table}
-Combined Diacritics work ᾅ, diacritics (except diaeresis) are dropped with
-MakeUppercase (μαΐστρος $\mapsto$ \MakeUppercase{μαΐστρος}).
+Combined Diacritics work for pre-composed characters: ᾅ.
+
+Diacritics (except diaeresis) are dropped with
+MakeUppercase with LaTeX versions older than 2022/06
+For other versions, set the language of to-be-upcased Greek text with Babel.
+
+μαΐστρος, δύο $\mapsto$ \MakeUppercase{μαΐστρος, δύο}.
\subsection{PDF strings}
@@ -501,9 +498,11 @@ Unicode input.
λογος and \ensuregreek{logos}}
The subsection title above uses: LICR macros, Unicode input and the LGR
-transliteration for the Greek word \ensuregreek{logos}. Check the table of
-contents in the PDF viewer: LICR macros and Unicode literals work fine, the
-Latin transliteration remains Latin in the PDF metadata.
+transliteration for the Greek word \ensuregreek{logos}.
+
+LICR macros and Unicode literals work fine everywhere, the
+Latin transliteration remains Latin in the PDF metadata
+(sidebar table of contents in the PDF viewer) and with Xe/LuaTeX.
\subsubsection{\greekalphabetsample}
\subsubsection{\greekAlphabetsample}