9

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:

\documentclass{standalone}
\usepackage{amsmath,accents}
\usepackage[no-math]{fontspec}
\usepackage{unicode-math}
   \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}$}
\begin{document}
\Huge

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

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.

Mico
  • 506,678
  • 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
  • 2
    Make sure you don't have a two different versions of xits font accessible to xetex, this is likely to be the case. – خالد حسني Nov 16 '11 at 20:13

1 Answers1

13

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.