The fraction in textstyle is off the math axis in XeTeX when I use a Unicode math font. In LuaTeX, though, it aligns nicely with the math axis. The follwing MWE should illustrate this. Also, in displaystyle everything is fine.
\ifdefined\directlua
\input luaotfload.sty
\fi
$-{1\over 2}$%
\font\ms="Latin Modern Math:script=math;+ssty=0" at 7pt
\scriptfont0=\ms
$-{1\over 2}$
\bye
Here you can see the output for XeTeX and LuaTeX:
How can I fix this? Does it suffice to adjust \fontdimen
parameters?
This does not only happen in plain XeTeX, but also in LaTeX with the unicode-math
package. Unfortunately, I cannot show a side-by-side comparison here, because unicode-math
immediately changes the math font to “Latin Modern Math”.
\documentclass{standalone}
\usepackage{unicode-math}
\begin{document}
$-\frac{1}{2}$
\end{document}
As can be seen from Herbert's reply, the problem also occurs in other situations. Here I collect an incomplete list of questions reporting similar issues:
- \setbox containing maths interferes with surrounding math mode in XeTeX
- \scriptstyle affects \overline
- Bug in xelatex + unicode+math + vphantom
- Bug in xelatex + unicode-math + xits + \vphantom?
- xelatex + unicode-math + stackengine + \big = ↯
Unfortunately, the problem was not entirely fixed and messed up fontdimens still turn up in some places.
\fontdimen
parameters.at 7pt
seems to scale the fontdimen (try out 3pt for a more pronounced effect).\fontdimen
is responsible for that? I can only find ones for raising or lowering numerator and denominator but none for the bar or axis. Also setting, e.g.,\fontdimen42\scriptfont0=10pt
does not seem to have any effect.\fontdimen22
pertaining to\scriptfont2
instead of\textfont2
.