Greek In Latex

2010 Jun 30

Summary

Method latin input greek input
babel \latintext Latin \greektext Ellhnik'a
babel+inputenc \latintext Latin \greektext Ελληνικά
auto-greek Latin Ελληνικά
greektex Latin Ελληνικά
xelatex Latin Ελληνικά
Method Preamble
babel \usepackage[english,greek]{babel}
babel+inputenc \usepackage[english,greek]{babel} \usepackage[iso-8859-7]{inputenc}
auto-greek Latin
greektex Latin
xelatex Latin

Babel

The “standard” way of writing greek in LaTeX, is by using the babel package. You simply insert \usepackage[greek]{babel} in the preamble of your document and you are set. For example:

\documentclass{article}
\usepackage[greek]{babel}

\begin{document}
Ellhnik`o ke`imeno.
\end{document}

Using this method, you have to write latin characters to produce the greek text. So, writing

abgdezhjiklmnxoprs(c)tufqyw
you get:

and

'a `a "i "`i
gives you:

If you want to use more than one languages, you include them as options of the babel package (the last being the main language): \usepackage[english, greek]{babel} (main language is greek, so “Contents” will appear as “Περιεχόμενα” etc). To switch between greek and latin text, you have to use the commands \latintext and \greektext. (You may also use \selectlanguage{language} instead.) Putting all of the above together, the following code:

\documentclass{article} 
\usepackage[english, greek]{babel} 
\title{T`itlos} 
\author{N`ikos Aug`oc}
\begin{document} 
\maketitle 
abgdezhjiklmnxoprs(c)tufqyw\\ 
'a `a "i "`i 
\latintext Latin text \greektext Ellhnik`o ke`imeno
\end{document} 

will give you:

babel-greek-article

Babel + inputenc

If you do not want (as is usually the case) to write latin-text for greek, you’ll have to use the inputenc package. Insert the command \usepackage[iso-8859-7]{inputenc} (or utf-8) in the preamble of your document. So this:

\documentclass{article} 
\usepackage[english, greek]{babel}
\usepackage[iso-8859-7]{inputenc} 

\title{T`itlos} 
\author{N`ikos Aug`oc} 

\begin{document} 
\maketitle abgdezhjiklmnxoprs(c)tufqyw\\
'a `a "i "`i 

\latintext Latin text 
\greektext Ελληνικό κείμενο

\end{document} 

gives the same output as above.

auto-greek

Assuming that you are writing a greek document (so you only need greek headings), you can avoid continuously typing \latintext, \greektext, or any other command of the kind, by using the package auto-greek. Putting \usepackage{auto-greek} in the preamble, you can write both greek and latin text directly. So,

\documentclass{article} 
\usepackage{auto-greek} 
\title{Τίτλος}
\author{Νίκος Αυγός} 
\begin{document} 
\maketitle 

Ελληνικό και latin κείμενο. 
\end{document} 

gives you

auto greek text

XeLaTeX

Xe(La)TeX is a modern (La)Tex engine which supports unicode by default. It avoids most of the pitfalls of all the other methods (on the “fonts” front) but is not as yet as advanced in microtypography. If font problems are your main issue with LaTeX then this should be your first choice.