Edited to provide more details
I managed to track down the related changes made in v0.8g. In particular, the follow code was introduced in um-code-main.dtx
:
\cs_new:Nn \@@_declare_math_sizes:
{
\dim_compare:nF { \fontdimen 10 \g_@@_trial_font == 0pt }
{
\DeclareMathSizes { \f@size } { \f@size }
{ \@@_fontdimen_to_scale:nN {10} \g_@@_trial_font }
{ \@@_fontdimen_to_scale:nN {11} \g_@@_trial_font }
}
}
We see that the unicode-math
package intentionally overwrites the declaration of math sizes at \normalsize
. This is because OpenType math fonts contain additional parameters ScriptPercentScaleDown
(\fontdimen10
) and ScriptScriptPercentScaleDown
(\fontdimen11
). For OpenType Latin Modern Math, these are 70
and 50
, respectively.
Therefore, in a 12pt
article, the intended font sizes (according to the new unicode-math
) for first- and second-level scripts are 8.4pt
and 6pt
, respectively. Note that the LaTeX kernel legacy declarations are 8pt
and 6pt
for first- and second-level scripts in 12pt
text. So, you would observe slightly larger first-level scripts using unicode-math
.
There are more subtle differences in 12pt
article between pdfLaTeX’s \usepackage{lmodern}
and XeLaTeX/LuaLaTeX’s \usepackage{unicode-math}
with OTF LM Math.
In the pdfLaTeX case, the design sizes used at text-size, script-size and script-script-size are LMMathItalic12
, LMMathItalic8
and LMMathItalic6
, respectively.
But in the XeLaTeX/LuaLaTeX case with \usepackage{unicode-math}
, the text-size uses OTF LM Math 10pt
font scaled up to 12pt
, the script-size uses OTF LM Math 7pt
font scaled up to 8.4pt
, and the script-script-size uses OTF LM Math 5pt
font scaled up to 6pt
.
Addendum
The strange 8.41483pt
for the first-level script is due to the improper order of floating-point arithmetic.
I have provided a fix for the rounding error (not for honoring the original math size declarations, as I believe we should use the OpenType parameters) in the issue opened by @egreg:
\documentclass[12pt]{article}
\usepackage{unicode-math}
\ExplSyntaxOn
\cs_set:Nn \__um_fontdimen_to_percent:nN
{
\fp_eval:n { \dim_to_decimal:n { 65536 \fontdimen #1 #2 } / 100 }
}
\ExplSyntaxOff
\begin{document}
\begin{equation}
x^Ax^Bx^Cx^Dx^Ex^Fx^Gx^Hx^Ix^Jx^Kx^Lx^Mx^Nx^Ox^Px^Qx^Rx^Sx^Tx^Ux^Vx^Wx^Xx^Yx^Z
\end{equation}
\end{document}
Hopefully this will be implemented soon. This has made into the source code of unicode-math
. So no more rounding errors, yeah!