5

I have some giant matrices or systems of equations that are getting in my way of my text. Basically is hard enough to write them all in the same line, but when I want to write something beside it, it's a hopeless task for instance

$\left\{\begin{matrix}
f_x(x,y,z) = 0 \\ 
f_y(x,y,z) = 0 \\ 
f_z(x,y,z) = 0\\
\end{matrix}\right. \iff 
\left\{\begin{matrix}
 y = 0 \\ 
 x = 0 \\ 
 z = 0\\
 \end{matrix}\right. \iff
 \left\{\begin{matrix}
  y = 0 \\ 
  x = 0 \\ 
 z = \frac{1}{2}\\
\end{matrix}\right.$ I can't write anything here "beside" it because it's just going to get cut off and goes under the system of equations
David Carlisle
  • 757,742
Lemon
  • 3,153

1 Answers1

9

You can use \text from the amsmath package; if required, a \parbox can be used to accommodate long texts. As egreg mentioned in a comment, instead of using matrix and \left, \right. you can use the cases environment from amsmath; here's an example showing both possibilities:

\documentclass{article} 
\usepackage{amsmath}

\begin{document}

\[
\left\{\begin{matrix}
f_x(x,y,z) = 0 \\ 
f_y(x,y,z) = 0 \\ 
f_z(x,y,z) = 0
\end{matrix}\right. \iff 
\left\{\begin{matrix}
 y = 0 \\ 
 x = 0 \\ 
 z = 0
 \end{matrix}\right. \iff
 \left\{\begin{matrix}
  y = 0 \\ 
  x = 0 \\ 
 z = \frac{1}{2}
\end{matrix}\right.\qquad
\text{\parbox{4cm}{I can write anything here "beside" using a box if necessary}}
\]

\[
\begin{cases}
f_x(x,y,z) = 0 \\ 
f_y(x,y,z) = 0 \\ 
f_z(x,y,z) = 0
\end{cases} \iff 
\begin{cases}
 y = 0 \\ 
 x = 0 \\ 
 z = 0
 \end{cases} \iff
 \begin{cases}
  y = 0 \\ 
  x = 0 \\ 
 z = \frac{1}{2}
\end{cases}\quad
\text{\parbox{3.5cm}{I can write anything here "beside" using a box if necessary}}
\]

\end{document}

enter image description here

Gonzalo Medina
  • 505,128
  • 2
    I'd use the cases environment, but it's a matter of preferences. – egreg Jun 02 '12 at 20:19
  • @egreg I'll add to my answer an example using cases. – Gonzalo Medina Jun 02 '12 at 20:27
  • Yeah that's what I need. What does the \qquad thing do? The parbox just makes a boxed paragraph I know that. – Lemon Jun 02 '12 at 20:32
  • Why do things look "bigger" in the cases environment? – Lemon Jun 02 '12 at 20:42
  • 1
    @jak the cases environment internally uses \arraystretch{1.2} so there's an extra 20% space between rows. – Gonzalo Medina Jun 02 '12 at 20:44
  • @jak I forgot your other question: \qquad is a double em-quad space (approx. 2em in the current font); it's the double of \quad (approx. 1em in the current font). – Gonzalo Medina Jun 02 '12 at 20:47
  • Do you mind showing me how to do it for \begin{align}...\end{align} as well? I tried applying the same method to that and it didn't work. – Lemon Jun 02 '12 at 21:02
  • @jak you could use something like \begin{align} a &= b \&= c \qquad \text{some text here}\&= d \end{align} and \parbox if required. – Gonzalo Medina Jun 02 '12 at 21:10
  • Yeah that works too, I tried using \hspace{} \text{...} but it kind moves my equation. I tried combining your stuff with \hspace{} and it still moves my equations lol – Lemon Jun 02 '12 at 21:15