# Force line break inside a \lim argument in align environment

Inside an align environment I have a \lim with two variables which should be displayed in two lines:

\begin{align}
...
f & = \lim _ {a \rightarrow -\infty \linebreak b \rightarrow \infty} ... \\
...
\end{align}


Currently there is no line break where I want to have one; it's displayed in one line. How can I force a line break there? \linebreak is ignored and \\ breaks the align environment.

-
levu: You may consider reading this for other alternatives to stacking limits, below: tex.stackexchange.com/questions/17066/… – night owl Oct 8 '11 at 3:13

Use substack to specify the two variables.

As egreg pointed out you can also use subarry and the last two solutions provided use this. The last one also account for the fact that the a and b don't take up the same amount of space, and create a box the width of an x and centers the a and b within that amount of space.

Also, in this case it is better to use \to instead of \rightarrow as that better represents the mathematical sense here.

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\newcommand*{\AlignChar}[1]{\makebox[1ex][c]{\ensuremath{\scriptstyle#1}}}%
\begin{align}
\lim _{\substack{a \to -\infty \\ b \to \infty}} =
\lim _{\begin{subarray}{l} a \to -\infty \\ b \to \infty \end{subarray}} =
\lim _{\begin{subarray}{l} \AlignChar{a}  \to -\infty \\ \AlignChar{b} \to \infty \end{subarray}}
\end{align}
\end{document}


As per egreg's comments, you could also write:

\newcommand*{\AlignChar}[1]{\makebox[1ex][c]{$\scriptstyle#1$}}%


which would make that macro easier to read, but my personal preference is to use \ensuremath as that to me explicitly captures the fact that it can be used in mode. In this case, the reason that $...$ is ok is that \makebox enters text mode so you can use $..$ or \ensuremath inside it.

-
Or, maybe better, \lim _{\begin{subarray}{l} a \to -\infty \\ \hphantom{a}\to \infty \end{subarray}} – egreg Oct 7 '11 at 21:27
@Peter: Are you missing a "b" before the second "\rightarrow"? (see also Werner's answer...) – Mico Oct 7 '11 at 23:10
@Mico: Thanks. Have corrected it, and also took that opportunity to enhance the solution. – Peter Grill Oct 7 '11 at 23:41
Why \ensuremath? Wouldn't $\scriptstyle#1$ be easier to read? – egreg Oct 8 '11 at 10:07
@egreg: Thanks for pointing that out. Have added it to the solution. – Peter Grill Oct 8 '11 at 15:01

Here is a, perhaps less attractive, alternative to stacking limits to operators by using \mathop:

\documentclass{article}
\usepackage{amsmath}% http://ctan.org/pkg/amsmath
\begin{document}
\begin{align}
f & = \mathop{\lim_{a\rightarrow-\infty}}_{b\rightarrow\infty}
\end{align}
\end{document}​

-
thank you, maybe i need this at other points, here i'll use the stacking ;) – levu Oct 7 '11 at 18:59
@Werner: Are you missing a "b" before the second "\rightarrow"? (Same issue as in Peter's answer...) – Mico Oct 7 '11 at 23:11
@Mico: Is it that obvious that I copied the MWE from Peter? :) – Werner Oct 7 '11 at 23:13
@Werner - A separate matter: I really admire your habit, in your answers, of providing each package's source URL as a comment. Great help for beginning LaTeXers, for sure! – Mico Oct 7 '11 at 23:19
A hah, now we know where you get your solutions. :-) :-) – Peter Grill Oct 7 '11 at 23:19