views:

230

answers:

2

Integrals with limits take up width horizontally that includes their limits. In other words, if you have an integral with large limits below (or above) the integral

\int\limits_{-\infty < x < c} (c - x) \ dP(x)

you are left with a large amount of space to the left and right of the integral before the integrand (c - x) starts. This is sometimes desirable, but in my case it isn't, since I have a whole bunch of integrals like this all in the same expression. Is there a way to make whatever is inside the integral snuggle up next to the integral sign, ignoring the width of the limit?

+4  A: 

Something like this will do the trick.

\usepackage{amsmath}
\def\mathclap#1{\text{\hbox to 0pt{\hss$\mathsurround=0pt#1$\hss}}}
\begin{document}
\[
\int\limits_{\mathclap{-\infty < x < c}} (c - x) \ dP(x)
\]
\end{document}

More about such tricks is given in this article.

Rob Hyndman
Thanks! That works, and this link is fantastic.
Dan
A: 

The mathtools package contains a definition for \mathclap, and also a command \smashoperator that is a bit more convenient:

\smashoperator{\int_{\infty < x < c}} (c - x) \, dP(x)
Philipp