[Tex/LaTex] Upright greeks in Asana-math

unicode-mathxetex

I'm using

  • XeTeX,
  • unicode-math with
  • Asana-math.otf

and required to make all greek letters in math — upright. Asana-math seem to have upright greek letters:

enter image description here

(on the contrary I can't find italic greek letters in the file). But if I call \mathnormal I don't get any output at all:

\documentclass{article}

\usepackage{fontspec} % enagles loading of OpenType fonts
\usepackage{polyglossia} % support for languages

% fonts:
\defaultfontfeatures{Scale=MatchLowercase,Mapping=tex-text} % without this XeLaTeX won't turn "--" into dashes
\setmainfont{DejaVu Sans}
\setsansfont{DejaVu Sans}
\setmonofont{DejaVu Sans Mono}

% math:
\usepackage{amsmath} % for some math commands/symbols
\usepackage{amssymb} % for commands like \gg and \ll
\usepackage{mathtools} % for things like Vmatrix*
\usepackage{IEEEtrantools} % for advanced typesetting like multiline equations, and the likes.
\usepackage{unicode-math} % to use unicode in the formulas -- to improve readability of sources
\setmathfont{Asana-Math.otf} % it is important to have this line after the amsmath, mathtools and other maths

\begin{document}

Test upright greeks:
\begin{IEEEeqnarray}{rCl}
  α & = & \mathnormal{α} \;.
\end{IEEEeqnarray}

\end{document}

I get no upright letter at all:

enter image description here

Is there a way I can get upright greeks with unicode-math, Asana-math font?

Edit:

I thought maybe it's a font issue. So I tried Latin Modern Math:

\setmathfont[Path=fnt/]{latinmodern-math.otf}

but no luck!

Edit 2:

In my complex setup I get issues with sqrt and few other symbols — when I specify range as in egreg solution. I added expression with sqrt to egreg's solution to reproduce the error:

enter image description here

As You see I can't reproduce the sqrt issue, but I get box on the second line.

Edit 3:

After I upgraded unicode-math to 0.7e I can reproduce the sqrt issue:

enter image description here

Here's a full log. I read it and I noted:

Missing character: There is no ϵ in font [Asana-Math.otf]/ICU:script=math;lang
uage=DFLT;mapping=tex-text;!
Missing character: There is no ≫ in font cmr10!
Missing character: There is no ≪ in font cmr10!

lines. So probably have outdated Asana-Math.otf.

Edit 4:

After I updated Asana-Math the epsilon issue is resolved, but not the sqrt one:

enter image description here

And I still get:

Missing character: There is no ≫ in font cmr10!

What is that cmr10?

Best Answer

You can define a new math alphabet that uses the math-style=french option for the Greek lowercase letters:

\documentclass{article}

\usepackage{fontspec} % enagles loading of OpenType fonts
\usepackage{polyglossia} % support for languages

% fonts:
\defaultfontfeatures{Scale=MatchLowercase,Ligatures=TeX} % without this XeLaTeX won't turn "--" into dashes
\setmainfont{DejaVu Sans}
\setsansfont{DejaVu Sans}
\setmonofont{DejaVu Sans Mono}

% math:
\usepackage{amsmath} % for some math commands/symbols
\usepackage{mathtools} % for things like Vmatrix*
\usepackage{IEEEtrantools} % for advanced typesetting like multiline equations, and the likes.
\usepackage{unicode-math} % to use unicode in the formulas -- to improve readability of sources
\setmathfont{Asana-Math.otf} % it is important to have this line after the amsmath, mathtools and other maths
\setmathfont[math-style=french,range={"3B1-"3C9,"1D6FC-"1D71B}]{Asana-Math.otf}
\begin{document}

Test upright greeks: $αβγδεζηθικλμνξοπρστυφχψω+xyz$

Test: $\alpha\beta\gamma\delta\epsilon+xyz$

Test: $a\gg\theta$ $\beta\ll y$

\end{document}

Note that amssymb is not needed: all symbols it defines are covered by Unicode math. I've added both the ranges for Greek lowercase and math Greek lowercase for greater safety.

enter image description here