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.

This is a follow-up to this question. It explains switching math fonts within a single document with unicode-maths \mathversion command.

The unicode-math docs have it that

\setmathfont{math-style=Tex}{Cambria Math}

is equivalent to

\unimathsetup{math-style=Tex}
\setmathfont{Cambria Math}

Now if I want to use a math font that is by design upright e.g. the Neo Euler font. I have to use

\setmathfont{math-style=upright}{euler.otf}

If I want to switch between the Euler font and another one that is italic by design, say XITS. Using

\setmathfont[version=XM]{xits-math.otf}
\setmathfont[version=NE,math-style=upright]{euler.otf}

to be able to use \mathversion{NE} and \mathversion{XM} as in this example

\documentclass{minimal}
\usepackage{unicode-math}
\setmathfont[version=XM]{xits-math.otf}
\setmathfont[version=NE,math-style=upright]{euler.otf}
\begin{document}
\[a+b\]
\mathversion{NE}
\[a+b\]
\mathversion{XM}
\[a+b\]
\end{document}

does not work. math-style as a package option is not switched as well, so everything is typeset upright. I haven’t found a way around this, as package options are set when the package is loaded.

share|improve this question
    
Looks like a unicode-math bug to me, this does not seem to be an intended behavior. –  Khaled Hosny Feb 10 '12 at 13:34
    
Based on @KhaledHosny's comment, have you reported this as a bug? –  Joseph Wright Apr 15 '12 at 9:12
    
@Joseph Yes, that is what I did. –  uli Apr 16 '12 at 18:32
add comment

1 Answer

up vote 8 down vote accepted

I've been wrong before but I think this isn't possible. \mathversion works by simply changing the font that each math char is pointing to, whereas to change from upright to italic maths you need to remap every single symbol that would be affected by the change.

It doesn't seem likely to me that people will want to change this often if ever in a document, so I don't think it's that cumbersome to write instead

\setmathfont[math-style=TeX]{xits-math.otf}
\[a+b\]
\setmathfont[math-style=upright]{euler.otf}
\[a+b\]

and so on.

share|improve this answer
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.