diff options
Diffstat (limited to 'language/greek/greek-fontenc/textalpha.sty')
-rw-r--r-- | language/greek/greek-fontenc/textalpha.sty | 177 |
1 files changed, 104 insertions, 73 deletions
diff --git a/language/greek/greek-fontenc/textalpha.sty b/language/greek/greek-fontenc/textalpha.sty index e7ac61e763..851f39dc95 100644 --- a/language/greek/greek-fontenc/textalpha.sty +++ b/language/greek/greek-fontenc/textalpha.sty @@ -16,7 +16,7 @@ \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{textalpha} -[2020/10/30 2.0 macros for Greek letters in text] +[2023/02/28 2.2 macros for Greek letters in text] % .. note:: % @@ -27,29 +27,30 @@ % Changelog: % .. class:: borderless % -% ====== ========== ========================================================= -% 0.1 2010-06-16 initial version -% 0.2 2012-06-27 support for compound Unicode definitions outside LGR -% 0.3 2013-05-03 new accent macro names with ``lgrxenc.def`` 0.7 -% 0.4 2013-05-28 use ``lgrenc.def`` from greek-fontenc. -% 0.5 2013-09-11 move to greek-fontenc_, -% .. support XeTeX/LuaTeX, add breve below accents. -% 0.11 2013-11-28 compatibility with Xe/LuaTeX in 8-bit mode. -% 0.12 2014-12-12 fix auxiliary macro names, -% define symbol macros for breathing accents. -% 0.13 2015-09-04 Option normalize-symbols_: support for symbol variants. -% .. Option keep-semicolon_: use semicolon as erotimatiko -% in LGR. -% 0.13.2 2016-02-05 Support for standard Unicode text font encoding "TU" -% (new in fontspec v2.5a). -% 0.13.4 2019-07-11 Auxiliary command for subscript iota. -% 0.14 2020-02-28 Update test for Unicode fonts. -% Rename ``greek-euenc`` to ``tuenc-greek``. -% Don't use ``\LastDeclaredEncoding``. -% 1.0 2020-09-25 Also set ``\encodingdefault`` with ``\greekscript``. -% 2.0 2020-10-30 Load ``tuenc-greek.def`` with Xe/LuaTeX by default. -% .. Load ``puenc-greek.def`` if used with `hyperref`_. -% ====== ========== ========================================================= +% ====== =========== ======================================================== +% 0.1 2010-06-16 initial version +% 0.2 2012-06-27 support for compound Unicode definitions outside LGR +% 0.3 2013-05-03 new accent macro names with ``lgrxenc.def`` 0.7 +% 0.4 2013-05-28 use ``lgrenc.def`` from greek-fontenc. +% 0.5 2013-09-11 move to greek-fontenc_, +% .. support XeTeX/LuaTeX, add breve below accents. +% 0.11 2013-11-28 compatibility with Xe/LuaTeX in 8-bit mode. +% 0.12 2014-12-12 fix auxiliary macro names, +% define symbol macros for breathing accents. +% 0.13 2015-09-04 Option normalize-symbols_: support for symbol variants. +% .. Option keep-semicolon_: use semicolon as erotimatiko +% in LGR. +% 0.13.2 2016-02-05 Support for standard Unicode text font encoding "TU" +% (new in fontspec v2.5a). +% 0.13.4 2019-07-11 Auxiliary command for subscript iota. +% 0.14 2020-02-28 Update test for Unicode fonts. +% Rename ``greek-euenc`` to ``tuenc-greek``. +% Don't use ``\LastDeclaredEncoding``. +% 1.0 2020-09-25 Also set ``\encodingdefault`` with ``\greekscript``. +% 2.0 2020-10-30 Load ``tuenc-greek.def`` with Xe/LuaTeX by default. +% .. Load ``puenc-greek.def`` if used with `hyperref`_. +% 2.2 2023-02-28 Don't use ``\makeatother`` in ``\AtBeginDocument``. +% ====== =========== ======================================================== % % .. contents:: % @@ -86,9 +87,11 @@ % + natively by XeTeX/LuaTeX for Unicode fonts. % % If 8-bit font encodings like LGR are used alongside Unicode fonts, text -% input can be done via the Latin transcription or LICR but *not via +% input can be done via the Latin transliteration or LICR but *not via % literal Unicode characters* (see test-tuenc-greek.tex_). % +% .. _limitations: +% % .. Attention:: The macros work well in any font encoding for single symbols. % However, with 8-bit TeX engines, the automatic font-encoding switches % behind the doors interfere with kerning between letters and replacement @@ -196,7 +199,7 @@ % Symbol macros for breathings % ---------------------------- % -% In the Latin transcription provided by LGR, breathing accents (Dasia and +% In the Latin transliteration provided by LGR, breathing accents (Dasia and % Psili) are input as < and >. Provide the corresponding NFSS macro accents. % (Used below for LGR, TU, and PU, if these font encodings are defined):: @@ -243,50 +246,55 @@ \ifdefined \UnicodeEncodingName % set by LaTeX for Unicode-aware engines \input{tuenc-greek.def} \textalpha@define@breathings{\UnicodeEncodingName} + \DeclareTextCompositeCommand{\<}{\UnicodeEncodingName}{^^9f}{\LGR@hiatus} + \DeclareTextCompositeCommand{\>}{\UnicodeEncodingName}{^^9f}{\LGR@hiatus} \else - \@ifl@aded{def}{lgrenc}{}{% else - \input{lgrenc.def} + \@ifl@aded{def}{lgrenc} + {} + {\input{lgrenc.def} } - \textalpha@define@breathings{LGR} - % Hiatus feature (see greek-fontenc.def and babel-greek (greek.ldf)) - \DeclareTextCompositeCommand{\<}{LGR}{^^9f}{\LGR@hiatus} - \DeclareTextCompositeCommand{\>}{LGR}{^^9f}{\LGR@hiatus} \fi % LGR may also be used in a document compiled with Xe/LuaTeX -% (enables use of 8-bit TeX fonts and input via the Latin transcription). +% (enables use of 8-bit TeX fonts and input via the Latin transliteration). % Add setup for breathings:: -\@ifl@aded{def}{lgrenc}{ - \textalpha@define@breathings{LGR} - % Hiatus feature (see greek-fontenc.def and babel-greek (greek.ldf)) - \DeclareTextCompositeCommand{\<}{LGR}{^^9f}{\LGR@hiatus} - \DeclareTextCompositeCommand{\>}{LGR}{^^9f}{\LGR@hiatus} -}{} - -% The package hyperref_ defines the PU font encoding which also supports -% (monotonic) Greek. It currently misses polytonic greek, archaic symbols, +\@ifl@aded{def}{lgrenc} + {\textalpha@define@breathings{LGR} + % Hiatus feature (see greek-fontenc.def and babel-greek (greek.ldf)) + \DeclareTextCompositeCommand{\<}{LGR}{^^9f}{\LGR@hiatus} + \DeclareTextCompositeCommand{\>}{LGR}{^^9f}{\LGR@hiatus} + } + {} + +% The package hyperref_ defines the PU font encoding and adds some +% LICR commands for monotonic Greek (in punenc-greekbasick.def). +% Add support for polytonic Greek, archaic symbols, % and the ``\greekscript`` and ``\ensuregreek`` TextCommands:: \AtBeginDocument{ - \@ifl@aded{def}{puenc}{ - \makeatletter % required inside \AtBeginDocument - \input{puenc-greek.def} - \textalpha@define@breathings{PU} - \pdfstringdefDisableCommands{\let\TextOrMath\@firstoftwo} - \makeatother - }{} + \@ifl@aded{def}{puenc} + {\@ifl@aded{def}{puenc-greek} + {}% already loaded (e.g. by babel-greek) + {\edef\RestoreAtCatcode{\catcode`@=\the\catcode`@\relax}% + \makeatletter + \input{puenc-greek.def} + \RestoreAtCatcode + }% + \textalpha@define@breathings{PU} + \pdfstringdefDisableCommands{\let\TextOrMath\@firstoftwo} + } + {} } -% The package textcomp defines the TS1 font encoding with the MICRO SIGN -% named ``\texmu``. Provide the alias ``\textmicro``:: +% The TS1 font encoding (available by default since 2022) provides a +% MICRO SIGN under the name ``\textmu`` but we use this name for the +% GREEK SMALL LETTER MU. +% The new macro ``\textmicro`` selects the character from TS1 fonts +% and is not capitalised with ``\MakeUppercase``:: -\AtBeginDocument{ - \@ifl@aded{def}{ts1enc}{ - \DeclareTextSymbol{\textmicro}{TS1}{181} % micro sign - \DeclareTextSymbolDefault{\textmicro}{TS1} - }{} -} +\DeclareTextSymbol{\textmicro}{TS1}{181} % micro sign +\DeclareTextSymbolDefault{\textmicro}{TS1} % Default declarations % -------------------- @@ -314,7 +322,7 @@ % an alternative definition (see [fntguide_]):: \ProvideTextCommandDefault{\greekscript}{\fontencoding{LGR}\selectfont - \def\encodingdefault{\greekfontencoding}} + \def\encodingdefault{LGR}} % The ``\ensuregreek`` command can be used to ensure that its argument is set in @@ -382,6 +390,7 @@ \DeclareTextSymbolDefault{\textkappa}{LGR} \DeclareTextSymbolDefault{\textlambda}{LGR} \DeclareTextSymbolDefault{\textmu}{LGR} +\DeclareTextSymbolDefault{\textmugreek}{LGR} % (puenc.def) \DeclareTextSymbolDefault{\textnu}{LGR} \DeclareTextSymbolDefault{\textxi}{LGR} \DeclareTextSymbolDefault{\textomicron}{LGR} @@ -418,6 +427,7 @@ \DeclareTextSymbolDefault{\textkoppa}{LGR} % ϟ Greek small letter koppa \DeclareTextSymbolDefault{\textkoppagreek}{LGR} % ϟ (puenc.def) \DeclareTextSymbolDefault{\textKoppa}{LGR} % ϟ Greek letter koppa (numeral koppa) +\DeclareTextSymbolDefault{\textKoppagreek}{LGR} % ϟ (puenc.def) \DeclareTextSymbolDefault{\textqoppa}{LGR} % ϙ (archaic koppa) \DeclareTextSymbolDefault{\textQoppa}{LGR} % Ϙ (archaic Koppa) \DeclareTextSymbolDefault{\textStigma}{LGR} % Ϛ ϹΤ ligature in some fonts @@ -500,8 +510,8 @@ % Postfix accents:: -\DeclareTextSymbolDefault{\ypogegrammeni}{LGR} % "small" sub-iota -\DeclareTextSymbolDefault{\prosgegrammeni}{LGR} % "capital" sub-iota +\DeclareTextSymbolDefault{\ypogegrammeni}{LGR} % subscript mute iota (combining) +\DeclareTextSymbolDefault{\prosgegrammeni}{LGR} % adscript mute iota (spacing) % Other accents in LGR:: @@ -540,22 +550,43 @@ \fi - +% TODO +% ==== +% +% * Load ``lgrenc.def`` rsp. ``tuenc-greek.def`` after the common definitions +% and after ``puenc-greek.def``? +% +% If an encoding-specific command is defined for more than one encoding, +% then it will execute fastest in the encoding in which it was defined +% last since its top-level definition will be set up to execute in that +% encoding without any overhead. +% +% ... +% +% For the same reason default declarations should never come last since +% they are implemented as a special encoding themselves (with the name ?). +% Specifying them last would simply mean to make those encoding-specific +% commands equally inefficient in all encodings. +% +% -- source2e.pdf, chapter "ltoutenc.dtx", +% subsection "The order of declarations". +% +% % .. References % ---------- % .. _LaTeX Project Public License: http://www.latex-project.org/lppl.txt -% .. _CB fonts: http://ctan.org/pkg/cbgreek-complete -% .. _babel: http://ctan.org/pkg/babel +% .. _CB fonts: https://ctan.org/pkg/cbgreek-complete +% .. _babel: https://ctan.org/pkg/babel % .. _e-TeX: http://www.tex.ac.uk/cgi-bin/texfaq2html?label=etex -% .. _fontenc: http://ctan.org/pkg/fontenc -% .. _fontspec: http://ctan.org/pkg/fontspec -% .. _fntguide: http://mirror.ctan.org/macros/latex/base/fntguide.pdf -% .. _greek-fontenc: http://ctan.org/pkg/greek-fontenc -% .. _greek-inputenc: http://ctan.org/pkg/greek-inputenc -% .. _hyperref: http://ctan.org/pkg/hyperref -% .. _inputenc: http://ctan.org/pkg/inputenc -% .. _polyglossia: http://ctan.org/pkg/polyglossia -% .. _textgreek: http://ctan.org/pkg/textgreek -% .. _xunicode: http://ctan.org/pkg/xunicode +% .. _fontenc: https://ctan.org/pkg/fontenc +% .. _fontspec: https://ctan.org/pkg/fontspec +% .. _fntguide: https://mirrors.ctan.org/macros/latex/base/fntguide.pdf +% .. _greek-fontenc: https://ctan.org/pkg/greek-fontenc +% .. _greek-inputenc: https://ctan.org/pkg/greek-inputenc +% .. _hyperref: https://ctan.org/pkg/hyperref +% .. _inputenc: https://ctan.org/pkg/inputenc +% .. _polyglossia: https://ctan.org/pkg/polyglossia +% .. _textgreek: https://ctan.org/pkg/textgreek +% .. _xunicode: https://ctan.org/pkg/xunicode % % .. _erotimatiko: https://en.wikipedia.org/wiki/Question_mark#Erotimatiko |