# [luatex] sub and superscripts in Lua(La)TeX with tfm/otf

Ulrike Fischer luatex at nililand.de
Mon Jun 13 14:53:01 CEST 2016

Am Mon, 13 Jun 2016 11:35:11 +0200 schrieb Arno Trautmann:

> Hi all,
>
> I encountered some strange behaviour regarding the subscript and
> superscripts in LuaLaTeX compared to pdfLaTeX. Consider the following
> small example:
>
> %\RequirePackage{luatex85}
> \documentclass{scrartcl}
> %\usepackage{subdepth}
> %\usepackage{unicode-math}
>
> \begin{document}
> $a_ia_i^+a^+a_i^\dagger$
> $M_n M_n^\dagger M_n^+$
> \end{document}
>
> Compilation with pdfLaTeX results in shifted positions for the sub and
> super scripts according to the TeXbook. The package subdepth equalizes
> them, which in this case looks nicer.
> With LuaLaTeX, the subdepth package does not work, and has no effect on
> the positioning whatsoever. David suggested to ask for a reason for this
> behaviour on the luatex-list.

As far as I understand the documentation (and the result of some
font to setup some primitive parameters. If you later want to change
the values you have to change the primitives and not the \fontdimens
(as the subdepth package does).

This here works with and without unicode-math and moves one of the
subscripts n down:

\documentclass{scrartcl}
%\usepackage{subdepth}
%\usepackage{unicode-math}

\begin{document}

$M_n M_n^\dagger M_n^+$

\Umathsubshiftdown\displaystyle=5pt
\Umathsubshiftdown\textstyle=5pt

$M_n M_n^\dagger M_n^+$

$M_n M_n^\dagger M_n^+$

\end{document}

For more parameters see 6.4 Math parameter settings in the luatex
documentation.

--
Ulrike Fischer
http://www.troubleshooting-tex.de/