Greek in XeLaTeX Part 2

As I was to finish my master thesis I came across a small problem. I had to insert a chapter of around 10 pages describing the whole thesis in Greek. At first I was thinking just to use the xgreek package along with the xltxtra and I’d be fine. But with two problem emerged: First the xgreek package overrides all definitions on e.g. chaptername and bibname variables. This means that in the English text instead of “Chapter” I would get “Κεφάλαιο” instead. The second problem is that the font that I was using for the Thesis did not support unicode.
Starting from the latter I used:


in order to make a \greekfont family that I could use to make the text appear. I did that and avoided using chapters (only sections and subsections) and everything was good because I did not needed to use the xgreek package. Then I realized that a new problem emerged. The words in Greek would not be split in the end of sentences. Instead they would go over the margin! This could easily be solved with the xgreek package. In order to make it easy for me I used the package eventually and redefined everything (below is the code for everyone to copy)

% Partially negating xgreek package 
\def\listfigurename{List of Figures}%
\def\listtablename{List of Tables}%
\def\alsoname{see also}%

And then I realized what a fool I have been! With the use of the xgreek package the words in English would not break at the end of the sentences! That was the rest of the thesis… Thus the problem with the words not breaking could not be solved and I ended up breaking the Greek sections painfully manually. If there is any way to do it please tell me!


2 thoughts on “Greek in XeLaTeX Part 2

  1. Hi,

    Actually there are more than one solutions to your problem. It can be solved by using package xgreek, by using package polyglossia (the replacement of babel in XeLaTeX) or by using low-level XeLaTeX commands.

    In xgreek and polyglossia when you want to use different hyphenation rules, you have to declare the language of the text. This can be done easily for xgreek
    You can specify a convenience macro for easy change of the hyphenation rules

    In polyglossia the main language doesn’t need any declaration. The secondary languages must be inserted in an separate environment

    The convinience macro this time is:

    The easiest by far way though is to save this code in a file named autohyph.sty,
    install it (or place it in the same folder with your main.tex file) and just put in the preamble
    Everything should work out of the box!

    xgreek :
    polyglossia :
    Hyphenations :

    with regards,

    ps. Next time you have problems like this visit

  2. Panos,
    Thank you very much I tried the xgreek with the \stelanguage commands and it works like a charm!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s