Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am trying to lay out a few linear equations, but with the different variables aligned in columns like this:

x + y       = 1  }   x = 0
    y + 2z  = 1  }   y = 1
x     +  z  = 0  }   z = 0

(with a single big left } )

I have tried everything, but cannot accomplish this elegantly (without tables). Any ideas what I might try?

Here is a picture of what I am trying to achieve:

enter image description here

share|improve this question
    
Welcome to TeX.SX! I'm not sure this is the best way to display such a thing. –  egreg Nov 12 '13 at 13:30
    
@egreg Let me tell you that my Precalculus textbook displays equation systems like this (albeit with much less spacing) –  Cole Johnson Nov 16 '13 at 0:55
add comment

3 Answers

up vote 20 down vote accepted

This is an intelligent solution with systeme package. Just type each term blindly, the package will arrange them automatically. For example, if you type 3z+y=10 in the first row, the term will be aligned as shown in the output image.

\documentclass[preview,border=12pt,varwidth]{standalone}
\usepackage{systeme,mathtools}
\begin{document}
\abovedisplayskip=0pt\relax% don't use this line in your production.
\[
\sysdelim.\}\systeme{
3z +y = 10,
x + y +  z = 6,
  3y - z = 13}
\quad
\!\begin{aligned}
x   &=  a\\
y   &=  b\\
z &=  c
\end{aligned}
\]
\end{document}

enter image description here

share|improve this answer
2  
Could you add a link to more info about systeme? It's not google-friendly. –  Kundor Nov 13 '13 at 0:47
    
@Kundor look ctan.org/pkg/systeme –  leo Nov 15 '13 at 15:36
add comment

Here is one suggestion using environments from amsmath:

Sample output

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\begin{equation*}
  \left.
    \begin{alignedat}{4}
      x & {}+{} & y &       &    & = 1 \\
        &       & y & {}+{} & 2z & = 1 \\
      x &       &   & {}+{} & z  & = 0
    \end{alignedat}
  \right\} \qquad
    \begin{aligned}
     x &= 0\\
     y &= 1\\
     z &= 0
    \end{aligned}
\end{equation*}

\end{document}

You might consider adding \ or \quad before \right\} to get more space before the brace.

share|improve this answer
    
you don't actually need the {} before an equal sign when it comes right after an & in any alignment (as in the first three lines) since it's always a binary relation. you do need them to indicate that a plus or minus isn't unary. –  barbara beeton Nov 12 '13 at 13:43
    
@barbarabeeton Perfectly correct - they were left over from testing something else - I have removed them from the code. –  Andrew Swann Nov 12 '13 at 13:51
    
Thanks, this is perfect! I am quite new to latex, would you mind explaining what the {} around the + is for? –  aguywithsocks Nov 12 '13 at 14:11
    
@aguywithsocks they ensure the spacing aroung the + is ok. In this case {} are seen as so called empty atoms. To see the difference compare $+b$ to $a+b$, the spacings around + are different –  daleif Nov 12 '13 at 14:36
add comment

Just in case the amsmath isn't available to you, you can also use a couple of array environments for this type of thing

screenshot

% arara: pdflatex

\documentclass{article}

\begin{document}

\[
  \left.
    \begin{array}{r@{}r@{}r@{}r@{}r@{}r@{}}
      x & {}+{} & y &       &    & {}= 1 \\
        &       & y & {}+{} & 2z & {}= 1 \\
      x &       &   & {}+{} & z  & {}= 0
    \end{array}
  \right\} \qquad
    \begin{array}{r@{}l}
     x &{}= 0\\
     y &{}= 1\\
     z &{}= 0
    \end{array}
\]

\end{document}
share|improve this answer
1  
It seems to me a bit weird if arara is available but amsmath is not available to you. –  Please don't touch Nov 12 '13 at 19:53
4  
@Marienplatz lol, yes indeed :) but that's one of the beauties of arara- it won't interfere if it isn't available –  cmhughes Nov 12 '13 at 20:15
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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