1

I'm trying to use perpage footnotes with the manyfoot package. I'd also like to hyphenate polytonic Greek text using the polyglossia package.

But with this code, I'm getting an error:

\documentclass[11pt]{book}
%\usepackage[margin=1cm]{geometry}
\usepackage{titlesec}
\usepackage{fontspec}
\usepackage{polyglossia}
\setmainfont{Times New Roman}
\setdefaultlanguage[variant=poly]{greek}
\setmainlanguage[variant=poly]{greek}
\setotherlanguage{english}
\setmainfont{Times New Roman}
\newfontfamily\greekfont{Times New Roman}
\usepackage{alltt}
\usepackage{lineno}
\usepackage[para*,ruled,perpage]{manyfoot}
\DeclareNewFootnote[para]{A}
\newcommand{\mytext}{This is a footnote for my page. It should be long and create lots of problems, if possible.}

\begin{document}
\begin{alltt}\normalfont
ἔνθ᾽ ἄλλοι μὲν πάντες, \footnoteA{\mytext}ὅσοι φύγον αἰπὺν ὄλεθρον,
οἴκοι ἔσαν, πόλεμόν τε \footnoteA{\mytext}πεφευγότες ἠδὲ θάλασσαν:
τὸν δ᾽ οἶον νόστου \footnoteA{\mytext}κεχρημένον ἠδὲ γυναικὸς
νύμφη πότνι᾽ ἔρυκε \footnoteA{\mytext}Καλυψὼ δῖα θεάων
ἐν σπέσσι γλαφυροῖσι, \footnoteA{\mytext}λιλαιομένη πόσιν εἶναι.
ἀλλ᾽ ὅτε δὴ ἔτος ἦλθε \footnoteA{\mytext}περιπλομένων ἐνιαυτῶν,
τῷ οἱ ἐπεκλώσαντο \footnoteA{\mytext}θεοὶ οἶκόνδε νέεσθαι
εἰς Ἰθάκην, οὐδ᾽ \footnoteA{\mytext}ἔνθα πεφυγμένος ἦεν ἀέθλων
καὶ μετὰ οἷσι \footnoteA{\mytext}φίλοισι. θεοὶ δ᾽ ἐλέαιρον ἅπαντες
νόσφι Ποσειδάωνος: \footnoteA{\mytext}ὁ δ᾽ ἀσπερχὲς μενέαινεν
ἀντιθέῳ Ὀδυσῆι πάρος \footnoteA{\mytext}ἣν γαῖαν ἱκέσθαι.
\end{alltt}
\end{document}

The error is here:

! Package polyglossia Error: The current latin font TimesNewRoman(1) does not c ontain the "Greek" script! (polyglossia) Please define \greekfont with \newfontfamily command.

I followed the instructions and added the \greekfont definition. However, the error still occurs. It seems to be a conflict with the \begin{alltt}\normalfont call, because if I comment out the alltt lines, the error goes away, and the code works as intended.

Does anyone know why this error occurs? Does it have to do with the \normalfont call in some way?

3
  • Do you really need alltt? Its main purpose is for printing computer code in a monospaced font (lmmono10, specifically).
    – Cicada
    Nov 27, 2022 at 8:07
  • Try if it works if you define \greekfonttt Nov 27, 2022 at 8:57
  • @UlrikeFischer Setting the mono font to one containing the Greek script font feature works: e.g., \setmonofont{Times New Roman} ; also Arial and Noto Sans Mono. Guess: is polyglossia seeing alltt's lmmono10 (which has no grek) at begin environment?
    – Cicada
    Nov 27, 2022 at 10:01

1 Answer 1

2

The error message is a bit misleading. The problem is that alltt wants to use the monospaced font and the error should tell the user about \greekfonttt, but (it's an old-standing issue) it only reports \greekfont.

You don't need alltt, but flushleft, which however requires marking where line end, if you want full control.

This is better than trusting in the input format, because text editor programs may have different ideas than you; sharing files may introduce problems of text reflowing and your line breaks might be lost.

\documentclass[11pt]{book}
%\usepackage[margin=1cm]{geometry}
\usepackage{titlesec}
\usepackage{fontspec}
\usepackage{polyglossia}
\usepackage{alltt}
\usepackage{lineno}
\usepackage[para*,ruled,perpage]{manyfoot}

\setmainfont{Times New Roman}
\setmainlanguage[variant=poly]{greek}
\setotherlanguage{english}

\newfontfamily\greekfont{Times New Roman}
%\newfontfamily\greekfonttt{Times New Roman} % if you really want alltt

\DeclareNewFootnote[para]{A}

\newcommand{\mytext}{This is a footnote for my page. 
  It should be long and create lots of problems, if possible.}

\begin{document}

\begin{flushleft}
ἔνθ᾽ ἄλλοι μὲν πάντες, \footnoteA{\mytext}ὅσοι φύγον αἰπὺν ὄλεθρον, \\
οἴκοι ἔσαν, πόλεμόν τε \footnoteA{\mytext}πεφευγότες ἠδὲ θάλασσαν: \\
τὸν δ᾽ οἶον νόστου \footnoteA{\mytext}κεχρημένον ἠδὲ γυναικὸς \\
νύμφη πότνι᾽ ἔρυκε \footnoteA{\mytext}Καλυψὼ δῖα θεάων \\
ἐν σπέσσι γλαφυροῖσι, \footnoteA{\mytext}λιλαιομένη πόσιν εἶναι. \\
ἀλλ᾽ ὅτε δὴ ἔτος ἦλθε \footnoteA{\mytext}περιπλομένων ἐνιαυτῶν, \\
τῷ οἱ ἐπεκλώσαντο \footnoteA{\mytext}θεοὶ οἶκόνδε νέεσθαι \\
εἰς Ἰθάκην, οὐδ᾽ \footnoteA{\mytext}ἔνθα πεφυγμένος ἦεν ἀέθλων \\
καὶ μετὰ οἷσι \footnoteA{\mytext}φίλοισι. θεοὶ δ᾽ ἐλέαιρον ἅπαντες \\
νόσφι Ποσειδάωνος: \footnoteA{\mytext}ὁ δ᾽ ἀσπερχὲς μενέαινεν \\
ἀντιθέῳ Ὀδυσῆι πάρος \footnoteA{\mytext}ἣν γαῖαν ἱκέσθαι.
\end{flushleft}

\end{document}

enter image description here

You get the same result if you uncomment the \greekfonttt line, change flushleft into alltt and remove the \\.

2
  • 1
    I opened an issue about the error message a few days ago and the next version will do better here. Nov 27, 2022 at 10:00
  • Indeed! Thank you egreg! Nov 27, 2022 at 14:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .