3

I am writing my master thesis and I want to write down a sentence in Greek. Some years ago I used in another project for the same situation:

\usepackage[polutonikogreek,english]{babel}

and when I had to write in Greek I was using:

\foreignlanguage{polutonikogreek}{...}

In my current project instead I have this kind of settings:

\documentclass[11pt, english, ...]

What I just tried to do then is adding the polutonikogreek to the document class. Unfortunately it didn't work. By searching online then I found people saying to add the greek.polutoniko and so it became:

\documentclass[11pt, english, greek.polutoniko, ...]

And the package is loaded. Then, in order to write the text in Greek, I should use:

\textgreek{...}

Unfortunately \textgreek{} is a call not recognized. So I moved forward and I saw some answers saying to use:

\usepackage{fontspec}

but it gives me back the error:

The fontspec package requires either XeTeX or LuaTeX.
You must change your typesetting engine to, e.g., "xelatex" or
"lualatex"instead of plain "latex" or "pdflatex".

So, at the end I wasn't able to write my sentence in Greek. Can you help me understanding how to do it please? Thanks in advance!

EDIT: This is my whole document class

\documentclass[11pt, english, singlespacing, headsepline, ]{MastersDoctoralThesis}
  • Have you used xelatex or lualatex then? – user31729 Aug 30 '16 at 11:21
  • @ChristianHupfer no, my bad. pdflatex is in my requirements. Sorry for forgetting to write it down – Enrico Ribelli Aug 30 '16 at 11:25
  • Is pdflatex really in your requirements, or an engine which outputs a .pdf file? – Bernard Aug 30 '16 at 11:28
  • See How do I write “amartia” in polytonic Greek, does it help? – Alenanno Aug 30 '16 at 11:30
  • @Bernard it really is in my requirements unfortunately – Enrico Ribelli Aug 30 '16 at 11:34
3

For a single sentence in Greek you don't need to load babel-greek. If you are using UTF-8 as the file encoding you can use the first way; otherwise use the transliteration below.

\documentclass{article}
\usepackage[utf8]{inputenc}

\usepackage{textgreek}

\begin{document}

{\textgreekfont Πάτερ ἡμῶν ὁ ἐν τοῖς οὐρανοῖς}

{\textgreekfont\catcode`~=12 P'ater <hm~wn <o >en to~is o>urano~is}

\end{document}

enter image description here

  • This definitely solved my question! Thank you very very much! – Enrico Ribelli Aug 30 '16 at 16:48
4

Your custom class is already loading babel at line 155:

enter image description here

So if you load it again in your document, you get an Option Clash error. Now, a good rule of thumb is never to edit classes or packages, so to circumvent this, you can add \PassOptionsToPackage before the \documentclass is declared.

Output

enter image description here

Code

\PassOptionsToPackage{greek.polutoniko, main=english}{babel}
\documentclass[11pt, english, singlespacing, headsepline]{MastersDoctoralThesis}
\usepackage[utf8]{inputenc}

\begin{document}
Cosmos in Greek is \textgreek{Κόσμος}
\end{document}
  • Sometimes you don't have a choice but to edit the class or package, though. I have encountered a journal style file that redefines \p@ (among other cardinal sins...) – zwol Aug 30 '16 at 17:51
  • @zwol If the license of the class allows you to change it, you are free to do so. If a journal class redefines stuff, they have a pretty good reason. I wouldn't touch it. They won't care about your changes. – Johannes_B Sep 3 '16 at 12:16
  • @Johannes_B You maybe don't realize how disastrous redefining things in the guts of LaTeX can be... – zwol Sep 3 '16 at 19:06
  • @zwol I surely do. And i know, i can't simply change lines of The Lord of the Rings, and say it is the same. There are issues. – Johannes_B Sep 3 '16 at 19:55
  • @Johannes_B In the not-at-all-hypothetical situation with the journal style file that redefined \p@, what I did was fix it (with each change from the original clearly marked) and then put a README in with the sources to warn them that the document won't compile if they put back their version. And we'll see what happens. :-/ – zwol Sep 3 '16 at 20:06

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.