5

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?

5
  • With unicode-math version 0.7e and Asana-Math.otf version 000.949 I get correct output both for epsilon and the square root. Don't load amssymb; I get correct output without it and the input $a≫\theta$
    – egreg
    May 18, 2013 at 17:12
  • I don't load amssymb -- I started from Your solution.
    – Adobe
    May 18, 2013 at 17:13
  • It's some weird bug in my set up. I wanted to note that it's note that important because when I'm not using range I seem to have everything working.
    – Adobe
    May 18, 2013 at 17:14
  • What output do you get from otfinfo -v $(kpsewhich Asana-Math.otf)?
    – egreg
    May 18, 2013 at 17:15
  • It's 000.907. But I'm using newest version: \setmathfont[Path=fnt/,math-style=french]{Asana-Math.otf} and that one is: 000.949.
    – Adobe
    May 18, 2013 at 17:17

1 Answer 1

4

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

9
  • Thank You very much. A question though: "3B1-"3C9 are lowercase greeks; but who are "1D6FC-"1D71B?
    – Adobe
    May 18, 2013 at 14:48
  • 1
    @Adobe They are the "math lowercase Greek" range; for instance U+1D6FC is MATHEMATICAL ITALIC SMALL ALPHA. So, if you happen to copy-paste a symbol, you'd get the correct upright letter.
    – egreg
    May 18, 2013 at 15:02
  • If I specify range I break root and many other symbols. If I don't specify range -- I don't break anything and still have upright greeks.
    – Adobe
    May 18, 2013 at 15:32
  • @Adobe I don't understand. What's broken with my code?
    – egreg
    May 18, 2013 at 15:34
  • I've update the question and added a screenshot there. I can't reproduce the sqrt issue I'm facing with my set up, but I did get other font issue. See the screenshot.
    – Adobe
    May 18, 2013 at 16:12

You must log in to answer this question.

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