11

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;"
4
  • 6
    Unrelated comment: you shouldn't use $$ .. $$, see Why is \[ … \] preferable to $$? Jul 21, 2012 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? Jul 21, 2012 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. Jul 21, 2012 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. Jul 22, 2012 at 13:09

1 Answer 1

10

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.

4
  • 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, 2012 at 16:46
  • BTW, I have logged this as an issue on GitHub, so people can track what is happening.
    – Joseph Wright
    Jul 25, 2012 at 19:36
  • 1
    Dammit, sorry about this — all my fault. Will fix ASAP (likely tonight). Jul 26, 2012 at 3:22
  • 1
    Should be fixed now; not sure when the update will propagate to TL. Jul 28, 2012 at 5:43

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.