Trying to use minted with Hebrew as the default language with polyglossia:

\setdefaultlanguage[calendar=hebrew, numerals=arabic]{hebrew}
\newfontfamily\hebrewfont{David CLM}


    $ for i in {1..2}; do echo 'Hello World'; done
    Hello World
    Hello World

Results in:

$ xelatex -shell-escape test
! Package polyglossia Error: 
The current roman font does not contain the Hebrew script!
Please define \hebrewfont with \newfontfamily.

See the polyglossia package documentation for explanation.
Type  H <return>  for immediate help.

l.1 \begin{Verbatim}[commandchars=\\\{\}, ]

I think I understand what the error is saying, but not sure why.

I'm in the english environment which should use the default English font... So why am I getting errors about Hebrew stuff?

(I did manage to workaround it by setting the default language to English, but that made other things break unfortunately)

1 Answer 1


It's a clear bug in how Polyglossia manages the situation, as it seems not taking into account the current language. A temporary workaround is to say


just after \newfontfamily\hebrewfont{David CLM} (it suffices to say it in the preamble, anyway). This assuming that you don't need Hebrew in the minted environment.

  • 1
    Thanks everybody I had similar problem for arabic font and replaced '\let\hebrewfonttt\ttfamily' by '\let\arabicfonttt\ttfamily' and all works well for verbatim the english characters. but when I write arabic characters between \begin{verbatim} and \end{verbatim}, it doesn't recognize it and compiles nothing or blank line. How can I write arabic characters in verbatim ? Oct 17, 2014 at 7:55
  • @FaouziBellalouna You need a (monospaced) font that supports Arabic. Sorry, but I can't say more without a real example. Will you make it in a new question?
    – egreg
    Oct 17, 2014 at 8:03
  • I just saw your comment. I'll make a new question soon. Thanks Oct 17, 2014 at 12:11
  • @ egreg. Here's the question I made. tex.stackexchange.com/questions/207636/verbatim-and-polyglossia Oct 17, 2014 at 12:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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