TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Prompted in part by the question Is there an "underscript" command?, I started wondering if the \underset (from amsmath) and \underaccent (from accents) commands work equally when using XeLaTeX instead of pdflatex. The following code and associated output show that this is not the case for the XITS Math package:

   \setmathfont[version=cambria]{Cambria Math}
   \setmathfont[version=lm]{Latin Modern Math}
   \setmathfont[version=asana]{Asana Math}
   \setmathfont[version=xits]{XITS Math}
\newcommand\undersetunderaccent{$\underset{x}{A} \ \underaccent{x}{A}$}

\mathversion{lm}Latin Modern Math:       \undersetunderaccent\\
\mathversion{cambria} Cambria Math:      \undersetunderaccent\\
\mathversion{asana}   Asana Math:        \undersetunderaccent\\
\mathversion{xits}    XITS Math:         \undersetunderaccent

enter image description here

Clearly, the output of the two commands is rather different [!] when "XITS Math" is the math font. Does the XITS Math package have to be loaded with special options to suppress this behavior, or should I plan on sending a bug report to the maintainers of the XITS Math font and/or the maintainers of the unicode-math package?

Addenda: (i) I can generate the output above using both TeXLive 2011 and MiKTeX 2.9 (both updated yesterday); the OS is Windows Vista; all math fonts on my system are the latest ones available. (ii) The problems with "XITS Math" do not arise if I run the example code above under luatlatex instead of under xelatex.

share|improve this question
This doesn't happen for me. Which versions are you using? – Caramdir Nov 16 '11 at 19:17
The same thing happens for me, except that it is the Asana version that is the problem, and I get a z over a w. Works fine with lualatex though. – Torbjørn T. Nov 16 '11 at 19:25
@TorbjørnT. and Caramdir: I've provided an addendum to my question in which I provide more details on the TeX distributions and the OS in question. I also report that the problem does not arise when compiling the code under lualatex. – Mico Nov 16 '11 at 20:02
Make sure you don't have a two different versions of xits font accessible to xetex, this is likely to be the case. – Khaled Hosny Nov 16 '11 at 20:13
up vote 12 down vote accepted

This usually means you have several different versions of the font accessible to XeTeX. Because of the way XeTeX passes the font to the XDV driver (usually xdvipdfmx), sometimes the engine and the driver load different versions of the font when there is more than one and when they have different glyph id, you get effects like this.

You can use \XeTeXtracingfonts=1 in your document, and compile it with xelatex --output-driver="xdvipdfmx -vv" file.tex to see which fonts are loaded by the engine and driver.

Update: Just in case anyone is interested, this (long standing) issue is now more or less fixed. The fixed XeTeX version should ship with TeXLive 2012.

share|improve this answer
Your guess was spot-on! – Mico Nov 16 '11 at 21:39
It is a common issue, certainly a FAQ. – Khaled Hosny Nov 16 '11 at 21:55
This is REALLY a big help. I'd like to point out that xelatex does find installed fonts; at least to cause some trouble. I had issues with installed Miktex Asana Math and XITS font packages. – louis cypher Mar 9 '12 at 13:06

Your Answer


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.