8

I was trying to type in upright greek letters in LaTex, and I've been recommended to use LuaLaTex with Unicode-math package to accomplish that.

However I ran into a weird issue. If I want to type in upright letter $\upmu$, it will be displayed as italicized. I can only get it by typing \mathrm{\mu}. Below is an example and its output. Am I missing something obvious here?

Thanks for your help.

enter image description here

\documentclass{article}
\usepackage{upgreek}
\usepackage{amsmath}
\usepackage{unicode-math}

\begin{document}
This will not work: $\upmu$ $\mitAlpha$

But this will work: $\mathrm{\mu}$ $\mathit{\Alpha}$
\end{document}
  • Do you want all Greek letters upright as standard or is the focus here only the single case of pi? – Joseph Wright Nov 26 '14 at 9:49
  • Hi Joseph, only the single case. I looked up the table in unicode-math manual (ctan.math.utah.edu/ctan/tex-archive/macros/latex/contrib/…) and it shows that the upright greeks should be produced by "\up*" commands. Just curious why this does not work here. – yuntaoc Nov 26 '14 at 9:54
  • I agree the doc does seem to be confusing: I'll report this to Will. [An aside: You can get that file on your system using texdoc -l unicode-math or using the generic CTAN linke mirror.ctan.org/tex-archive/macros/latex/contrib/unicode-math/… – Joseph Wright Nov 26 '14 at 10:12
  • 3
    @JosephWright: Imho it is not only a documentation problem. Like Manuel I do find it illogical that an \up.. command ends up italic. There should be a clear distinction between the layer of "fix" commands names that allows one to access a specific symbol (and which should be complete) and the layer of generic commands which are affected by math styles and other options. – Ulrike Fischer Nov 26 '14 at 10:18
  • @UlrikeFischer Yes I agree, but at the least the docs should make this clear. I've sent Will an e-mail to say it needs addressing. – Joseph Wright Nov 26 '14 at 10:22
7

How greek letter are typeset depends on the option math-style. With e.g. french both \upmu and \mu will be upright, with ISO both are italic. (I do find this confusing too, that \upXXX ends up italic ...). If you want to force upright mode for a single instance use a markup command like \mathup.

\documentclass{article}
\usepackage{amsmath}
\usepackage[math-style=ISO]{unicode-math} %or french, TeX, literal, upright

\begin{document}
$\upmu \mu x  $ 
$\mathup{\mu}$ 
$\mathit{\Alpha}$
\end{document}
  • 3
    If that's the expected behaviour, I think it's wrong. \itmu (or similar) should be italic and \upmu should be upright. Now the math-style should determine wether \mu equals \upmu or \itmu. – Manuel Nov 26 '14 at 10:03
  • Thanks Ulrike, this reminds me a paragraph in the unicode-math manual that I did not quite understand (5.1 Math ‘style’). I am wondering if math-style controls the typeset, then what is the difference between \mu and \upmu in terms of unicode mapping? – yuntaoc Nov 26 '14 at 10:07
  • @Manuel The name of italic variant is \mitmu (and like \upmu it changes with the math-style). And yes I would have found more logical too if both would not be affected by math-style.. – Ulrike Fischer Nov 26 '14 at 10:08
  • 2
    Might be worth reporting this to Will: it's entirely non-obvious from unimath-symbols that \upmu only works 'as described` if math-styl is set to something other than TeX! – Joseph Wright Nov 26 '14 at 10:11
  • @yuntaoc: \mu is defined as \mitmu. – Ulrike Fischer Nov 26 '14 at 10:11
3
\documentclass{article}
\usepackage{amsmath}
\usepackage{unicode-math}
\setmathfont{XITS Math}
\setmathfont[math-style=literal,range={"00F0-"03D6}]{XITS Math}

\begin{document}
This will work: $\upmu\upalpha x$ $\mitAlpha$

But this will work: $\mathrm{\mu}$ $\mathit{\Alpha}$
\end{document}
  • Yes, but literal will affect also normal variables like x, and you would have to type them as \mitx etc if you want italic variables. – Ulrike Fischer Nov 26 '14 at 10:09
  • 2
    Very true but I think entirely non-obvious from reading the docs! – Joseph Wright Nov 26 '14 at 10:09
  • Sure, but it is no problem to define the literal style only for the greek letters. See edited answer. – user2478 Nov 26 '14 at 10:28
  • Well that's a good idea. – Ulrike Fischer Nov 26 '14 at 10:30
  • @Herbert thanks for the alternative approach. – yuntaoc Nov 26 '14 at 10:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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