30

How do I type upright Greek letters? I have tried upgreek but it uses specific fonts (Euler or Adobe Symbol).

I want to use the upright Greek letters in the actual font being used. I'm thinking of the following solutions:

  1. XeTeX
  2. Direct ASCII code input
  3. \alpha, beta, \mu, etc. but in text mode

I am inclined to #3. Hopefully it doesn't require inputenc modifications. But of course any solution is welcome.

4 Answers 4

33

You can pass the options [greek,english] to the babel package. Then you can switch between them using \greektext and \latintext.

\documentclass{article}
\usepackage[greek,english]{babel}
\begin{document}

\greektext
A whole paragraph in greek letters
\latintext

% If we only want a single letter, it might make sense to define commands:

\newcommand{\ga}{\greektext a\latintext}
\newcommand{\gA}{\greektext A\latintext}

\gA lph\ga
\end{document}

greek and english letters

6
  • 4
    Good answer and you can use "polutoniko" as a babel option to get accents if you wish.
    – yannisl
    Jan 18, 2011 at 16:45
  • This does not work for me. If I try something like this, greek mode appears in many more places.
    – Raphael
    Sep 6, 2013 at 14:48
  • @Raphael: It's probably best if you open a new question for this.
    – Jake
    Sep 6, 2013 at 14:51
  • @Jake I have not been able to come up with a MFE, so it was probably some weird interaction of packages. Luckily, I found another solution.
    – Raphael
    Sep 6, 2013 at 15:02
  • 4
    There's also \textgreek that takes an argument and is better than switching languages back and forth. And, of course, \textlatin. So \textgreek{A}lph\textgreek{a} might be better.
    – egreg
    Sep 6, 2013 at 15:06
9

Package textgreek seems to work without any hassle. It provides commands like \textalpha and allows you to choose between fonts cbgreek, euler and artemisia.

4

Two solutions involving XeLaTeX

Polyglossia

With Polyglossia the hyphenations rules are loaded correctly for all the declared languages.

\documentclass{article}
\usepackage{polyglossia}
\setmainlanguage{english}
\setotherlanguage[variant=mono]{greek}

% Fonts
\setmainfont[Mapping=tex-text]{Linux Libertine O}

\begin{document}
\section{Τίτλος Κεφαλαίου}
English text.  % Main language doesn't need declaration.

\begin{greek} % Secondary languages need to be declared.
Ελληνικό κείμενο.
\end{greek}

\end{document}

You could probably define a shortcut for the greek environment, like

\newcommand{\gr}[1]{\begin{greek}#1\end{greek}}
...
\gr{Και άλλο ελληνικό κείμενο}
...

xgreek

With xgreek you can use upright letters for both languages out of the box. Keep in mind that this package is mainly used for the typesetting of greek texts. If the main language of your documents is english, better stick with polyglossia.

In your case, the main problems with xgreek is that in order to have hyphenation in english, you must explicitly declare the text as english one and that chapters, sections, captions etc would be translated in greek.

\documentclass{article}
\usepackage{fontspec}
\usepackage{xgreek}
\setmainfont{Linux Libertine O}

% This command allows the use of both english and greek text with correct hyphenation.
% English text must be placed in braces. Example:
% Ελληνικό κείμενο. \en{English text.} Ελληνικό κείμενο.
\newcommand{\en}[1]{\setlanguage{american}#1\setlanguage{monogreek}}

\begin{document}
    \en{I want to use the upright Greek letters in the actual font being used and I want the hyphenation rules to work correctly!}

    Οι ελληνικοί κανόνες συλλαβισμού δουλεύουν χωρίς προβλήματα.
\end{document}
2
  • Seems like you interchanged the languages in the comment in your xgreek code … ;-)
    – Tobi
    Sep 6, 2013 at 15:54
  • @Tobi: I proposed an edit to the post for fixing that. Nov 23, 2013 at 0:30
1

Method 3 is easy to achieve with the "alphabeta" package from greek-fontenc:

\documentclass{article}
\usepackage{alphabeta}
\begin{document}
You may use literal Unicode characters or the macros known
from math mode.

Beware of \gamma-rays, \pi-mesons and \beta-carotin.

Beware of γ-rays, π-mesons and β-carotin.

\end{document}

Mind, that the symbol variants are not supported with 8-bit Greek text fonts (see http://mirrors.ctan.org/language/greek/greek-fontenc/alphabeta-doc.pdf).

1
  • 1
    Please, avoid the minimal class for examples like this. It's not meant for such usage.
    – egreg
    Jan 30, 2023 at 23:25

You must log in to answer this question.

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