Greek symbols in text


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.

[2014/12/12 v0.12 macros for Greek letters in text]


Provide a set of \text* macros for Greek characters in text mode.


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




initial version



support for compound Unicode definitions outside LGR



new accent macro names with lgrxenc.def 0.7



use lgrenc.def from greek-fontenc.



move to greek-fontenc,


support XeTeX/LuaTeX, add breve below accents.



compatibility with Xe/LuaTeX in 8-bit mode.



fix auxiliary macro names, define symbol macros for breathing accents.


By default, TeX macros for Greek letters are only valid in mathematical mode. This package sets up a suitable font encoding and Greek LICR definitions (\textalpha\textOmega).

To allow documents using Greek LICR macros without worrying about the TeX engine used to compile them, this package tests the declared font encodings and does “the right thing” to set up Greek text font support:



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 of accent+character with a pre-composed character.

Therefore, Greek text should be written with the help of babel or polyglossia (setting the language to greek) or wrapped in the provided ensuregreek macro. Using babel or polyglossia also helps to ensure correct hyphenation of Greek text.



For detailled examples see textalpha-doc.tex and textalpha-doc.pdf (8-bit TeX and XeTeX/LuaTeX in 8-bit compatibility mode) as well as greek-euenc-doc.tex and greek-euenc-doc.pdf (XeTeX/LuaTeX with Unicode fonts).



With XeTeX or LuaTeX, there is one common input and font encoding – Unicode. 8-bit TeX font encodings are only used in compatibility mode or for fonts not available otherwise. For compatibility with the LaTeX font selection system, the package euenc defines the (pseudo) font encodings EU1 and EU2 for XeTeX and LuaTeX respectively. However euenc does not (yet) define LICR macros. We therefore explicitely load Greek LICR definitions for XeTeX/LuaTeX from greek-euenc.def which in turn includes greek-fontenc.def.

With 8-bit LaTeX, the LGR font encoding is used for Greek characters. If no Greek-supporting font encoding (EU1, EU2, or LGR) is declared, LGR is loaded and set up as default Greek font encoding by this package.

To give textalpha.sty a chance of finding out which font encodings are used, load it after fontspec and/or fontenc.

Font encodings

Ensure a Greek-supporting font encoding exists and supports Greek LICR macros:

Load the Greek LICR definitions for Unicode if font encoding EU1 (XeTeX) or EU2 (LuaTeX) is detected.1 In an ideal world, this would be done in the eu1enc.def (or eu2enc.def) file of the euenc package. If none of EU1, EU2, and LGR is declared, load lgrenc.def:

Re-set the \LastDeclaredEncoding: Because fontenc loads font encoding definition files only once, it may happen that another font encoding is defined afterwards — for example fontspec leaves \LastDeclaredEncoding at T3 (tipa), because it inputs the xunicode package which in turn loads t3enc.def.

}{% else
  }{% else
      % LGR already declared and set up

The two different (pseudo) font encodings allow different font setups for XeTeX vs. LuaTeX using differently named *.fd files (see euenc for details).

The package hyperref defines the PU font encoding which also supports (monotonic) Greek. It currently misses polytonic greek and the \greekscript and \ensuregreek TextCommands:


Symbol macros for breathings

In the Latin transcription provided by LGR, breathing accents (Dasia and Psili) are input as < and >. We provide the corresponding NFSS macro accents (moved here from greek-fontenc.def).

As Xe/LuaTeX may use LGR in combination with EU1 or EU2, we define the macros for both, LGR and Unicode font encodings (if they are defined):

  % Composite accents starting with the new-defined shortcuts:

\@ifl@aded{def}{greek-euenc}{ % XeTeX (EU1) or LuaTeX (EU2)
  % Composite accents starting with the new-defined shortcuts:

Default declarations

The following definitions ensure that the Greek LICR macros can be used anywhere in the document also with 8-bit TeX by declaring LGR as their default font encoding. Abort here, if the LGR font encoding is not defined:

% else return:

greekscript, ensuregreek

The \greekscript declaration ensures the current font encoding supports the Greek script. greek-fontenc.def sets this to the empty declaration for font encodings that do so. This is currently used by lgrenc.def (LGR) and greek-euenc.def (Greek LICR macros for EU1 and EU2).

We define LGR as default encoding for Greek text. We use \ProvideTextCommandDefault to enable the author or other packages to use an alternative definition (see [fntguide]):


The \ensuregreek command can be used to ensure that its argument is set in a font encoding with support for Greek. Again the default is LGR:

\ProvideTextCommandDefault{\ensuregreek}[1]{\leavevmode{\greekscript #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.

Greek Alphabet

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

\DeclareTextSymbolDefault{\textfinalsigma}{LGR} % alias for \textvarsigma
\DeclareTextSymbolDefault{\textautosigma}{LGR}  % char 115 in LGR

Additional Greek symbols

Including alias names for compatibility with hyperref’s puenc.def.

Ancient Greek Numbers (Athenian Numerals):

\DeclareTextSymbolDefault{\textpentedeka}{LGR}    % GREEK ACROPHONIC ATTIC FIFTY
\DeclareTextSymbolDefault{\textpentehekaton}{LGR} % GREEK ACROPHONIC ATTIC FIVE HUNDRED
\DeclareTextSymbolDefault{\textpenteqilioi}{LGR}  % GREEK ACROPHONIC ATTIC FIVE THOUSAND
\DeclareTextSymbolDefault{\textpentemurioi}{LGR}  % GREEK ACROPHONIC ATTIC FIFTY THOUSAND

Archaic letters:

\DeclareTextSymbolDefault{\textstigma}{LGR}      % ϛ
\DeclareTextSymbolDefault{\textstigmagreek}{LGR} % ϛ (puenc.def)
\DeclareTextSymbolDefault{\textvarstigma}{LGR}   % stigma variant
\DeclareTextSymbolDefault{\textkoppa}{LGR}       % ϟ (greek small letter koppa)
\DeclareTextSymbolDefault{\textkoppagreek}{LGR}  % ϟ (puenc.def)
\DeclareTextSymbolDefault{\textqoppa}{LGR}       % ϙ (archaic koppa)
\DeclareTextSymbolDefault{\textQoppa}{LGR}       % Ϙ (archaic Koppa)
\DeclareTextSymbolDefault{\textStigma}{LGR}      % Ϛ ϹΤ ligature in some fonts
\DeclareTextSymbolDefault{\textStigmagreek}{LGR} % Ϛ (puenc.def)
\DeclareTextSymbolDefault{\textSampi}{LGR}       % Ϡ
\DeclareTextSymbolDefault{\textSampigreek}{LGR}  % Ϡ (puenc.def)
\DeclareTextSymbolDefault{\textsampi}{LGR}       % ϡ
\DeclareTextSymbolDefault{\textsampigreek}{LGR}  % ϡ (puenc.def)
\DeclareTextSymbolDefault{\textanoteleia}{LGR}   % ·
\DeclareTextSymbolDefault{\texterotimatiko}{LGR} % ; (003B is the preferred character)
\DeclareTextSymbolDefault{\textdigamma}{LGR}     % ϝ
\DeclareTextSymbolDefault{\textDigamma}{LGR}     % Ϝ
\DeclareTextSymbolDefault{\textdigammagreek}{LGR} % ϝ (puenc.def)
\DeclareTextSymbolDefault{\textDigammagreek}{LGR} % Ϝ (puenc.def)

numeral signs: http://en.wikipedia.org/wiki/Greek_numerals

\DeclareTextSymbolDefault{\textnumeralsigngreek}{LGR}      % (puenc.def)
\DeclareTextSymbolDefault{\textnumeralsignlowergreek}{LGR} % (puenc.def)


Greek diacritics via “named” macros:


Symbol macros for the breathings:


Postfix accents:

\DeclareTextSymbolDefault{\ypogegrammeni}{LGR} % "small" sub-iota
\DeclareTextSymbolDefault{\prosgegrammeni}{LGR}  % "capital" sub-iota

Other accents in LGR:

\DeclareTextAccentDefault{\accinvertedbrevebelow}{LGR} % INVERTED BREVE BELOW
\DeclareTextAccentDefault{\textsubarch}{LGR}           % tipa, Teubner name: ut
\DeclareTextAccentDefault{\accbrevebelow}{LGR}         % BREVE BELOW

Auxiliary macros

\MakeUppercase requires three internal commands: