Quantcast
Channel: alignment of text between 2 lines in align* - TeX - LaTeX Stack Exchange
Viewing all articles
Browse latest Browse all 3

Answer by Frédéric for alignment of text between 2 lines in align*

$
0
0

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

aligned equations

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


Viewing all articles
Browse latest Browse all 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>