textalpha: Greek symbols in text

Licence

This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3 of this license or any later version.

Identification
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{textalpha}
[2013/05/03 v0.3 macros for Greek letters in text]

This package is part of the lgrx bundle.

Abstract

Provide a set of \text* macros for Greek letters outside math.

Note

The package was renamed from textgreek to textalpha to prevent confusion with the textgreek package by Leonard Michlmayr.

Changelog:

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, TeX macros for Greek letters

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 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.

Attention

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 \ensuregreek macro.

The package uses NFSS default definitions as explained in the fntguide (section 5.3).

Implementation

Requirements

This package requires the extended font encoding definitions

\input{lgrxenc.def}

ensuregreek

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{\ensuregreek}[1]{{\fontencoding{LGR}\selectfont #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.

Backwards compatibility definition: versions < 0.3 used the macro name \TextGreek:

\DeclareTextCommandDefault{\TextGreek}[1]{{\fontencoding{LGR}\selectfont #1}}

Greek Alphabet

Define the text* marcos as default for all font encodings:

\DeclareTextSymbolDefault{\textAlpha}{LGR}
\DeclareTextSymbolDefault{\textBeta}{LGR}
\DeclareTextSymbolDefault{\textGamma}{LGR}
\DeclareTextSymbolDefault{\textDelta}{LGR}
\DeclareTextSymbolDefault{\textEpsilon}{LGR}
\DeclareTextSymbolDefault{\textZeta}{LGR}
\DeclareTextSymbolDefault{\textEta}{LGR}
\DeclareTextSymbolDefault{\textTheta}{LGR}
\DeclareTextSymbolDefault{\textIota}{LGR}
\DeclareTextSymbolDefault{\textKappa}{LGR}
\DeclareTextSymbolDefault{\textLambda}{LGR}
\DeclareTextSymbolDefault{\textMu}{LGR}
\DeclareTextSymbolDefault{\textNu}{LGR}
\DeclareTextSymbolDefault{\textXi}{LGR}
\DeclareTextSymbolDefault{\textOmicron}{LGR}
\DeclareTextSymbolDefault{\textPi}{LGR}
\DeclareTextSymbolDefault{\textRho}{LGR}
\DeclareTextSymbolDefault{\textSigma}{LGR}
\DeclareTextSymbolDefault{\textTau}{LGR}
\DeclareTextSymbolDefault{\textUpsilon}{LGR}
\DeclareTextSymbolDefault{\textPhi}{LGR}
\DeclareTextSymbolDefault{\textChi}{LGR}
\DeclareTextSymbolDefault{\textPsi}{LGR}
\DeclareTextSymbolDefault{\textOmega}{LGR}
%
\DeclareTextSymbolDefault{\textalpha}{LGR}
\DeclareTextSymbolDefault{\textbeta}{LGR}
\DeclareTextSymbolDefault{\textgamma}{LGR}
\DeclareTextSymbolDefault{\textdelta}{LGR}
\DeclareTextSymbolDefault{\textepsilon}{LGR}
\DeclareTextSymbolDefault{\textzeta}{LGR}
\DeclareTextSymbolDefault{\texteta}{LGR}
\DeclareTextSymbolDefault{\texttheta}{LGR}
\DeclareTextSymbolDefault{\textiota}{LGR}
\DeclareTextSymbolDefault{\textkappa}{LGR}
\DeclareTextSymbolDefault{\textlambda}{LGR}
\DeclareTextSymbolDefault{\textmu}{LGR}
\DeclareTextSymbolDefault{\textnu}{LGR}
\DeclareTextSymbolDefault{\textxi}{LGR}
\DeclareTextSymbolDefault{\textomicron}{LGR}
\DeclareTextSymbolDefault{\textpi}{LGR}
\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}
\DeclareTextSymbolDefault{\textchi}{LGR}
\DeclareTextSymbolDefault{\textpsi}{LGR}
\DeclareTextSymbolDefault{\textomega}{LGR}

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
\DeclareTextSymbolDefault{\PiEta}{LGR}   % GREEK ACROPHONIC ATTIC FIVE HUNDRED
\DeclareTextSymbolDefault{\PiChi}{LGR}   % GREEK ACROPHONIC ATTIC FIVE THOUSAND
\DeclareTextSymbolDefault{\PiMu}{LGR}    % GREEK ACROPHONIC ATTIC FIFTY THOUSAND
% \DeclareTextSymbolDefault{\pentedeka}{LGR}    % GREEK ACROPHONIC ATTIC FIFTY
% \DeclareTextSymbolDefault{\pentehekaton}{LGR} % GREEK ACROPHONIC ATTIC FIVE HUNDRED
% \DeclareTextSymbolDefault{\penteqilioi}{LGR}  % GREEK ACROPHONIC ATTIC FIVE THOUSAND
% \DeclareTextSymbolDefault{\pentemurioi}{LGR}  % GREEK ACROPHONIC ATTIC FIFTY THOUSAND

\DeclareTextSymbolDefault{\stigma}{LGR}        % ϛ
\DeclareTextSymbolDefault{\textstigmagreek}{LGR} % ϛ (puenc.def)
\DeclareTextSymbolDefault{\varstigma}{LGR}     % stigma variant (CB.enc, teubner)
% \DeclareTextSymbolDefault{\vardigamma}{LGR}  % digamma variant (greek.ldf)
\DeclareTextSymbolDefault{\koppa}{LGR}         % ϟ (greek small letter koppa)
\DeclareTextSymbolDefault{\textkoppagreek}{LGR}  % ϟ (puenc.def)
\DeclareTextSymbolDefault{\qoppa}{LGR}           % ϙ (archaic koppa)
\DeclareTextSymbolDefault{\Qoppa}{LGR}           % Ϙ (archaic Koppa)
\DeclareTextSymbolDefault{\Stigma}{LGR}          % ϹΤ ligature (teubner)
\DeclareTextSymbolDefault{\textStigmagreek}{LGR} % ϹΤ ligature (puenc.def)
\DeclareTextSymbolDefault{\Sampi}{LGR}           % Ϡ
\DeclareTextSymbolDefault{\textSampigreek}{LGR}  % Ϡ (puenc.def)
\DeclareTextSymbolDefault{\sampi}{LGR}           % ϡ
\DeclareTextSymbolDefault{\textsampigreek}{LGR}  % ϡ (puenc.def)
\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{\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)
\DeclareTextSymbolDefault{\textnumeralsigngreek}{LGR}      % (puenc.def)
\DeclareTextSymbolDefault{\textnumeralsignlowergreek}{LGR} % (puenc.def)

Diacritics

Diacritics are defined via “named” macros in lgrxenc.def. Make them default in any encoding:

\DeclareTextAccentDefault{\accdasia}{LGR}
\DeclareTextAccentDefault{\accpsili}{LGR}
\DeclareTextAccentDefault{\acctonos}{LGR}
\DeclareTextAccentDefault{\accvaria}{LGR}
\DeclareTextAccentDefault{\accperispomeni}{LGR}
\DeclareTextAccentDefault{\accdialytika}{LGR}
\DeclareTextAccentDefault{\<}{LGR}
\DeclareTextAccentDefault{\>}{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

Auxiliary macros

\MakeUppercase requires two internal commands:

\DeclareTextAccentDefault{\@hiatus}{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}