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.

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;"
share|improve this question
6  
Unrelated comment: you shouldn't use $$ .. $$, see Why is \[ … \] preferable to $$? –  Torbjørn T. Jul 21 '12 at 11:41
2  
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
2  
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
1  
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

1 Answer 1

up vote 10 down vote accepted

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.

share|improve this answer
    
I will edit here once the fix is sent to CTAN: I'm going to sort out the appropriate bits and pieces and talk with Will Robertson. –  Joseph Wright Jul 25 '12 at 16:46
    
BTW, I have logged this as an issue on GitHub, so people can track what is happening. –  Joseph Wright Jul 25 '12 at 19:36
1  
Dammit, sorry about this — all my fault. Will fix ASAP (likely tonight). –  Will Robertson Jul 26 '12 at 3:22
1  
Should be fixed now; not sure when the update will propagate to TL. –  Will Robertson Jul 28 '12 at 5:43

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.