Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am trying to set a specific font for polutonikogreek. To make it easy to switch to that language, I defined the following command:

\newfontfamily{\Vusillus}[]{Vusillus Old Face}
\newcommand{\greek}[1]{{%
\Vusillus\selectlanguage{polutonikogreek}#1%
}}  

But when I try something like this:

\greek{>erot'aw}

the font Vusillus Old Face isn't used, while this:

\Vusillus Something without a meaning

works well. Am I missing something?

Here an working example:

\documentclass[10pt,twoside]{memoir}
\usepackage[english,greek,polutonikogreek,ngerman,german]{babel}
\usepackage{blindtext}
\usepackage[utf8]{inputenc} 
\usepackage{scrpage2}

% rubber: set program xelatex

\usepackage{fontspec}
\usepackage{xltxtra}
\setmainfont[Numbers={OldStyle},Ligatures={Common, Historic}]{Adobe Garamond Pro}

\newfontfamily{\Vusillus}[]{Vusillus Old Face}
\newcommand{\greek}[1]{{%
\Vusillus\selectlanguage{polutonikogreek}#1%
}}

\begin{document}
Das ist nur ein Flie{\ss}text, sonst nichts: {\greek{>erot'aw}} und {\greek{>'erowc}}.
As you may have noticed the greek words are not in Vusillus, but \Vusillus this text actually is.
\end{document}
share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

You can't do that way. With babel, the \greek command switches to an internal font encoding that's not understood by OpenType fonts (see later for more information).

With Polyglossia you can define a \greekfont that will do as you want, provided you input the Greek text using the actual characters.

\documentclass[10pt,twoside]{memoir}
\usepackage{polyglossia}
\setmainlanguage[spelling=new]{german}
\setotherlanguage[variant=polytonic]{greek}
\setotherlanguage{english}

\usepackage{fontspec}
\setmainfont[Ligatures=TeX]{Hoefler Text}

\newfontfamily{\greekfont}[Ligatures=TeX]{Old Standard}

\begin{document}

Das ist nur ein Flie{\ss}text, sonst nichts: 
\textgreek{ἐροτάω} und \textgreek{ἔροως}.

\begin{otherlanguage*}{english}
As you may have noticed the greek words \emph{are} in Old Standard,
like \greekfont this text actually is.
\end{otherlanguage*}

\end{document}

Note that inputenc must not be used with XeLaTeX. I simplified the language calls and used fonts I have on my system.

enter image description here

What about entering Greek text with the old transliteration scheme? See How to insert Greek with "ascii keyboard" and XeTeX, Polyglossia

After building the asciitogreek.tec file following the instructions, the input can become

\documentclass[10pt,twoside]{memoir}
\usepackage{polyglossia}
\setmainlanguage[spelling=new]{german}
\setotherlanguage[variant=polytonic]{greek}
\setotherlanguage{english}

\usepackage{fontspec}
\setmainfont[Ligatures=TeX]{Hoefler Text}

\newfontfamily{\greekfont}[Mapping=asciitogreek]{Old Standard}

\begin{document}

Das ist nur ein Flie{\ss}text, sonst nichts: 
\textgreek{>erot'aw} und \textgreek{>'erowc}.

\begin{otherlanguage*}{english}
As you may have noticed the greek words \emph{are} in Old Standard,
like \greekfont this text actually is.
\end{otherlanguage*}

\end{document}

Of course also text after \greekfont will be transliterated (I left it just by way of example). You can also use direct input of Greek characters.

enter image description here

Actually there is a problem with ~, see the linked answer for a workaround.

share|improve this answer
    
Ereg, you are my hero! I used the first variant, and it work's perfect! –  user5950 Sep 26 '13 at 14:24
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.