For many years I've been using the subalign environment described in Align in Substack. However, with a fully updated version of TexLive 2023 I've recently observed a negative interaction with unicode-math. Consider the following MWE:
\documentclass{article}
\usepackage{fontspec}
\usepackage{unicode-math}
\usepackage{amsmath}
\makeatletter
\newcommand{\subalign}[1]{%
\vcenter{%
\Let@ \restore@math@cr \default@tag
\baselineskip\fontdimen10 \scriptfont\tw@
\advance\baselineskip\fontdimen12 \scriptfont\tw@
\lineskip\thr@@\fontdimen8 \scriptfont\thr@@
\lineskiplimit\lineskip
\ialign{\hfil$\m@th\scriptstyle##$&$\m@th\scriptstyle{}##$\hfil\crcr
#1\crcr
}%
}%
}
\makeatother
\begin{document}
[
\sum_{\substack{n=1\n\neq i}}^N
\sum_{\subalign{n&=1\n&\neq i}}^N
\sum_{\subalign{uvw&=1\n&\neq ijk}}^N
]
\end{document}
which renders as:
with there being a large amount of extra vertical spacing in the subalign environment but not in the substack environment. Commenting the unicode-math use resolve these issues.


