Mixing English and Ancient Greek in LaTeX
This took me a while to figure out. Greek letters in LaTeX can be easily output in math mode, but can you imagine writing several Greek words as $\Pi\rho\omega\tau\alpha$…? I mean, don’t we have this “Unicode” thing?
I. Source Files in UTF-8
Writing input files in UTF-8 is no problem with the inputenx package:
\usepackage[utf8x]{inputenx}
Or, I used to think so. Unfortunately, it seems that LaTeX has some problems with rendering large character subsets of Unicode at once (and Ancient Greek with standard Latin alphabet together form a large subset indeed). I admit I didn’t research the details. The solution, plain and simple, is to explicitly tell LaTeX when it should expect Greek instead of English. Proper font switching takes place somewhere behind the scenes.
II. Loading Greek Language Patterns
In Debian/Ubuntu, you need to install the texlive-lang-greek package. I suppose that similar packages are available in other distributions as well.
# apt-get install texlive-lang-greek
In your document, you load the language like so:
\usepackage[polutonikogreek,english]{babel}
The last specified language (English here) is considered primary for the document. For modern Greek, specify greek instead of polutonikogreek.
III. Switching Between the Languages
You switch between languages with the \selectlanguage command, like so:
{\selectlanguage{polutonikogreek}Ξενοφάνης} is famous for his critique
of antropomorphic gods.
% OR
\selectlanguage{polutonikogreek}Ξενοφάνης\selectlanguage{english} is
famous for his critique of antropomorphic gods.
To save myself some writing, I’ve created this custom command:
\newcommand{\greek}[1]{{\selectlanguage{polutonikogreek}#1}}
IV. The Complete Example
\documentclass[a4paper]{article}
\usepackage[polutonikogreek,english]{babel}
\usepackage[utf8x]{inputenx}
\newcommand{\greek}[1]{{\selectlanguage{polutonikogreek}#1}}
\begin{document}
Protagoras (\greek{Πρωταγόρας}) says that ``Man is the measure of all things''
(\greek{Ἄνθρωπος μέτρον}), meaning that there is no objective truth. One
opinion can be better than another, but it cannot be \emph{truer}.
\end{document}
By the way: do you agree with Protagoras? :-)
5 Comments Add your own…
I was using \usepackage[utf8]{inputenc} before this, and this package would only allow for example \greek{kuriak`on de~ipnon}.
I'd check that the file is really saved in Unicode and that you have Greek language support installed for TeX. Unfortunately I have never used TeX on Windows so I can't give specific advice. Are you getting any error messages?
Best,
Guillaume
Speak your mind
Allowed HTML tags are a, blockquote, em, code, li, ol, p, pre, strong, ul. Links to other comments in the form “[IV]” or “[4]” are detected automatically.