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've recently changed from pdftex to xetex to be able to write documents in Bembo Std but I'm not quite there yet. While trying to typeset some notes from one of my classes, I tried to typeset Greek symbols both inside (italic) and outside (non italic) of math mode. I tried to type an alpha with the Greek keyboard layout on Mac OS X 10.8 which worked, provided the font has a glyph for it, and I tried to change the font for Greek characters in math mode with the following:

\usepackage{mathspec} 
\setmainfont[Ligatures={Tex}]{Bembo Std}
\setmathsfont(Digits,Latin)[Scale=MatchLowercase]{Bembo Std}
\setmathsfont(Greek)[Scale=MatchLowercase]{STIXGeneral}

I'm using texlive 2012 with Texpad on Mac OS X 10.8. When trying the code above, xetex fails to typeset and seems to be stuck in an infinite loop. Commenting out the last line will make it typeset, but the used font for Greek letters will be Computer Modern. (Bembo Std doesn't contain any Greek glyphs (or at least my version doesn't) hence STIXGeneral.)

I've tried to find the cause of this problem in the log file, but I didn't get any wiser from reading it. The log with \tracingall:

https://www.dropbox.com/s/xxe5e6gifqvsd89/Metafysica.log

A minimal example:

\RequirePackage[l2tabu, orthodox]{nag} 

% Opmaak
\documentclass[11pt,oneside]{article}
\usepackage[a4paper]{geometry}
% \usepackage[artemisia]{textgreek}
 \usepackage[final,kerning=true,spacing=true,factor=1100,stretch=10,shrink=10]{microtype}

% Wiskunde
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage[math]{mathspec}
\setmainfont[Ligatures={Tex}]{Bembo Std}
\setmathsfont(Digits,Latin)[Scale=MatchLowercase]{Bembo Std}
% \setmathsfont(Greek)[Scale=MatchLowercase]{STIXGeneral}

% Varia
\usepackage{polyglossia}
\setdefaultlanguage{dutch}
\usepackage{hyperref}

\begin{document}

\section{Les 8}
De boeken worden vaak aangeduid met Romeinse cijfers, maar ook met Griekse letters. Zo staat boek I    ook gekend als boek A, boek II als boek α $\alpha$ (kleine alpha) en alle volgende boeken krijgen de alfabetisch hier op volgende Griekse letter toegewezen. 

\end{document}

How can I typeset Greek letters in mathmode in a different font? How can I typeset upright Greek letters with another font of my choice if the main font doesn't contain any glyphs for it?

share|improve this question
    
mathspec, especially with Greek, most often yields errors, when I try using ist, that's why I use unicode-math, but if you want to use a non-OpenMath-font, you need mathspec. If you strip your MWE of everything in the preamble, except the 3 mathspec-related lines, you still get errors. –  Toscho Apr 28 '13 at 18:04
add comment

1 Answer

up vote 3 down vote accepted

This problem arises in connection with the shorthands in Babel style that were introduced in Polyglossia after mathspec was released.

Basically the shorthand active character " gets a definition that overrides the one given by mathspec and infinite loops are behind the corner.

\documentclass[11pt,oneside]{article}
\usepackage[a4paper]{geometry}
\usepackage[final]{microtype}


% Wiskunde
\usepackage{amsmath}
\usepackage{amssymb}

\usepackage{mathspec}
\setmainfont[Ligatures=TeX]{Junicode}
\setmathsfont(Digits,Latin)[Scale=MatchLowercase]{Junicode}
\setmathsfont(Greek)[Scale=MatchLowercase]{STIXGeneral}

%%% this patch must go before loading polyglossia
\makeatletter
\begingroup\lccode`~=`"
\lowercase{\endgroup
  \everymath{\let~\eu@active@quote}
  \everydisplay{\let~\eu@active@quote}
}
\makeatother

\usepackage{polyglossia}
\setmainlanguage{dutch}

% Varia
\usepackage{hyperref}


\begin{document}

\section{Les 8}

De boeken worden vaak aangeduid met Romeinse cijfers, maar ook met Griekse 
letters. Zo staat boek I ook gekend als boek A, boek II als boek α $α$ $\alpha$
(kleine alpha) en alle volgende boeken krijgen de alfabetisch hier op volgende 
Griekse letter toegewezen.

\end{document}

I used Junicode as I don't have Bembo, but it's just the same. Also I showed that you can type both $α$ or $\alpha$ getting the same symbol.

enter image description here

share|improve this answer
    
Thank you for the explanation and showing the font Junicode which provides Greek glyphs. –  Johannes Apr 28 '13 at 21:29
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.