[XeTeX] Ancient Greek hyphenation

Nikola Lecic nlecic at EUnet.yu
Thu Apr 19 22:17:16 CEST 2007


On Thu, 19 Apr 2007 09:02:35 -0700 (PDT)
"Manny Ram." <sayajin_grandmaster at yahoo.com> wrote:

> The code used in TexShop:
> %!TEX TS-program =  xelatex
> %!TEX encoding =  UTF-8 Unicode
> \documentclass[BCOR12mm,DIVcalc]{scrbook}
> \usepackage{fontspec,xltxtra,xunicode} % I inserted
> this because it works, but I don't know exactly what
> it does
> \defaultfontfeatures{Mapping=tex-text} 
> \setromanfont[Mapping=tex-text]{Hoefler Text}
> \setsansfont[Scale=MatchLowercase,Mapping=tex-text]{Gill
> Sans}
> \setmonofont[Scale=MatchLowercase]{Andale Mono}
> \newfontfamily{\G}{Galatia SIL}
> \begin{document}
> {\G 
> Ancient Greek Text
> }
> \end{document}
> Up to here, I managed to display Greek fonts
> correctly, but I get overfull boxes and don't see any
> hyphenation. 

This is not enough. First, you have to load babel package (as Peter has already written, but you can use the real name, too):


A lot of smart (OTF/AAT) fonts contain special rules specific for Ancient Greek (ligatures, stylistic variants, substitutes, and so forth), and therefore it's a good idea to do this:


Then, if you typeset a multilingual document, you have to switch the language, not just the font:


or something like:

> Then I downloaded a Greek hyphenation package
> specifically for Xetex containing the files
> xgrahyph.tex, xgrcodes.tex and xgrmhyph.tex, and put
> the folder in my version of the Tex directory at
> usr/library/texmf/tex/latex (btw, I'm using Mac OS X.)
> After that, I changed the language.dat file by
> disabling greek (which I assume is the non-unicode
> version) with the % sign, and added another "greek"
> with xgrahyph.tex. Finally, I ran fmtutil --all.
> Nothing.

The file you need is xu-grahyph4.tex. In my TeXLive2007 installation it is located in


It's a wrapper file for utf8-grahyph4.tex and grahyph4.tex, which are located in TEXLIVEROOT/texmf-dist/tex/generic/xu-hyphen/ and TEXLIVEROOT/texmf/tex/generic/hyphen/ respectively. It's very likely they already exist in your installation.

Finally, your language.dat should match 'greek' with xu-grahyph4.tex. Then run fmutil as Peter explained.

Nikola Lečić

More information about the XeTeX mailing list