unicode-math icon indicating copy to clipboard operation
unicode-math copied to clipboard

subscript position

Open mengchaoheng opened this issue 11 months ago • 5 comments

Description

After using \usepackage{unicode-math} , the subscript position moves down.

Add info or delete as appropriate:

  • Relevant for XeTeX

Minimal example demonstrating the issue

\documentclass{article}
% \usepackage{unicode-math}
\begin{document}
$A_i$, $W_i$

$A^i$, $W^i$
\end{document}

result is on the left.

then change the code

\documentclass{article}
\usepackage{unicode-math}
\begin{document}
$A_i$, $W_i$

$A^i$, $W^i$
\end{document}

result is on the right, which the subscript position is moves down.

## Further details

mengchaoheng avatar Dec 20 '24 11:12 mengchaoheng

in all flavours of tex the subscript offset is a parameter set by the font metrics (the Math table in opentype fonts) so if you select a different font the parameters change. Here you are switching between computer modern tfm fonts and Latin Modern math Opentype.

davidcarlisle avatar Dec 20 '24 11:12 davidcarlisle

I have considered this reason, but I switched several fonts and found that they all moved down to varying degrees. So I want to ask if there is a way to prevent it from moving down when using XITS Math, and where can I control the amount of movement? @davidcarlisle

mengchaoheng avatar Dec 20 '24 11:12 mengchaoheng

It seems to have nothing to do with the font. The same font, but the subscript position is different after using the unicode-math macro package.

mengchaoheng avatar Dec 20 '24 13:12 mengchaoheng

When you use the unicode-math package and do not specify a font, it actually uses the Latin Modern Math font. In other words, you are comparing Computer Modern and Latin Modern Math. In the following example, a comparison between STIX and XITS is made, which is a more reasonable comparison that can somewhat reflect whether the issue is related to unicode-math. The following example demonstrates that the subscript position remains unchanged, indicating that it is at least related to the font.

\documentclass{article}
% \usepackage{unicode-math}
% \setmathfont{XITS Math}
\usepackage{stix}
\begin{document}
$A_i$\par
$W_i$\par
$A^i$\par
$W^i$
\end{document}

image

note286 avatar Dec 20 '24 14:12 note286

It seems to have nothing to do with the font. The same font, but the subscript position is different after using the unicode-math macro package.

A I wrote originally: one of your examples is using computer modern math italic (Knuth's original 8 bit tfm font metrics) and your second example is using Latin Modern OpenType. So completely different font technology.

davidcarlisle avatar Dec 20 '24 14:12 davidcarlisle