# alignment of text between 2 lines in align*

I have this:

\begin{align*}
&f(1) = -11 & &\mbox{while q satisfies} &q(1) = 11,\\
&f(-2) = 20 & &\mbox{} &q(-1) = 20
\end{align*}


which puts the text "while" on the same line as the first line (obviously). Is there a way to have it in the (vertical) middle of the two lines? I.e. in between the two lines.

-

Here are a few possibilities. I included your original code. Note that the align environment isn't really required for this structure.

My first version simply adds a line to your original code and inserts the text in that line. It is not an appealing solution. The version I prefer is the second to last, which uses cases. If you don't like the braces, you may use the last version that uses aligned. You can replace aligned by gathered or an array (as Daniel's solution).

\begin{align*}
&f(1) = -11 & &\mbox{while q satisfies} &q(1) = 11,\\
&f(-2) = 20 & &\mbox{} &q(-1) = 20
\end{align*}

\begin{align*}
&f(1) = -11 & &&q(1) = 11,\\
&&&\mbox{while q satisfies} \\
&f(-2) = 20 & &\mbox{} &q(-1) = 20
\end{align*}

\begin{align*}
\begin{cases}f(1) = -11\\f(-2)=20\end{cases}&&\text{while $q$ satisfies}&&\begin{cases}q(1) = 11\\q(-1)=20\end{cases}
\end{align*}

\begin{equation*}
\begin{cases}f(1) = -11\\f(-2)=20\end{cases}\qquad\text{while $q$ satisfies}\qquad\begin{cases}q(1) = 11\\q(-1)=20\end{cases}
\end{equation*}

\begin{equation*}
\begin{aligned}f(1) &= -11\\f(-2)&=20\end{aligned}\qquad\text{while $q$ satisfies}\qquad\begin{aligned}q(1) &= 11\\q(-1)&=20\end{aligned}
\end{equation*}


The result is

Edit : (A comment about mbox) To include text within an equation, you are better off to use the \text command rather than the \mbox.

-
Thanks very much! –  P.A Apr 25 '11 at 20:27

I would say as a good solution the use of the array environment within the align environment:

\begin{align}
\begin{array}{l}
f(1) = -11\\
f(-2)
\end{array}
\qquad \text{while $q$ satisfies}