18

I'd like to have the limits of two integrals vertically aligned.

In this example, the x and b should be positioned on the same line.

\[\int\limits_x^{\infty}\int\limits_b^{\infty} x^2+y^2 \mathrm{d}x \mathrm{d}y \]

enter image description here

Has anybody an idea how to achieve this?

19

One way is to use \vphantom{b} with x:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[\int\limits_{\vphantom{b}x}^{\infty}\int\limits_b^{\infty} x^2+y^2 \mathrm{d}x \mathrm{d}y \]
\end{document}

enter image description here

With some beautifications as per the comments of Mico:

\documentclass{article}
\usepackage{amsmath}
\newcommand*\diff{\mathop{}\!\mathrm{d}}
\begin{document}
\[\int\limits_{\vphantom{b}x}^{\infty}\!\!\int\limits_b^{\infty} x^2+y^2 \,\diff x \, \diff y \]
\end{document}

enter image description here

  • Aah, you beat me by a few seconds to this answer... :-) Real quick: I would also recommend placing parentheses around the integrand, tightening the space between the two integral symbols by inserting \! (negative thinspace), and adding \, (positive thinspace) between the integrand and the variables of integration. – Mico Nov 18 '13 at 9:41
  • @Mico And also between the variables of integration: \,dx\,dy is what you find in the TeXbook all the times. – Bakuriu Nov 18 '13 at 12:53
  • @Mico I was improving the speed my two finger typing lately and it is the first time I was faster :-) Thanks for the comments and I edited the answer. – user11232 Nov 18 '13 at 22:26
14

Another possible method is to use an invisible strut like \mathstrut.

\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage[intlimits]{amsmath}
\usepackage{physics}

\begin{document}
  \[
    \int_{x\mathstrut}^{\infty}\int_{b\mathstrut}^{\infty} x^2+y^2\,\dd x\,\dd y
  \]
\end{document}

For other formatting options the »physics« package is quite helpful.


enter image description here

3

Place a \strut in each limit, so your example becomes

\[\int\limits_{x\strut}^{\infty}\int\limits_{b\strut}^{\infty} x^2+y^2 \mathrm{d}x \mathrm{d}y \]

A \strut is an invisible box of zero width but the same height and depth as (I think) an parenthesis.

  • 3
    Note that strut doesn't get smaller in subscripts so this does align them but leaves more space than the other two answers – David Carlisle Nov 18 '13 at 9:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.