# Subscript placement differs with unicode-math. Intended?

There are several question here that ask why unicode-math documents have a different alignment of subscripts (1, 2, 3). But they all share two common points: They think this is bug, and they think it is related to XeLaTeX only.

However, the document

\documentclass{minimal}
\usepackage{unicode-math}
\begin{document}
$a_b$
\end{document}


renders identical in XeLaTeX und LuaLaTeX, today. Although I am not sure I like the change, I think this is intended and I'd like to have an more or less official answer to that.

Left side: Rendering of XeLaTeX/LuaLaTeX with the code from above.
Right side: Rendering without \usepackage{unicode-math}.

As you can see, different fonts are being used. So I guess the difference is due to that.

Do you think the differing subscript position this is intended behavior? Is there any more or less official statement about that?

• So your question is whether subscript placement differs with different fonts used? – TeXnician Jun 1 '18 at 9:32
• This is a font parameter, called sub1 or sub2 according to the LuaTeX manual. – Henri Menke Jun 1 '18 at 9:40
• @TeXnician No. My question is whether a visual deviation is intended by just adding \usepackage{unicode-math}. – mhchem Jun 1 '18 at 12:00

As you have already noted, you using different fonts. Different fonts have different parameters. The subscript shift is determined by a font parameter. Hence there will be a difference.

The computation of the subscript shift is detailed in appendix G of the TeXbook:

18b. If the superscript field is empty (so that there is a subscript only), set box 𝑥 to the subscript in style 𝐶↓, and add \scriptspace to 𝑤(𝑥). Append this box to the translation of the current item, shifting it down by max(𝑣,𝜎₁₆,ℎ(𝑥)-⅘ |𝜎₅|), and move to the next item. (The idea is to make sure that the subscript is shifted by at least 𝑣 and by at least 𝜎₁₆; furthermore, the top of the subscript should not extend above ⅘ of the current x-height.)

It might appear weird that Latin Modern and Computer Modern have different font parameters, because they look so similar. One might even think they look exactly the same, however this is not the case. Computer Modern and Latin Modern actually have very little in common. It is true that the shapes look similar but if you inspect them more closely you'll find a lot of differences. A lot of specific design decisions have been made by the creators which is detailed in their report in TUGboat: https://tug.org/TUGboat/tb37-3/tb117jackowski.pdf

• I don't see how that relates to my question. – mhchem Jun 1 '18 at 11:53
• @mhchem The subscript shift determined by font parameters. You are using different fonts in the example. Hence a difference is to be expected. – Henri Menke Jun 1 '18 at 22:09
• But why do the fonts not match? Someone created the OTF font so that the glyphs look completely identical to Knuth's original. So why did he/she not match the font parameters? Was this intended or a mistake, maybe even a bug? – mhchem Jun 2 '18 at 14:07
• @mhchem Computer Modern and Latin Modern actually have very little in common. It is true that the shapes look similar but if you inspect them more closely you'll find a lot of differences. See also this TUGboat: tug.org/TUGboat/tb37-3/tb117jackowski.pdf Actually you are not using Knuth's Computer Modern to begin with but the Type1 version by BlueSky, see math.utah.edu/~beebe/fonts/bluesky.html – Henri Menke Jun 8 '18 at 3:39
• Good! Please make that last comment an answer and I will chose it as the best answer. – mhchem Jun 8 '18 at 5:51