Greek text with the LGR font encoding


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.


The LGR font encoding is the de-facto standard for Greek typesetting with (8-bit) LaTeX. However, the encoding definition file that ships with babel misses many of the definitions common since the advent of the NFSS [fntguide].

The lgrx bundle provides packages and definitions for typesetting Greek text with fonts in the LGR encoding. It works for both, monotonic and polytonic Greek, independent of the babel package.

The bundle is available from CTAN and included in TeXLive 2012. Development takes place at the Sourceforge.


The TeXLive 2012 pre-release contains the Unicode definition file lgrenc.dfu in the documentation instead of the TEXPATH. To enable Greek Unicode support, update via tlmgr or place a copy in the TEXPATH «by hand». See



The lgrx bundle consists of the following LaTeX files:

LaTeX files:

comprehensive LGR encoding definition file


support for Unicode input


\text... macros for Greek letters in non-Greek text


Greek letters with \alpha, \beta, ... in text and math

Literal sources:

lgrxenc.def.html, lgrenc.dfu.html, textalpha.sty.html, alphabeta.sty.html

Documentation and test documents:

user documentation, source lgrx.tex


Greek script in PDF metadata, source greekhyperref.tex


Greek Unicode with lgrenc.dfu, source greek-unicode.tex


source lgrxenc-test.tex


source textalpha-test.tex


source alphabeta-test.tex


Greek font encodings


The Unicode standard allows fonts that comprise glyphs from (almost) all known scripts. With the TeX engines XeTeX or LuaTeX, typesetting Greek with LaTeX is as easy as finding a font that contains Greek letters and setting it up with fontspec. Beware, that you must not use the greek or polutonikogreek options of the babel package. The babel replacement polyglossia provides Greek language support for XeLaTeX/LuaLaTeX. If you go this way, you don't need the lgrx bundle.


The [encguide] reserves the name T7 for a Greek standard font encoding. However, up to now, there is no agreement on an implementation because the restrictions for general text encodings are too severe for typesetting polytonic Greek.


The LGR font encoding is the de-facto standard for typesetting Greek with (8-bit) LaTeX. Fonts in this encoding include the CB fonts (matching CM), grtimes (Greek Times), Kerkis (matching URW Bookman), and the GFS font collection. Setup of these fonts as Greek variant to matching Latin fonts is facilitated by the substitutefont package.

The LGR font encoding generates Greek characters via an ASCII transliteration. This enables simple input with a Latin keyboard. Characters with diacritics are selected by ligature definitions in the font (see [greek-usage], [teubner-doc], [cbfonts]).


The name LGR does not reflect status of this font encoding due to historical reasons. [encguide] classifies encodings starting with L as "local". Indeed, LGR started as a local encoding for the CB fonts by Claudio Beccari. Later, Apostolos Syropoulos advanced it to the default font encoding for the babel package's greek option. A better name would be OT7:

  • It is an 'old' encoding.

  • It implements a Latin transcription for a non-Latin script like the OT2 encoding.

  • It is not confined to 128 bit but OT4 shows that this is no absolute requirement for an OT encoding.

However, due to the fact that the LGR font encoding has been used under its current name for a long time, the name will not change for compatibility reasons.

Problems with the default setup

The lgrx budle adresses a set of problems with the LGR font encoding as set up by babel:

  1. Ligatures with prefix notation prevent kerning (see the example document lgrxenc-test.pdf and [teubner-doc]).

  2. Sub-optimal results with the standard accent macros:

    • no combined accents,

    • accents above (instead of before) capital letters,

    • pre-composed characters are not used.

  3. The tilde character ~ is used for a non-breaking space by default. Therefore the transliteration for the perispomeni accent is not available without re-definition of this character.1

  4. The polutonikogreek babel option redefines both, ~ and \~ to produce accents via input ligatures (restricted to the language setting instead of the font encoding). This prevents the placing of a tilde-accent on non-supported characters like in niño if the language is set to polytonic Greek, even if \textlatin is used.2

  5. There is no Unicode support with inputenc's utf8 option.

    The ucs package contributed by Dominique Unruh provides Unicode support with the utf8x option. A babel patch by Werner Lemberg for Greek Unicode support [lemberg2008] never got applied.)

  6. The LGR transliteration does not work for PDF metadata.

(1, 2)

Problem 3 can be solved by the simple one-liner


which results in \~ inserting a plain tilde character if the font encoding is LGR.

Drawback: you cannot place a ~-accent on Greek characters except the ones supported by an input ligature.


Fortunately, LaTeX saves copies of the accent macros: \~ is an alias of \a~ (which is an alias of \@tabacckludge~), so it can be restored after loading babel with:


With this addition, both the comprehensive font encoding definitions and the workaround1 also work with the polutonikogreek babel option.

Components of the lgrx bundle

The lgrx bundle comprises tools that help typesetting Greek script with (8-bit) LaTeX in Greek as well as multi-lingual documents.

Comprehensive font encoding definition file

lgrxenc.def is an alternative to the rudimentary LGR encoding definition file3 lgrenc.def which comes with babel's Greek support. It defines macros for Greek characters the LGR font encoding that select pre-composed glyphs if possible and places the diacritics according to Greek typesetting rules else. Combined accents can be specified as backslash + transliteration (\~>a) or iteratively (\~\>{a}).

For usage and documentation see the literal source lgrxenc.def.html, the user manual lgrx.pdf, and the test document lgrxenc-test.pdf.


See [fntguide, section 5] for a definition of encoding definition files.

Greek Unicode support

lgrenc.dfu provides standards-compatible UTF-8 support for Greek based on the comprehensive font encoding definitions. It is compatible with hyperref enabling Greek characters in PDF metadata without the need for \texorpdfstring.

See the literal source lgrenc.dfu.html and the test document greek-unicode.pdf.

Macros for Greek in text

textalpha.sty defines \textalpha, \textbeta ... macros for Greek letters in text that work in any font encoding and alias macros for compatibility with existing packages. With this package, Unicode input of Greek letters works in any font encoding, too.

However, in any font encoding except LGR:

  • there is no kerning between Greek characters,

  • composition of diacritics (like \Dasia\Tonos) fails,

  • accent macros do not select precomposed characters (pre-composed Unicode literals work fine).

See the literal source textalpha.sty.html and textalpha-test.pdf for details on usage, limitations, and recommended workarounds.

Generic macros for Greek letters

alphabeta.sty allows you to use \alpha, \beta, ... in both, text and math. For this, the math macros are redefined with the help of \TextOrMath from the standard package fixltx2e.

See the literal source alphabeta.sty.html and the test document alphabeta-test.pdf.



LaTeX3 Project Team, LaTeX 2ε font selection, 2005.

(1, 2)

Frank Mittelbach, Robin Fairbairns, Werner Lemberg, LaTeX3 Project Team, LaTeX font encodings, 2006.


Apostolos Syropoulos, Writing Greek with the greek option of the babel package, 1997.


Claudio Beccari, The CB Greek fonts, Εὔτυπον, τεῦχος № 21, 2008.

(1, 2)

Claudio Beccari, teubner.sty An extension to the greek option of the babel package, 2011.


Werner Lemberg, Unicode support for the Greek LGR encoding, Εὔτυπον, τεῦχος № 20, 2008.

Valid XHTML 1.1 Thanks to for hosting this site.