summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/greek-fontenc/textalpha-doc.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/latex/greek-fontenc/textalpha-doc.tex')
-rw-r--r--Master/texmf-dist/doc/latex/greek-fontenc/textalpha-doc.tex281
1 files changed, 186 insertions, 95 deletions
diff --git a/Master/texmf-dist/doc/latex/greek-fontenc/textalpha-doc.tex b/Master/texmf-dist/doc/latex/greek-fontenc/textalpha-doc.tex
index 00163fdc15e..38c1d2e67e4 100644
--- a/Master/texmf-dist/doc/latex/greek-fontenc/textalpha-doc.tex
+++ b/Master/texmf-dist/doc/latex/greek-fontenc/textalpha-doc.tex
@@ -2,73 +2,116 @@
\usepackage{parskip}
\usepackage{booktabs}
-\usepackage{lmodern}
-\usepackage{textcomp}
-\usepackage[LGR,T1]{fontenc}
+\ifdefined \UnicodeEncodingName % set by LaTeX for Unicode-aware engines
+ % Setup for Unicode fonts (Xe-/LuaTeX)
+ \usepackage{fontspec}
+ \setmainfont{Linux Libertine O}
+ \setsansfont{Linux Biolinum O}
+ \newcommand*{\greekfontencoding}{TU}
+\else
+ % Setup for 8-bit fonts (pdfTeX/LuaTeX)
+ % (XeTeX in compatibility mode would require inputenc hacks and is not
+ % reliable.)
+ \usepackage{lmodern}
+ \usepackage{textcomp}
+ \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
-% UTF8 input encoding for pdfTeX or LuaTeX in 8-bit compatibility mode:
-% (XeTeX in compatibility mode would require xetex-inputenc.sty, which is
-% not at CTAN but on https://github.com/wspr/xetex-inputenc)
-\usepackage[utf8]{luainputenc}
\usepackage[pdfencoding=auto,colorlinks=true,linkcolor=blue]{hyperref}
-\usepackage{bookmark}
-% hyperrefs PU encoding supports Greek LICR macros
-\DeclareTextCommand{\ensuregreek}{PU}[1]{#1}
+% \usepackage{bookmark}
+\makeatletter
+\providecommand*{\href}{\@secondoftwo}
+\providecommand*{\url}{\texttt}
+\makeatother
\usepackage[normalize-symbols, % comment option out to test error reporting
keep-semicolon%
]{textalpha}
+% compatibility defs:
+\ProvideTextCommandDefault{\textvarstigma}{$\oslash$%
+ \message{Character textvarstigma not defined.}}
+\ProvideTextCommand{\textvarstigma}{PU}{⌀}
+\providecommand*{\accinvertedbrevebelow}{$\oslash$%
+ \message{Character accinvertedbrevebelow not defined.}}
+\providecommand*{\accbrevebelow}{$\oslash$%
+ \message{Character accbrevebelow not defined.}}
+
+
+
\begin{document}
\title{The \emph{textalpha} package}
\author{Günter Milde}
+\date{2020/10/30}
+
\maketitle
\abstract{\noindent
The \emph{textalpha} package enables the use of Greek characters
-in text independent of font encoding or TeX engine. Input is possible via
-text commands (\verb|\textalpha| \ldots
+in text independent of font encoding or TeX engine.%
+\footnote{
+ This document was compiled using
+ \ifdefined \UTFencname % defined by fontspec
+ Unicode fonts (font encoding \latinencoding).
+ For a version using 8-bit fonts, see
+ \href{textalpha-doc.pdf}{textalpha-doc.pdf}.
+ \else
+ 8-bit fonts (font encoding \latinencoding).
+ For a version using Unicode fonts, see
+ \href{textalpha-tu.pdf}{textalpha-tu.pdf}.
+ \fi
+}
+Input is possible via text commands (\verb|\textalpha| \ldots
\verb|\textOmega|) or Unicode literals\footnote{%
Requires \emph{\href{http://www.ctan.org/pkg/greek-inputenc}{greek-inputenc}}
or XeTeX/LuaTeX.}.
}
+
\tableofcontents
+
\section{Usage}
Load this package in the preamble of your document with
\begin{verbatim}
- \usepackage{textalpha}
+ \usepackage[<options>]{textalpha}
\end{verbatim}
-eventually with options \texttt{normalize-symbols} and/or
-\texttt{keep-semicolon}.
-
-If \emph{textalpha} is loaded after the setup of Unicode fonts with the
-\href{http://www.ctan.org/pkg/fontspec}{\emph{fontspec}} package under
-LuaTeX and XeTeX, it provides a compatible interface for Greek in text mode.
-
+to get a unified interface for Greek letters and symbols that works in all
+text font encodings, with both, Unicode fonts and the
+\href{http://www.ctan.org/pkg/fontspec}{\emph{fontspec}} package or 8-bit
+fonts and the \href{http://www.ctan.org/pkg/fontenc}{\emph{fontenc}}
+package.
See the source of this document \url{textalpha-doc.tex} for a setup and
usage example, the literate source of the package
\href{textalpha.sty.html}{textalpha.sty} for the implementation, and
-\href{tuenc-greek-doc.pdf}{tuenc-greek-doc.pdf} for
+\href{test-tuenc-greek.pdf}{test-tuenc-greek.pdf} for
\emph{Font setup for Greek with XeTeX/LuaTeX}.
-\subsection{option \texttt{normalize-symbols}}
+\subsection{Options}
+\subsubsection{\texttt{normalize-symbols}}
Mathematical notation uses variant shapes of some Greek letters as
additional symbols. There are separate code points for the symbol variants
in Unicode. TeX supports some of the variant shape symbols in mathematical
-mode ($\theta|\vartheta, \phi|\varphi, \pi|\varpi, \rho|\varrho,
-\epsilon|\varepsilon$) but not in the LGR font encoding used for Greek in
-8-bit TeX.
+mode
+\[
+ \theta|\vartheta, \phi|\varphi, \pi|\varpi, \rho|\varrho,
+ \epsilon|\varepsilon
+\]
+but not in the LGR font encoding used for Greek text
+in 8-bit TeX.
The variations have no syntactic meaning in Greek text and text fonts may
use the variant shapes in place of the “regular” ones as a stylistic choice.
-However, some Greek texts use these GREEK ... SYMBOL characters in place of
+However, some Greek texts use these GREEK ... SYMBOL Unicode literals in place of
the corresponding GREEK LETTER ... characters.
The \texttt{normalize-symbols} option merges letters and symbols to Greek
@@ -76,29 +119,26 @@ letters.
This way, text copied from external sources can be compiled without
errors even if it contains GREEK SYMBOL characters in place of GREEK LETTERS:
\begin{quote}
- This text uses both variants for beta (β|ϐ), theta (θ|ϑ), phi (φ|ϕ), pi
- (π|ϖ), kappa (κ|ϰ), rho (ρ|ϱ), Theta (Θ|ϴ), and epsilon (ε|ϵ) in the LaTeX
- source.
-
- \greekscript
- This text uses both variants for beta (β|ϐ), theta (θ|ϑ), phi (φ|ϕ), pi
- (π|ϖ), kappa (κ|ϰ), rho (ρ|ϱ), Theta (Θ|ϴ), and epsilon (ε|ϵ) in the LaTeX
- source.
+ The source of this text uses both variants for beta (β|ϐ), theta (θ|ϑ),
+ phi (φ|ϕ), pi (π|ϖ), kappa (κ|ϰ), rho (ρ|ϱ), Theta (Θ|ϴ), and epsilon
+ (ε|ϵ) in the LaTeX source.
\end{quote}
+%
+This option is ignored with Unicode fonts.
-\textbf{Attention}: Do not use this option in cases where the distinction
+\begin{description}
+ \item [Attention:] Do not use this option in cases where the distinction
between the symbol variants may be important (e.g. in a mathematical or
-scientific context). Try the \emph{alphabeta} package with the
-respective characters in math mode or use XeTeX/LuaTeX with Unicode fonts in
-these cases.
+scientific context). Try the \href{alphabeta-doc.pdf}{alphabeta} package
+with the respective characters in mathematical mode or use XeTeX/LuaTeX with
+Unicode fonts in these cases.
+\end{description}
-This option is ignored with Unicode fonts.
+\subsubsection{\texttt{keep-semicolon}}
-\subsection{\texttt{keep-semicolon}}
-
-LGR is no ``standard font encoding''. Latin characters and some other ASCII
-symbols are mapped to Greek ``equivalents'' if LGR is the active font
-encoding. (See
+LGR is no \href{http://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{http://mirrors.ctan.org/language/babel/contrib/greek/usage.pdf}{usage.pdf}
for a description of this Latin-Greek transliteration.)
@@ -106,7 +146,7 @@ Special care is required with the question mark characters: The LGR font
encoding uses the Latin question mark as input for the \emph{erotimatiko}
and maps the semicolon to a middle dot (\emph{ano teleia}).
As a result, Unicode-encoded texts that use the semicolon as
-\emph{erotimatiko} end up with an \emph{ano teleia} in its place!
+\emph{erotimatiko} end up with an \emph{ano teleia} in its place!
Without special care, only the deprecated character 037E GREEK QUESTION MARK%
\footnote{The Unicode standard provides the code point 037E GREEK QUESTION MARK
but says character 003B SEMICOLON and not 037E is the preferred
@@ -116,8 +156,8 @@ works with both, Xe/LuaTeX and 8-bit TeX.
The \verb|\textsemicolon| command inserts an \emph{erotimatiko} in LGR and a
semicolon else (i.e. always a character that looks like a semicolon):
\begin{quote}
- Latin (T1) a\textsemicolon{} b,
- Greek (LGR) \ensuregreek{a\textsemicolon{} b}
+ Latin (\latinencoding) a\textsemicolon{} b,
+ Greek (\greekfontencoding) \ensuregreek{a\textsemicolon{} b}
\end{quote}
With the \texttt{keep-semicolon} option, character 003B SEMICOLON can be used
@@ -125,7 +165,7 @@ for the \emph{erotimatiko} also with LGR encoded fonts:
\begin{center}
\begin{tabular}{lll}
- Latin (T1) & Greek (LGR) & question mark character \\
+ Latin (\latinencoding) & Greek (\greekfontencoding) & question mark character \\
\midrule
Τί φήις; & \ensuregreek{Τί φήις;} & 037E GREEK QUESTION MARK \\
Τί φήις; & \ensuregreek{Τί φήις;} & 003B SEMICOLON \\
@@ -133,7 +173,8 @@ for the \emph{erotimatiko} also with LGR encoded fonts:
\end{tabular}
\end{center}
-This option is ignored with Unicode fonts.
+This option is ignored with Unicode fonts (where the SEMICOLON literal
+always prints a semicolon character).
\section{Limitations \label{sec:limitations}}
@@ -156,17 +197,24 @@ or XeTeX/LuaTeX with Unicode fonts.
\subsection{Diacritics}
+Accent macros do not work with Unicode literals as base character
+under 8-bit LaTeX engines. Use the Latin transcription or LICR commands.
+
Composition of diacritics (like \verb|\accdasia\acctonos| or \verb|\<\'|)
fails in other font encodings. Long names (like \verb|\accdasiaoxia|) work.
-With LGR, pre-composed glyphs are chosen if available. In other font
+With LGR and TU, pre-composed glyphs are chosen if available. In other font
encodings, accent macros do not select pre-composed characters. (The
difference is a sub-optimal placement of the accent and becomes obvious if
you drag-and-drop text from the PDF version of this document.):
\begin{quote}
- \ensuregreek{\<'a \accdasia\acctonos a \accdasiaoxia a
- \accdasiaoxia\textalpha} (LGR) vs. \accdasiaoxia\textalpha{} (T1).
+ \ensuregreek{\<'\textalpha
+ \accdasia\acctonos\textalpha
+ \accdasiaoxia\textalpha
+ \accdasiaoxia\textalpha
+ } (\greekfontencoding)
+ vs. \accdasiaoxia\textalpha{} (\latinencoding).
\end{quote}
According to Greek typographical tradition, diacritics (except the
@@ -192,9 +240,9 @@ This fails for accent macros 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
- LGR & \ensuregreek{\'\textAlpha} & \ensuregreek{Ά} \\
- T1 & \'\textAlpha & Ά \\
+ & LICR & Unicode \\ \hline
+ \greekfontencoding & \ensuregreek{\'\textAlpha} & \ensuregreek{Ά} \\
+ \latinencoding & \'\textAlpha & Ά \\
\end{tabular}
\end{quote}
@@ -206,26 +254,32 @@ auto-hiatus feature works in LGR and TU font encodings only:
\acctonos\textalpha\textupsilon{}, \acctonos\textepsilon\textiota{} $\mapsto$
\MakeUppercase{\ensuregreek{
\acctonos\textalpha\textupsilon{}, \acctonos\textepsilon\textiota{}
- }} (LGR) vs.
+ }} (\greekfontencoding) vs.
\MakeUppercase{
\acctonos\textalpha\textupsilon{}, \acctonos\textepsilon\textiota{}%
- } (T1)
+ } (\latinencoding)
\end{quote}
-Currently, the second vowel of the diphthong must be given as macro, not
-Unicode literal if the auto-hiatus feature should work:
+Currently, the auto-hiatus feature should works only reliably with
+LICR commands, not Unicode literals:
\begin{quote}
\ensuregreek{ἀ\textupsilon{}πνία} $\mapsto$
-\ensuregreek{\MakeUppercase{\ensuregreek{ἀ\textupsilon{}πνία}}} (LGR) vs.
-\ensuregreek{\MakeUppercase{\ensuregreek{ἀυπνία}}} (T1).
+\ensuregreek{\MakeUppercase{\ensuregreek{\accpsili{\textalpha}\textupsilon{}πνία}}}
+(OK)
+
+\ensuregreek{ἀ\textupsilon{}πνία} $\mapsto$
+\ensuregreek{\MakeUppercase{\ensuregreek{ἀ\textupsilon{}πνία}}} (OK with LGR)
+
+\ensuregreek{ἀ\textupsilon{}πνία} $\mapsto$
+\ensuregreek{\MakeUppercase{\ensuregreek{ἀυπνία}}} (fail)
\end{quote}
\subsection{Kerning}
-No kerning occurs between Greek characters in non-Greek text due to the
-internal font encoding switch: compare
-\ensuregreek{\textAlpha\textUpsilon\textAlpha} (LGR) to
-\textAlpha\textUpsilon\textAlpha (T1).
+With 8-bit fonts, no kerning occurs between Greek characters in non-Greek
+text due to the internal font encoding switch: compare
+\ensuregreek{\textAlpha\textUpsilon\textAlpha} (\greekfontencoding) to
+\textAlpha\textUpsilon\textAlpha{} (\latinencoding).
Compiling with LuaTeX provides kerning also on font encoding boundaries.
@@ -233,52 +287,55 @@ Compiling with LuaTeX provides kerning also on font encoding boundaries.
\subsection{Greek alphabet}
-Greek letters via Latin transcription in LGR font encoding:
+Greek letters via Latin transcription (works only in LGR font encoding):
\begin{quote}
- \ensuregreek{A B G D E Z H J I K L M N X O P R S T U F Q Y W}\\
\ensuregreek{a b g d e z h j i k l m n x o p r sv c t u f q y w}
-\end{quote}
-\smallskip\noindent
-Greek letters via default macros in other font encoding (here T1):
+ \ensuregreek{A B G D E Z H J I K L M N X O P R S T U F Q Y W}
+\end{quote}
+%
+Greek letters via default macros in the font for Latin script
+(here \latinencoding):
-\begin{quote}
+\newcommand*{\greekAlphabetsample}{
\textAlpha{} \textBeta{} \textGamma{} \textDelta{} \textEpsilon{}
\textZeta{} \textEta{} \textTheta{} \textIota{} \textKappa{}
\textLambda{} \textMu{} \textNu{} \textXi{} \textOmicron{} \textPi{}
\textRho{} \textSigma{} \textTau{} \textUpsilon{} \textPhi{}
\textChi{} \textPsi{} \textOmega{}
- \\
+ }
+\newcommand*{\greekalphabetsample}{
\textalpha{} \textbeta{} \textgamma{} \textdelta{} \textepsilon{}
\textzeta{} \texteta{} \texttheta{} \textiota{} \textkappa{}
\textlambda{} \textmu{} \textnu{} \textxi{} \textomicron{} \textpi{}
\textrho{} \textsigma{} \textvarsigma{} \texttau{} \textupsilon{}
\textphi{} \textchi{} \textpsi{} \textomega{}
-\end{quote}
+}
+\begin{quote}
+ \greekalphabetsample
-\smallskip\noindent
+ \greekAlphabetsample
+\end{quote}
+%
Archaic Greek letters and Greek punctuation
+\newcommand*{\archaicgreeksample}{
+ \textdigamma \textDigamma{}
+ \textkoppa \textKoppa{}
+ \textqoppa \textQoppa{}
+ \textsampi \textSampi{}
+ \textstigma \textvarstigma \textStigma{}
+ \textanoteleia{}
+ \texterotimatiko{}
+ \textdexiakeraia{}
+ \textaristerikeraia{}
+}
+
\begin{quote}
- \textDigamma
- \textanoteleia
- \textQoppa
- \textSampi
- \textStigma
- \textnumeralsigngreek
- \texterotimatiko
- \\
- \textdigamma
- \textkoppa
- \textqoppa
- \textsampi
- \textstigma
- \textnumeralsignlowergreek
- \textvarstigma
+ \archaicgreeksample
\end{quote}
-
-\smallskip\noindent
+%
Diacritics
\begin{quote}
@@ -308,10 +365,10 @@ Diacritics
\accpsilioxia{}
\accpsilivaria{}
%
+ Only in LGR:
\accinvertedbrevebelow{} % == \textsubarch{}
\accbrevebelow{}
-
\end{quote}
\medskip\noindent
@@ -328,6 +385,33 @@ This also works for the new-defined Dasia and Psili shortcuts:
\end{tabbing}
\end{quote}
+\subsubsection{Sigma}
+
+The lower Sigma comes in two variants: \verb|\textsigma| \textsigma{} is
+used inside a word and \verb|\textfinalsigma| \textfinalsigma{} (or
+\verb|\textvarsigma| \textvarsigma{}) at the end of words.
+
+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:
+\ensuregreek{\textautosigma\textautosigma} (\greekfontencoding) and
+\textautosigma{}\textautosigma{} (\latinencoding).
+
+The upper case of both sigma variants is \verb|\textSigma|, the lower case
+of Sigma is \verb|\textautosigma|.
+
+Test: (Unicode literal and \verb|\text...| commands in \greekfontencoding)
+
+σ \textsigma{} ς \textvarsigma{} \textfinalsigma{} \textautosigma{} lowercase
+
+\MakeUppercase{
+σ \textsigma{} ς \textvarsigma{} \textfinalsigma{} \textautosigma{}} MakeUppercase
+
+\ensuregreek{ΣΣ \textSigma\textSigma{}} uppercase
+
+\MakeLowercase{\ensuregreek{ΣΣ \textSigma\textSigma{}}} MakeLowercase
+
\subsection{Greek Unicode characters in non-Greek text}
@@ -337,7 +421,8 @@ 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 font encoding is LGR: \ensuregreek{AΫA}
+Kerning is preserved if the active font encoding supports Greek:
+\ensuregreek{AΫA}
\begin{table}[tbp]
\centerline{
@@ -358,7 +443,8 @@ Kerning is preserved if the font encoding is LGR: \ensuregreek{AΫA}
\end{tabular}
} % end centerline
\caption{Greek and Coptic Unicode Block, input as literal Unicode
- characters in T1 font encoding (legend: ◦ glyph missing in LGR).}
+ characters in \latinencoding{} font encoding
+ (legend: ◦ glyph missing in LGR).}
\label{tab:greek-and-coptic}
\end{table}
@@ -389,13 +475,14 @@ Kerning is preserved if the font encoding is LGR: \ensuregreek{AΫA}
\end{tabular}
} % end centerline
\caption{Greek Extended Unicode Block, input as literal Unicode
-characters in T1 font encoding.}
+characters in \latinencoding{} font encoding.}
\label{tab:greek-extended}
\end{table}
Combined Diacritics work ᾅ, diacritics (except diaeresis) are dropped with
MakeUppercase (μαΐστρος $\mapsto$ \MakeUppercase{μαΐστρος}).
+
\subsection{PDF strings}
With \emph{textalpha} and
@@ -411,4 +498,8 @@ transcription for the Greek word \ensuregreek{logos}. Check the table of
contents in the PDF viewer: LICR macros and Unicode literals work fine, the
Latin transcription remains Latin in the PDF metadata.
+\subsubsection{\greekalphabetsample}
+\subsubsection{\greekAlphabetsample}
+\subsubsection{\archaicgreeksample}
+
\end{document}