I am trying to typeset some text in ancient Greek. (Whether it is ancient or modern doesn’t seem to make a difference.) I would like to do it using EB Garamond, which has polytonic Greek characters.
However, when I try to compile a document, it gives me the following error message:
Package polyglossia Error: The current latin roman font does not contain the "Greek" script! (polyglossia) Please define \greekfont with \newfontfamily command.
Here is the MWE that I am attempting to compile in LuaLaTeX:
\documentclass{article}
\usepackage{fontspec}
\setmainfont{EB Garamond} % The document compiles with \setmainfont{Libertinus Serif}
\setsansfont{Libertinus Sans}
\setmonofont{Libertinus Mono}
\usepackage{polyglossia}
\setdefaultlanguage{greek} % compiles with EB Garamond if I set default to English
\begin{document}
\section*{βίβλος Α}
\noindent ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ\\
πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν:\\
πολλῶν δ᾽ ἀνθρώπων ἴδεν ἄστεα καὶ νόον ἔγνω,\\
πολλὰ δ᾽ ὅ γ᾽ ἐν πόντῳ πάθεν ἄλγεα ὃν κατὰ θυμόν,\\
ἀρνύμενος ἥν τε ψυχὴν καὶ νόστον ἑταίρων.\\
ἀλλ᾽ οὐδ᾽ ὣς ἑτάρους ἐρρύσατο, ἱέμενός περ:\\
αὐτῶν γὰρ σφετέρῃσιν ἀτασθαλίῃσιν ὄλοντο,\\
νήπιοι, οἳ κατὰ βοῦς Ὑπερίονος Ἠελίοιο\\
ἤσθιον: αὐτὰρ ὁ τοῖσιν ἀφείλετο νόστιμον ἦμαρ.\\
τῶν ἁμόθεν γε, θεά, θύγατερ Διός, εἰπὲ καὶ ἡμῖν.
\end{document}
(The same happens in XeLaTeX.)
Yet EB Garamond is plainly able to typeset the polyphonic Greek characters.
I realize that I can set Greek as a secondary language, but I would like to be able to have the headings, etc., in Greek.
Any ideas what is going on? Are there any work-arounds?
\newfontfamily\greekfont{EBGarmaond}
. Then use\greekfont
instead of\mainfont
. Does that work? If it works, it suggests thatpolyglossia
is using its own code, to supply something that is missing from the font itself.grek
you can check that withotfinfo -s
), and polyglossia don't like this. You will have to define \greekfont.\greekfont
was a good work-around. If someone makes this the answer, I will mark it correct.