diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/lgrx/textalpha.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/lgrx/textalpha.sty | 163 |
1 files changed, 96 insertions, 67 deletions
diff --git a/Master/texmf-dist/tex/latex/lgrx/textalpha.sty b/Master/texmf-dist/tex/latex/lgrx/textalpha.sty index 86741a240ee..be762209959 100644 --- a/Master/texmf-dist/tex/latex/lgrx/textalpha.sty +++ b/Master/texmf-dist/tex/latex/lgrx/textalpha.sty @@ -14,7 +14,7 @@ \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{textalpha} -[2012/07/03 v0.2 macros for Greek letters in text] +[2013/05/03 v0.3 macros for Greek letters in text] % This package is part of the lgrx_ bundle. % @@ -30,47 +30,44 @@ % ========== ===== ========================================================= % 2010-06-16 0.1 initial version % 2012-06-27 0.2 support for compound Unicode definitions outside LGR +% 2013-05-03 0.3 new accent macro names with lgrxenc.def 0.7 % ========== ===== ========================================================= % % Motivation % ========== % -% By default, macros for Greek letters +% By default, TeX macros for Greek letters % % * are only valid in mathematical mode, % * do not change shape (default shape is italic). % -% In Greek text fonts with the LGR font encoding, letters are -% accessible by a Latin transcription. +% In Greek text fonts with the LGR font encoding, letters are accessible by a +% Latin transcription or, with lgrx_, ``\textalpha`` -- ``\textOmega`` +% LICR macros. % -% This package provides a set of macros that can be used to access Greek -% symbols from a font in LGR encoding (e.g. the `CB fonts`_) without the -% need for an explicite font-encoding switch. +% This package declares the LGR font encoding as default for Greek LICR +% macros. After loading it, symbols from a Greek text font (e.g. the `CB +% fonts`_) can be accessed without the need for an explicite font-encoding +% switch. % -% The macro names follow the established scheme to prepend ``\text*`` to -% the Adobe glyph name (if it exists) or the corresponding math-macro, so -% ``\textalpha`` -- ``\textOmega`` prints α – Ω. +% * In combination with the ``\text`` macro from amsmath, this can be used to +% get matching upright and bold upright Greek symbols in math mode. % -% * In combination with the ``\text`` macro from amsmath, this can be -% used to get matching upright and bold upright Greek symbols in math -% as well. -% -% * In combination with ``\usepackage[utf8]{inputenc}`` and the -% accompanying ``lgrenc.dfu`` file, Unicode input of Greek characters -% is supported. -% -% This is done using NFSS default definitions as explained in the -% fntguide_ (section 5.3). +% * In combination with ``\usepackage[utf8]{inputenc}`` and the accompanying +% ``lgrenc.dfu`` file, Unicode input of Greek characters is supported. % % Attention -% While the macros work reasonably well for single letters, the automatic -% font-encoding switches behind the doors interferes with the kerning -% between the letters and replacement of accent+character with a -% pre-composed character. +% While the font-encoding independent macros work reasonably well for single +% symbols, the automatic font-encoding switches behind the doors interferes +% with the kerning between letters and replacement of accent+character +% with a pre-composed character. % % Therefore, Greek text should be written with the help of babel_, setting % the language to either ``greek`` or ``polutonikogreek`` or wrapped in the -% provided ``\TextGreek`` macro. +% provided ``\ensuregreek`` macro. +% +% The package uses NFSS default definitions as explained in the fntguide_ +% (section 5.3). % % % Implementation @@ -83,14 +80,14 @@ \input{lgrxenc.def} -% TextGreek -% --------- +% ensuregreek +% ----------- % -% The ``\TextGreek`` command can be used to ensure that its argument is set in +% The ``\ensuregreek`` command can be used to ensure that its argument is set in % a font encoding with support for Greek. We define LGR as default encoding for % Greek text:: -\DeclareTextCommandDefault{\TextGreek}[1]{{\fontencoding{LGR}\selectfont #1}} +\DeclareTextCommandDefault{\ensuregreek}[1]{{\fontencoding{LGR}\selectfont #1}} % .. The [fntguide_] writes % @@ -98,24 +95,29 @@ % one-argument encoding-specific command, not just those defined with % ``\DeclareTextAccent``. % -% However, the simpler alternative: -% ``\DeclareTextAccentDefault{\TextGreek}{LGR}`` this fails with the table -% of Unicode characters in the test document `<textalpha-test.tex>`__: +% However, the simpler alternative +% ``\DeclareTextAccentDefault{\ensuregreek}{LGR}`` fails with the table of +% Unicode characters in the test document `<textalpha-test.tex>`__: % % ``! You can't use a prefix with `end-group character }'.`` % -% Font encodings supporting Greek script (e.g. LGI) may declare a specific -% text command that passes the argument unchanged. This way, kerning and -% selection of precomposed glyphs work also for cases like -% ``\TextGreek{\'A}U``. -% -% .. Do this for PU here? ``\DeclareTextCommand{\TextGreek}{PU}[1]{#1}`` +% Eventually, all font encodings supporting Greek script (e.g. LGI, PU, EU1, +% EU2) will declare ``\ensuregreek`` as text command that passes the argument +% unchanged. This way, kerning and selection of precomposed glyphs would work +% also for cases like ``\ensuregreek{\'A}U``. % -% Rather not: Not required, as hyperref's PDF string preparation -% ignores unknown commands. Can lead to infinite recursion (``TeX capacity -% exeeded``) without the ``unicode=true`` hyperref option.: +% .. Do this for PU here? ``\DeclareTextCommand{\ensuregreek}{PU}[1]{#1}`` % +% Can lead to infinite recursion (``TeX capacity exeeded``) without the +% ``unicode=true`` hyperref option. +% (How about a test whether the PU font encoding is defined?). % +% Backwards compatibility definition: versions < 0.3 used the macro +% name ``\TextGreek``:: + +\DeclareTextCommandDefault{\TextGreek}[1]{{\fontencoding{LGR}\selectfont #1}} + + % Greek Alphabet % -------------- % @@ -165,6 +167,8 @@ \DeclareTextSymbolDefault{\textrho}{LGR} \DeclareTextSymbolDefault{\textsigma}{LGR} \DeclareTextSymbolDefault{\textvarsigma}{LGR} +\DeclareTextSymbolDefault{\textfinalsigma}{LGR} % alias for \textvarsigma +\DeclareTextSymbolDefault{\textautosigma}{LGR} % char 115 in LGR \DeclareTextSymbolDefault{\texttau}{LGR} \DeclareTextSymbolDefault{\textupsilon}{LGR} \DeclareTextSymbolDefault{\textphi}{LGR} @@ -175,6 +179,9 @@ % Additional Greek symbols % """""""""""""""""""""""" % +% Including alias names for compatibility with hyperref's puenc.def and babel's +% greek.ldf. +% % Ancient Greek Numbers (Athenian Numerals):: \DeclareTextSymbolDefault{\PiDelta}{LGR} % GREEK ACROPHONIC ATTIC FIFTY @@ -203,19 +210,18 @@ \DeclareTextSymbolDefault{\anoteleia}{LGR} % · \DeclareTextSymbolDefault{\erotimatiko}{LGR} % ; % \digamma used by amsmath! +\DeclareTextSymbolDefault{\textdigamma}{LGR} % ϝ (LGRx) +\DeclareTextSymbolDefault{\textDigamma}{LGR} % Ϝ \DeclareTextSymbolDefault{\ddigamma}{LGR} % ϝ (greek.ldf) \DeclareTextSymbolDefault{\Digamma}{LGR} % Ϝ -\DeclareTextSymbolDefault{\textdigamma}{LGR} % ϝ alias using "text" prefix -\DeclareTextSymbolDefault{\textDigamma}{LGR} % Ϝ alias using "text" prefix \DeclareTextSymbolDefault{\textdigammagreek}{LGR} % ϝ (puenc.def) \DeclareTextSymbolDefault{\textDigammagreek}{LGR} % Ϝ (puenc.def) % numeral signs: http://en.wikipedia.org/wiki/Greek_numerals \DeclareTextSymbolDefault{\anwtonos}{LGR} % ʹ (Dexia keraia) \DeclareTextSymbolDefault{\katwtonos}{LGR} % ͵ (Aristeri keraia) -% alias names for compatibility with hyperref's puenc.def: -\DeclareTextSymbolDefault{\textnumeralsigngreek}{LGR} -\DeclareTextSymbolDefault{\textnumeralsignlowergreek}{LGR} +\DeclareTextSymbolDefault{\textnumeralsigngreek}{LGR} % (puenc.def) +\DeclareTextSymbolDefault{\textnumeralsignlowergreek}{LGR} % (puenc.def) % Diacritics % ---------- @@ -223,42 +229,65 @@ % Diacritics are defined via "named" macros in ``lgrxenc.def``. Make them % default in any encoding:: -\DeclareTextAccentDefault{\Dasia}{LGR} -\DeclareTextAccentDefault{\Psili}{LGR} -\DeclareTextAccentDefault{\Tonos}{LGR} -\DeclareTextAccentDefault{\Varia}{LGR} -\DeclareTextAccentDefault{\Perispomeni}{LGR} -\DeclareTextAccentDefault{\Dialytika}{LGR} +\DeclareTextAccentDefault{\accdasia}{LGR} +\DeclareTextAccentDefault{\accpsili}{LGR} +\DeclareTextAccentDefault{\acctonos}{LGR} +\DeclareTextAccentDefault{\accvaria}{LGR} +\DeclareTextAccentDefault{\accperispomeni}{LGR} +\DeclareTextAccentDefault{\accdialytika}{LGR} \DeclareTextAccentDefault{\<}{LGR} \DeclareTextAccentDefault{\>}{LGR} % -\DeclareTextAccentDefault{\DasiaOxia}{LGR} -\DeclareTextAccentDefault{\DasiaVaria}{LGR} -\DeclareTextAccentDefault{\DasiaPerispomeni}{LGR} -\DeclareTextAccentDefault{\PsiliOxia}{LGR} -\DeclareTextAccentDefault{\PsiliVaria}{LGR} -\DeclareTextAccentDefault{\PsiliPerispomeni}{LGR} -\DeclareTextAccentDefault{\DialytikaTonos}{LGR} -\DeclareTextAccentDefault{\DialytikaVaria}{LGR} -\DeclareTextAccentDefault{\DialytikaPerispomeni}{LGR} +\DeclareTextAccentDefault{\accdasiaoxia}{LGR} +\DeclareTextAccentDefault{\accdasiavaria}{LGR} +\DeclareTextAccentDefault{\accdasiaperispomeni}{LGR} +\DeclareTextAccentDefault{\accpsilioxia}{LGR} +\DeclareTextAccentDefault{\accpsilivaria}{LGR} +\DeclareTextAccentDefault{\accpsiliperispomeni}{LGR} +\DeclareTextAccentDefault{\accdialytikatonos}{LGR} +\DeclareTextAccentDefault{\accdialytikavaria}{LGR} +\DeclareTextAccentDefault{\accdialytikaperispomeni}{LGR} % Postfix accents:: -\DeclareTextSymbolDefault{\Ypogegrammeni}{LGR} % "small" sub-iota -\DeclareTextSymbolDefault{\Prosgegrammeni}{LGR} % "capital" sub-iota +\DeclareTextSymbolDefault{\ypogegrammeni}{LGR} % "small" sub-iota +\DeclareTextSymbolDefault{\prosgegrammeni}{LGR} % "capital" sub-iota -% Auxiliary commands -% ------------------ +% Auxiliary macros +% ---------------- % -% ``\MakeUppercase`` requires some internal commands:: +% ``\MakeUppercase`` requires two internal commands:: \DeclareTextAccentDefault{\@hiatus}{LGR} -\DeclareTextAccentDefault{\up@Dialytika}{LGR} +\DeclareTextAccentDefault{\@Dialytika}{LGR} + +% Backwards compatibility with LGRx versions < 0.7:: + +\DeclareTextSymbolDefault{\Ypogegrammeni}{LGR} +\DeclareTextSymbolDefault{\Prosgegrammeni}{LGR} +\DeclareTextAccentDefault{\Dasia}{LGR} +\DeclareTextAccentDefault{\Psili}{LGR} +\DeclareTextAccentDefault{\Tonos}{LGR} +\DeclareTextAccentDefault{\Varia}{LGR} +\DeclareTextAccentDefault{\Perispomeni}{LGR} +\DeclareTextAccentDefault{\Dialytika}{LGR} + +\DeclareTextAccentDefault{\DialytikaPerispomeni}{LGR} +\DeclareTextAccentDefault{\DialytikaTonos}{LGR} +\DeclareTextAccentDefault{\DialytikaVaria}{LGR} +\DeclareTextAccentDefault{\DasiaPerispomeni}{LGR} +\DeclareTextAccentDefault{\DasiaVaria}{LGR} +\DeclareTextAccentDefault{\DasiaOxia}{LGR} +\DeclareTextAccentDefault{\PsiliPerispomeni}{LGR} +\DeclareTextAccentDefault{\PsiliOxia}{LGR} +\DeclareTextAccentDefault{\PsiliVaria}{LGR} + % .. References % ---------- % .. _LaTeX Project Public License: http://www.latex-project.org/lppl.txt % .. _lgrx: http://www.ctan.org/pkg/lgrx +% .. _textgreek: http://www.ctan.org/pkg/textgreek % .. _babel: http://www.ctan.org/cgi-bin/ctanPackageInformation.py?id=babel % .. _fntguide: http://www.ctan.org/tex-archive/macros/latex/doc/fntguide.pdf % .. _CB fonts: http://www.ctan.org/pkg/cbgreek-complete |