# Cambria Math becomes plain Cambria

I'm a LaTeX neophyte, so please excuse my ignorance.

I want to typeset a document with text in Cambria and math in Cambria Math. I found the unicode-math package, which seems to do what I want.

Here is a simple sample:

\documentclass{article}

\usepackage{unicode-math}
\setmainfont{Cambria}
\setmathfont{Cambria Math}

\begin{document}

The Bezier curve $C$ of degree $m$ is
$$C(u) = \sum_{i=0}^m f_i(u)P_i$$

\end{document}


The math is coming out as plain (upright) Cambria.

Any idea what might be going wrong ??

[Elaboration]: I'm using MikTeX 2.9, and XeLateX. I updated the XeTeX version because unicode-math told me to. I'm just choosing an option from the TeXworks menu. I don't know what's happening behind the scenes (and I hope I don't need to know).

Here is some log file output that might be relevant:

Requested font "Cambria/ICU:script=latn;language=DFLT;" at 10.0pt
-> C:/Windows/Fonts/CAMBRIA.TTC
Requested font "Cambria Math/ICU" at 10.0pt
-> C:/Windows/Fonts/CAMBRIA.TTC
\g_fontspec_family_Cambria Math_int=\count125
Requested font "Cambria Math/B/ICU" at 10.0pt
-> C:/Windows/Fonts/CAMBRIA.TTC
.................................................
. fontspec info: "no-font-shape"
.
. Could not resolve font Cambria Math/B (it probably doesn't exist).
.................................................
. fontspec info: "defining-font"
.
. Font family 'CambriaMath(0)' created for font 'Cambria Math' with options
. [BoldItalicFont={},ItalicFont={},Script=Math,SizeFeatures={{Size=10-},{Size=7
-10,Font=Cambria
. Math,Style=MathScript},{Size=-7,Font=Cambria
. Math,Style=MathScriptScript}},].
.
. This font family consists of the following shapes:
.
. * 'normal' with NFSS spec.:
. <10->"Cambria Math/ICU:script=math;language=DFLT;"<7-10>"Cambria
. Math/ICU:script=math;language=DFLT;+ssty=0;"<-7>"Cambria
. Math/ICU:script=math;language=DFLT;+ssty=1;"

• Unrelated comment: you shouldn't use $$..$$, see Why is $…$ preferable to ? – Torbjørn T. Jul 21 '12 at 11:41
• Works fine for me with XeLaTeX and Lualatex (miktex 2.9). How are you compiling and what is your TeX-System? – Ulrike Fischer Jul 21 '12 at 11:46
• Add \XeTeXtracingfonts=1 to your document and compile on the command line with the option --output-driver="xdvipdfmx -vv". Put the log-file somewhere for download and show (copy&paste) the messages of xdvipdfmx in the terminal. – Ulrike Fischer Jul 21 '12 at 13:24
• I didn't wrote "show a snippet from your log". To make a diff with my log file I need the complete log-file. And I need the messages from xdvipdfmx. It would also be a good idea if you could put the pdf somewhere for download. – Ulrike Fischer Jul 22 '12 at 13:09

This behaviour is due to a known 'breaking' change in the latest l3kernel release (i.e. one which the team knew altered behaviour but which was felt was the best choice in the long term). As such, unicode-math needs to be updated to conform with the altered l3kernel code.
Temporary fix (use at own risk): Make a copy of unicode-math.sty in your local tree and do a search-and-replace for \l_keys_choice_int, replacing with \l_keys_choice_int \or. That will fix the issue until unicode-math is fixed officially. (At least it does in my quick tests.)
The fixed unicode-math is now available on CTAN and in TeX Live 2012. As anticipated, this deals with the issue and all is well again.