summaryrefslogtreecommitdiff
path: root/language/greek/greek-fontenc/alphabeta-doc.tex
diff options
context:
space:
mode:
Diffstat (limited to 'language/greek/greek-fontenc/alphabeta-doc.tex')
-rw-r--r--language/greek/greek-fontenc/alphabeta-doc.tex199
1 files changed, 111 insertions, 88 deletions
diff --git a/language/greek/greek-fontenc/alphabeta-doc.tex b/language/greek/greek-fontenc/alphabeta-doc.tex
index 4a69d5a464..618713a127 100644
--- a/language/greek/greek-fontenc/alphabeta-doc.tex
+++ b/language/greek/greek-fontenc/alphabeta-doc.tex
@@ -14,13 +14,20 @@
\documentclass{article}
\usepackage[unicode,colorlinks=true,linkcolor=blue]{hyperref}
-\usepackage{bookmark}
+% \usepackage{bookmark}
\hypersetup{colorlinks=true,linkcolor=blue,urlcolor=blue,pdfencoding=auto}
% \usepackage{parskip}
-\usepackage{amsmath}
+\usepackage{amssymb, amsmath}
\frenchspacing
-\newcommand{\setupUnicodeFonts}{
+\ifdefined \UnicodeEncodingName % set by LaTeX for Unicode-aware engines
+ \ifdefined\XeTeXrevision
+ \newcommand{\engine}{XeTeX}
+ \fi
+ \ifdefined\luatexversion
+ \newcommand{\engine}{LuaTeX}
+ \fi
+ % Setup for Unicode fonts (Xe-/LuaTeX)
\usepackage[no-math,tuenc]{fontspec}
\setmainfont{Linux Libertine O}
\setsansfont{Linux Biolinum O}
@@ -28,8 +35,10 @@
\usepackage[libertine,slantedGreek]{newtxmath}
% \usepackage{unicode-math} % package conflict
\newcommand{\fontset}{fontspec with Unicode fonts}
-}
-\newcommand{\setupTeXFonts}{
+\else
+ \newcommand{\engine}{8-bit TeX}
+ \usepackage[utf8]{inputenc}
+ \DeclareUnicodeCharacter{03DE}{\textKoppa} % in LGR mapped to \textkoppa
\usepackage[LGR,T1]{fontenc}
\usepackage{textcomp}
\usepackage{lmodern}
@@ -41,18 +50,7 @@
% \substitutefont{LGR}{\rmdefault}{artemisia}
\usepackage{isomath}
\newcommand{\fontset}{fontenc with TeX fonts}
-}
-\ifdefined\XeTeXrevision
- \newcommand{\engine}{XeTeX}
- \setupUnicodeFonts
-\else\ifdefined\luatexversion
- \newcommand{\engine}{LuaTeX}
- \setupUnicodeFonts
-\else
- \newcommand{\engine}{8-bit TeX}
- \usepackage[utf8]{inputenc}
- \setupTeXFonts
-\fi\fi
+\fi
% load alphabeta after math setup and encoding setup!
% \usepackage{alphabeta}[2015/08/08]
@@ -60,12 +58,13 @@
% Fallback macros:
+\newcommand*{\missing}{\ensuremath{\oslash}}
% varstigma only defined with 8-bit LGR fonts
-\providecommand*{\varstigma}{$\oslash$}
-% varkappa, only defined with newtxmath, other var... only with unicode-math
-\providecommand*{\varkappa}{\oslash}
-\providecommand*{\varbeta}{\oslash}
-\providecommand*{\varTheta}{\oslash}
+\ProvideTextCommandDefault{\textvarstigma}{\missing}
+% varkappa, only defined with newtxmath
+\providecommand*{\varkappa}{\missing}
+% varbeta and varTheta only defined with unicode-math
+\providecommand*{\varbeta}{\missing}
% print current font encoding:
\makeatletter
@@ -76,6 +75,7 @@
\title{The \emph{alphabeta} package}
\author{Günter Milde}
+\date{2020/10/30}
\maketitle
\begin{abstract}\noindent
@@ -87,11 +87,24 @@ the characters are taken from the text or math font.
With 8-bit TeX and
\emph{\href{http://www.ctan.org/pkg/greek-inputenc}{greek-inputenc}},
literal Unicode charactes can also be used in mathematical mode.
+\footnote{
+ This document was compiled using the \href{https://ctan.org/pkg/encguide}%
+ {font encoding} \encodingdefault{}
+ \ifdefined \UTFencname % defined by fontspec
+ (Unicode fonts).
+ For a version using 8-bit fonts, see
+ \href{alphabeta-doc.pdf}{alphabeta-doc.pdf}.
+ \else
+ (8-bit fonts).
+ For a version using Unicode fonts, see
+ \href{alphabeta-tu.pdf}{alphabeta-tu.pdf}.
+ \fi
+}
\end{abstract}
% \tableofcontents
-\section{Requirements}
+\section{Requirements and Conflicts}
The \emph{alphabeta} package depends on
\emph{\href{textalpha-doc.pdf}{textalpha}} (both are part of
@@ -143,14 +156,14 @@ usage example.
\subsection{options}
-Package options are passed to the \href{alphabeta-doc.pdf}{\emph{alphabeta}}
+Package options are passed to the \href{textalpha-doc.pdf}{\emph{textalpha}}
package. Example call with options:
\begin{verbatim}
\usepackage[normalize-symbols,keep-semicolon]{alphabeta}
\end{verbatim}
-\texttt{normalize-symbols} merges ``letters'' and ``symbol`` variants of
+\texttt{normalize-symbols} merges ``letter'' and ``symbol`` variants of
some Greek letters to the ``letter'' character:
\footnote{The normalize-symbols option was added in version 0.13 (2015-08-03).
Unicode input of the symbol variants requires at least version~1.6
@@ -165,8 +178,9 @@ symbol variants may be important (e.g. in a mathematical or scientific
context). Use XeTeX/LuaTeX with Unicode fonts or the respective characters
in mathematical mode (e.g. $\pi$ vs. $\varpi$).
-The option \texttt{keep-semicolon} prevents conversion of the semicolon to
-an \emph{ano teleia} (see \emph{\href{textalpha-doc.pdf}{textalpha-doc}}).
+The option \texttt{keep-semicolon} prevents conversion of the
+semicolon to an \emph{ano teleia} in 8-bit TeX
+(see \emph{\href{textalpha-doc.pdf}{textalpha-doc}}).
\subsection{symbol variants}
@@ -179,10 +193,10 @@ Unicode defines separate code points for the symbol variants. TeX supports
some of the variant shape symbols in mathematical mode, but its concept of
“standard” vs. “variant” symbols differs from the distinction between
“GREEK LETTER ...” vs. “GREEK ... SYMBOL” in the Unicode standard.
-See \href{tuenc-greek-doc.pdf}{tuenc-greek-doc}.
The \emph{alphabeta} package defines generic macros for these variants that
-are short forms of the set defined in \texttt{tuenc-greek.def}:
+are short forms of the set defined in \texttt{tuenc-greek.def}
+(cf. \href{test-tuenc-greek.pdf}{test-tuenc-greek}):
\begin{quote}
\verb|\<name>| selects the Unicode GREEK LETTER ... variant,
@@ -199,6 +213,9 @@ See Table \ref{tab:symbol-variant-macros} for the full list.
With 8-bit TeX, the limitations described in the
\href{textalpha-doc.pdf}{textalpha documentation} apply. See also the tests
in section \hyperref[sec:8-bit-limitations]{8 bit limitations}.
+These limitations are lifted, if the text language is switched to ``greek''
+with Babel, the text part is wrapped in \verb+\ensuregreek+, or the
+document is compiled with XeTeX/LuaTeX.
With XeTeX/LuaTeX and Unicode fonts, literal Unicode characters cannot be
used in formulas (the log file reports missing characters) This is a generic
@@ -213,7 +230,7 @@ However, \emph{unicode-math} conflicts with \emph{alphabeta}.
\subsection{Greek alphabet}
Greek letters via generic ``name'' macros without language/font-encoding
-switch:
+switch (active font encoding \encodingdefault):
\begin{quote}
\Alpha{} \Beta{} \Gamma{} \Delta{} \Epsilon{} \Zeta{} \Eta{} \Theta{}
@@ -225,19 +242,23 @@ switch:
\sigma{} \varsigma{} \tau{} \upsilon{} \phi{} \chi{} \psi{} \omega{}
\\
\digamma{} \Digamma{} \stigma{} \varstigma{}%
- \footnote{There is no separate Unicode code point for a stigma variant
- symbol, \texttt{\textbackslash varstigma} is not defined with
- Xe/LuaTeX and similar to \texttt{\textbackslash stigma} in some fonts.}
- \koppa{} \qoppa{} \Qoppa{}
- \Stigma{} \Sampi{} \sampi{}
+ \footnote{There is no separate Unicode code point for a stigma variant
+ symbol, \texttt{\textbackslash varstigma} is not defined with
+ Xe/LuaTeX and similar to \texttt{\textbackslash stigma} in some fonts.}
+ \koppa{} \Koppa{}%
+ \footnote{In LGR, there is no separate code point for Koppa as
+ typographical practice normally does not observe a
+ contrast between uppercase and lowercase forms for numeric koppa.}
+ % https://en.wikipedia.org/wiki/Koppa_(letter)
+ \qoppa{} \Qoppa{} \Stigma{} \Sampi{} \sampi{}
\end{quote}
%
-Greek letters via Unicode input without language/font-encoding switch:
+Greek letters via Unicode (active font encoding \encodingdefault):
\begin{quote}
Α Β Γ Δ Ε Ζ Η Θ Ι Κ Λ Μ Ν Ξ Ο Π Ρ Σ Τ Υ Φ Χ Ψ Ω\\
α β γ δ ε ζ η θ ι κ λ μ ν ξ ο π ρ σ ς τ υ φ χ ψ ω\\
- ϝ Ϝ ϛ ϟ ϙ Ϙ Ϛ Ϡ ϡ
+ ϝ Ϝ ϛ ϟ Ϟ ϙ Ϙ Ϛ Ϡ ϡ
\end{quote}
\subsection{Diacritics}
@@ -270,9 +291,9 @@ variants of some Greek letters to the ``letter'' character. It is ignored,
if the document uses Unicode fonts and is compiled with XeTeX or LuaTeX.
(This document is compiled using \engine.)
\begin{quote}
- This quote uses both variants for beta (β|ϐ), theta (θ|ϑ), phi (φ|ϕ), pi
- (π|ϖ), kappa (κ|ϰ), rho (ρ|ϱ), Theta (Θ|ϴ), and epsilon (ε|ϵ) in the LaTeX
- source.%
+ The source of this quote uses both variants for beta (β|ϐ),
+ epsilon (ε|ϵ), phi (φ|ϕ), kappa (κ|ϰ), pi (π|ϖ), rho (ρ|ϱ), theta (θ|ϑ),
+ and Theta (Θ|ϴ) in the LaTeX source.%
\end{quote}
@@ -284,22 +305,23 @@ With the alphabeta package, you get Greek letters in both, the document body
and PDF metadata generated by hyperref if the input uses Unicode literals or
macros. Wrapping in \verb+\ensuregreek+ ensures the right placement of the
accents and breathings (before, not above capital letters). With LICR input
-(accent macros + symbol macros), non-standard diacritics are missing in the
-PDF data, as hyperref's PU encoding currently does not support polytonic
-Greek. (Here, the dasia is dropped at the start of the word in parentheses in
-the PDF toc. The warning ``\texttt{Glyph not defined in PU encoding,
-removing `\textbackslash<' on input line 145.}'' is written to the log.)
+(accent macros as well as symbol macros), non-standard diacritics are
+missing in the PDF data, as hyperref's PU encoding currently does not
+support polytonic Greek. (Here, the dasia is dropped at the start of the
+word in parentheses in the PDF toc. The warning ``\texttt{Glyph not defined
+in PU encoding, removing `\textbackslash<' on input line 145.}'' is written
+to the log.)
-\subsection{Greek in math $\Gamma = \sin\alpha / \cos{\beta}$}
+\subsection{Greek in maths $\Gamma = \sin\alpha / \cos{\beta}$}
In the main document, Greek in math mode should work as usual:
\[\Gamma = \frac{\sin\alpha}{\cos{\beta}}.
\]
-
-Greek letters and symbols in math input as macro (there are no math macros
-for Greek letters wich exist with similar shape in the Latin alphabet):
+Greek letters and symbols in math input as macro:%
+\footnote{There are no math macros for Greek letters wich exist with similar
+shape in the Latin alphabet}
\begin{align*}
&
% \Alpha{} \Beta{}
@@ -327,7 +349,7 @@ for Greek letters wich exist with similar shape in the Latin alphabet):
\\&
\vartheta \varphi \varpi \digamma{} \varrho \varepsilon
\end{align*}
-
+%
PDF strings do not know math mode. The content of a formula or equation is
evaluated in text mode with non-valid commands discarded (and warnings
written to the log). This works resonably well for simple formulas (but not,
@@ -339,7 +361,7 @@ also for Greek letters.
With the \texttt{utf8} option of \emph{inputenc} and
\href{http://www.ctan.org/pkg/greek-inputenc}{\emph{greek-inputenc}},
literal Greek Unicode characters are supported also in
-mathematical mode:
+mathematical mode.
\ifdefined\DeclareUnicodeCharacter
\[
@@ -347,26 +369,22 @@ mathematical mode:
\]
Greek letters and symbols in math input as Unicode literals:
\begin{align*}
- & Γ ΔΘΛΞΠΣΥ ΦΨ Ω \\
+ & Γ ΔΘΛΞΠΣΥ ΦΨ Ω \\
& αβγδεζηθικλμνξπρσςτυφχψω \\
- & ϑϕϖϝϱϵ
+ & ϑϕϖϝϱϵ
\end{align*}
\fi
This does not work with XeTeX/LuaTeX (unless in 8-bit emulation mode).
-
-The ``normal'' vs. ``variant'' shape of phi and epsilon is inverted when using
-traditional makros or Unicode letter vs. symbol characters respectively.
-This is to keep backwards compatibility of the math macros as well
-as consistent input-output mapping for Unicode in text and math.
-It corresponds to the behaviour of
-\href{http://www.ctan.org/pkg/unicode-math}{\emph{unicode-math}}
-with the default option \texttt{vargreek-shape=TeX}.
+The ``normal'' vs. ``variant'' shape of letters is used so that the output
+matches the Unicode reference glyph (cf. Table
+\ref{tab:symbol-variant-macros}). This corresponds to the behaviour of
+\href{http://www.ctan.org/pkg/unicode-math}{\emph{unicode-math}}.
\subsection{8-bit limitations \label{sec:8-bit-limitations}}
-These limitations are lifted, if the document is compiled with XeTeX/LuaTeX.
+Certain limitations apply if Greek symbols are used in non-Greek context.
\begin{itemize}
@@ -390,16 +408,16 @@ These limitations are lifted, if the document is compiled with XeTeX/LuaTeX.
\item There is no kerning between Greek letters, if the font encoding does not
support Greek: compare \ensuregreek{\Alpha\Upsilon\Alpha{}
(\currentEncoding)} to \Alpha\Upsilon\Alpha{} (\currentEncoding).
- Because of this (and for proper hyphenation), use of the Babel package
- and correct language setting is recommended for Greek quotes.
-
\end{itemize}
-
+%
The \verb+\ensuregreek+ macro ensures that the argument is typeset with a
font encoding supporting Greek. This keeps kerning (if the kerning pair is
inside the argument, \ensuregreek{\Alpha\"\Upsilon\Alpha}), and allows
combining of accent macros where pre-composed characters are selected
(\ensuregreek{\<'\alpha}).
+Setting the corrct language for Greek quotes with the \emph{Babel} package
+additionally ensures correct hyphenation .
+
\begin{table}[bp]
\centering
@@ -407,17 +425,9 @@ combining of accent macros where pre-composed characters are selected
\hline
macro & text & math \\
\hline
- \verb$\pi$ & \pi & $\pi$ \\
- \verb$\varpi$ & \varpi & $\varpi$ \\
- \verb$\pisymbol$ & \pisymbol & $\pisymbol$ \\
- \hline
- \verb$\rho$ & \rho & $\rho$ \\
- \verb$\varrho$ & \varrho & $\varrho$ \\
- \verb$\rhosymbol$ & \rhosymbol & $\rhosymbol$ \\
- \hline
- \verb$\theta$ & \theta & $\theta$ \\
- \verb$\vartheta$ & \vartheta & $\vartheta$ \\
- \verb$\thetasymbol$ & \thetasymbol & $\thetasymbol$ \\
+ \verb$\beta$ & \beta & $\beta$ \\
+ \verb$\varbeta$ & \varbeta & $\varbeta$ \\
+ \verb$\betasymbol$ & \betasymbol & $\betasymbol$ \\
\hline
\verb$\epsilon$ & \epsilon & $\epsilon$ \\
\verb$\varepsilon$ & \varepsilon & $\varepsilon$ \\
@@ -427,23 +437,36 @@ combining of accent macros where pre-composed characters are selected
\verb$\varphi$ & \varphi & $\varphi$ \\
\verb$\phisymbol$ & \phisymbol & $\phisymbol$ \\
\hline
- \verb$\beta$ & \beta & $\beta$ \\
- \verb$\varbeta$ & \varbeta & $\varbeta$ \\
- \verb$\betasymbol$ & \betasymbol & $\betasymbol$ \\
- \hline
\verb$\kappa$ & \kappa & $\kappa$ \\
\verb$\varkappa$ & \varkappa & $\varkappa$ \\
- \verb$\kappasymbol$ & \kappasymbol & $\kappasymbol$\\
+ \verb$\kappasymbol$ & \kappasymbol & $\kappasymbol$ \\
+ \hline
+ \verb$\pi$ & \pi & $\pi$ \\
+ \verb$\varpi$ & \varpi & $\varpi$ \\
+ \verb$\pisymbol$ & \pisymbol & $\pisymbol$ \\
+ \hline
+ \verb$\rho$ & \rho & $\rho$ \\
+ \verb$\varrho$ & \varrho & $\varrho$ \\
+ \verb$\rhosymbol$ & \rhosymbol & $\rhosymbol$ \\
+ \hline
+ \verb$\sigma$ & \sigma & $\sigma$ \\
+ \verb$\varsigma$ & \varsigma & $\varsigma$ \\
+ \verb$\finalsigma$ & \finalsigma & $\finalsigma$ \\
+ \hline
+ \verb$\theta$ & \theta & $\theta$ \\
+ \verb$\vartheta$ & \vartheta & $\vartheta$ \\
+ \verb$\thetasymbol$ & \thetasymbol & $\thetasymbol$ \\
\hline
\verb$\Theta$ & \Theta & $\Theta$ \\
- \verb$\varTheta$ & & $\varTheta$ \\
- \verb$\Thetasymbol$ & \Thetasymbol & \\
+ \verb$\varTheta$ & \missing & $\varTheta$ \\
+ \verb$\Thetasymbol$ & \Thetasymbol & \missing \\
\hline
\end{tabular}
- \caption{Macros for Greek symbol variants ($\oslash$ = symbol missing).
- With 8-bit TeX and the \texttt{normalize-symbols} option, the output for
- both variants in text mode is the same (8-bit Greek text fonts contain
- only one symbol variant). \label{tab:symbol-variant-macros}}
+ \caption{Macros for Greek symbol variants (\missing = symbol only
+ available with additional packages).
+ With 8-bit TeX and the \texttt{normalize-symbols} option, the output for
+ both variants in text mode is the same (8-bit Greek text fonts contain
+ only one symbol variant). \label{tab:symbol-variant-macros}}
\end{table}
\end{document}