Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

subscript position #645

Open
mengchaoheng opened this issue Dec 20, 2024 · 5 comments
Open

subscript position #645

mengchaoheng opened this issue Dec 20, 2024 · 5 comments

Comments

@mengchaoheng
Copy link

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
@davidcarlisle
Copy link
Member

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.

@mengchaoheng
Copy link
Author

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
Copy link
Author

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.

@note286
Copy link

note286 commented Dec 20, 2024

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

@davidcarlisle
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants