# Subscript alignment problem with \int\limits

When subscript in the expression \int\limits_{some stuff} is large, it seems that LaTeX underestimates the space occupied by the subscript which leads to the wrong placement of e.g. \left\lvert (vertical line touches the subscript, with no spacing in between). The issue is absent when \sum is used instead of \int, and the spacing on the left side looks good in this case. Similarly, using underbrace on \int\limits_{some stuff} creates a bracket shifted by around a millimeter to the right which again looks weird. As before, everything works well for \sum instead of \int\limits. Why is it so and how can the behavior of \int\limits be fixed?

MWE:

\documentclass{article}
\usepackage{amsmath}

\begin{document}
$\left\lvert\int\limits_{0000000}\right\rvert$
$\underbrace{\int\limits_{0000000}}$
$\left\lvert\sum_{0000000}\right\rvert$
$\left\lvert\sum\limits_{0000000}\right\rvert$ %\limits doesn't impact \sum behavior as expected
$\underbrace{\sum_{0000000}}$
\end{document}


The difference between both symbols comes from the italic correction. According to rule 13a in appendix G of The TeXbook, the lower limits are shifted left by half the italic correction (and the upper limits shifted right). And the integral sign has an italic correction of 8u# whereas the summation sign has none.

You can circumvent this by replacing the symbol \int with an Op nucleus \mathop{\int}, because rule 13 says that for non-symbols, an italic correction is disregarded.

$$\left\vert\int\limits_{0000000}\right\vert$$
$$\left\vert\mathop{\int}\limits_{0000000}\right\vert$$


Alternatively, you can compute the width of the italic correction and use it for countermeasures, such as inserting a kern after the left bar and a negative kern before the right bar. You need to know that the big integral sign is character 0x5A in the (plain TeX) font \tenex.

\newdimen\intcorr
{\setbox0=\hbox{\tenex\char"5A\/\global\dimen\intcorr=\lastkern}}
$$\left\vert\kern.5\dimen\intcorr\int\limits_{0000000}\kern-.5\dimen\intcorr\right\vert$$


• And what if I prefer shifted subscripts, but want to align \lvert and \rvert accordingly? If no nice and automatic solution is possible, I could perhaps manually introduce some \hspace', but I've never seen the unit u#` and LaTeX seems not to recognize it. How can I convert it to pt or em? Jan 22 at 22:04
• See my edited answer. Jan 23 at 8:14