TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

After having some hyphenation problems with my text (in greek and english) I changed some of my packages. In the beggining I was using:


After doing some search I modified those to get correct hyphenation. After doing so in a small sample text, I am trying to change the packages of my original text to the ones used in my sample, in order to get finally the correct hyphenation. However at some point I get:

Package polyglossia error: The current Roman Font does not contain the Greek Script.

Line 242: \begin{verbatim}

The packages I use are the following:

\newfontfamily\greekfont[Script=Greek]{Linux Libertine O}
\newfontfamily\greekfontsf[Script=Greek]{Linux Libertine O}
\setmainfont{Linux Libertine O}

How can this be fixed?

share|improve this question
You have to define also \greekfonttt. I would never use ucharclasses for interspersing English in Greek; you risk many unexpected results. – egreg Oct 16 '12 at 17:21
So what would you recommend instead? Apart the strategy when you define a command for change language and then you put the language X block in it, like \en{I am Jonathan} \gr{Είμαι ο Γιάννης} – Paramar Oct 16 '12 at 17:38
The default language is Greek; just define \en for English snippets: \newcommand{\en}[1]{\foreignlanguage{english}{#1}} and use the provided environments to switch languages for longer passages in English (and maybe \gr for inserting Greek snippets in English text). Marking the code is always better. One problem you can run into is exactly that \verb text may not be typeset in the mono font. – egreg Oct 16 '12 at 17:45
@egreg Make that an answer, please. – lockstep Nov 4 '12 at 15:01

Verbatim text uses the font defined with \setmonofont (or the default Latin Modern Typewriter font).

However, when the Greek language is active, Polyglossia makes XeLaTeX look whether the font has the GRK feature and, if that's not available, it looks whether a font family under the name \greekfonttt has been defined. Thus


(use your preferred monospaced font) should do.

I wouldn't use ucharclasses for switching automatically from English to Greek and conversely: this will fill your auxiliary files with \select@language declarations and won't ensure that a monospaced font is used in verbatim. Rather prefer the standard method of confining language switches with explicit \selectlanguage commands (not recommended), otherlanguage, otherlanguage* or \foreignlanguage.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.