Answering myself because it took me a while to discover the cause for this, and I think this would prove useful to others.
This is a bug in the undertilde.sty
package, explained as follows:
Vertical spacing in *TeX is controlled by two glues and one dimension: \baselineskip
, \lineskip
, and \lineskiplimit
.
\baselineskip
controls the distance from the baseline of one line to the baseline of the following line -- to oversimplify, the bottom-to-bottom distance. If this value is small enough relative to the typeset text, there may be collisions between lines. To avoid this, the distance from the bottom of the upper line to the top of the lower line is monitored as well, and if the desired value of \baselineskip
causes this bottom-to-top distance to be less than \lineskiplimit
, then the \lineskip
glue is substituted instead, which provides an absolute bottom-to-top interline separation.
The \utilde
command from undertilde.sty
creates the accent by creating a \widetilde
over an empty box the width of the nucleus, then stacking the nucleus and the accented empty box in a \vtop
command. To achieve the proper spacing, the package includes the line:
\baselineskip=1pt\relax
which tightens up the space between the accent and the nucleus. However, this setting would cause the lines to be set atop one another, so at this point, the \lineskip
setting takes over instead. In a single-line environment, we have \lineskiplimit=0pt
and \lineskip=1pt
, which gives the proper spacing. However, a multiple-line environment has, by default, \lineskiplimit=3pt
and \lineskip=4pt
. This means that the tilde is separated from the nucleus by 1/24th of an inch more in a multiple-line environment than it is in a single-line environment.
A fix to this would be to update the undertilde.sty
file to replace the aforementioned line with the following:
\baselineskip=\z@\relax
\lineskiplimit=\z@\relax
\lineskip=1pt\relax
which would set the proper distance for all math environments.
accents
package.