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 have little trouble with my TeX course. I've already completed all the assignments except one. Yesterday I was up until 4AM and still didn't get it right.

Maybe someone could give me some guidelines or even the code? I would really appreciate it!

Here is what I have so far and what would be ideal:

I used tables to create this, but I'm getting the feeling that it's a wrong approach.


PS.

What would be correct to use for doing these (I don't know what they're called in English).

I've used \left, \right and \start{array} so far, but it somehow doesn't feel right.

share|improve this question

4 Answers 4

up vote 3 down vote accepted

I wanted to try my hand at this with Plain-format, because the example seemed (to me) to lack consistency. That is, only the very last entry above the \hrule got an alignment. So here's what it'd look like if the rest of them are aligned:

\def\myeqalign#1{\openup-1\jot\eqalign{#1}}% negate the cumulative \openup1\jot
\let\To\Rightarrow
$$\myeqalign{% creates a 2-col align (1st col flush-right, 2nd flush-left),
             % which starts off with \openup1\jot
  \omit% omit the align preamble for this col, 'cause we don't want flush-right
    $\left\{\myeqalign{y&=2x-5\cr4x-2y-10&=0\cr}\right.\To$\hfill\cr
  \noalign{\smallskip}% insert a small vertical skip between the rows
  \To\left\{\myeqalign{2x-y-5=0\cr4x-2y-10=0}\right.
    \left|\matrix{\cdot(-2)\cr\cdot1}\right|
    +\myeqalign{-4x+2y+10&=0\cr4x-2y-10&=0\cr}\cr\noalign{\hrule}
  0=0\,}$$

enter image description here

Whereas, if I am trying to mimic the "This is what I need"-part:

$$\myeqalign{\omit$\cases{y=2x-5\cr4x-2y-10=0}\;\To$\hfil\cr\noalign{\medskip}
  \To\cases{2x-y-5=0\cr4x-2y-10=0}\enspace\left|\matrix{\cdot(-2)\cr\cdot1}\right|\enspace
    +\myeqalign{-4x+2y+10&=0\cr4x-2y-10&=0}\cr\noalign{\hrule}
  0=0}$$
\bye

enter image description here

There are additional differences with both horizontal and vertical spacing.

To wrap it up, Plain's \matrix centers its column contents, with columns \quad apart from eachother. \eqalign has two columns; first flush-right, second flush-left. \cases has two columns; first flush-left in math-mode, and the second in text-mode, \quad apart.

Regardless of which one you'll use (and I'm pretty sure this includes LaTeX's equivalents), you'll always end up using \halign (horizontal alignment) "under the hood", which can be thought of as a table.

share|improve this answer
  • You could use a cases environment

  • You can use aligned, such as

    \left\{\begin{aligned} ... \end{aligned}\right.
    
  • An array environment for the whole structure would be ok. In contrast to tabular, array works in math mode.

share|improve this answer

I used an array with three centered columns and vertical lines separating columns one and two, and two and three and other nested array environments; \multicolumn was used to suppress the vertical lines in the first and in the third rows, and to get the alignment for the last row:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\[
\begin{array}{@{}c|c|c}
  \multicolumn{1}{@{}c}{%
    \left\lbrace\begin{array}{l}
      y = 2x - 5 \\
      4x - 2y - 10 = 0
    \end{array}\right.\Rightarrow} 
  &  \multicolumn{1}{c}{} & \\
  \Rightarrow\left\lbrace\begin{array}{l}
    2x - y + 5 = 0 \\
    4x - 2y - 10 = 0
  \end{array}\right.
  & \begin{array}{c}
    \cdot (-2) \\ \cdot (1) 
  \end{array}
  & +\begin{array}{r}
    -4x +2y -10 = 0 \\
    4x -2y -10 = 0
  \end{array} \\ \hline
  \multicolumn{3}{r}{0 = 0}
\end{array}
\]

\end{document}

EDIT: corrected the last pair of equations. EDIT2: suppressed a superfluous column.

share|improve this answer
    
Why is the outer array made of four columns? And why the empty \multicolumn's? Less is more. :) –  egreg May 26 '11 at 22:52
    
@egreg: I was just about to eliminate the superfluous column. The empty \multicolumn is to prevent the vertical line in the first row between columns two and three. –  Gonzalo Medina May 26 '11 at 22:57
    
Thank you thank you! This is just what I needed. –  Priit Pihus May 27 '11 at 12:20

The whole thing is a one column array with left alignment; there are two rows and a \hline to separate the result which is

\multicolumn{1}{r@{}}{0=0}

For the system you can do

\left\lbrace\begin{array}{l}
first equation\\
second equation
\end{array}\right.

The second row of the main array is made of an arrow, a system, another array with different delimiters, the + symbol, and a final array with no delimiters.

\[
\begin{array}{l}
\left\lbrace\begin{array}{l}
  y = 2x - 5 \\
  4x - 2y - 10 = 0
\end{array}\right.\Rightarrow
\\[\bigskipamount]
\Rightarrow
\left\lbrace\begin{array}{l}
  2x - y + 5 = 0 \\
  4x - 2y - 10 = 0
\end{array}\right.
\ \left|\begin{array}{c}
  \cdot (-2) \\ \cdot (1)
\end{array}\right|
+
\begin{array}{r}
  -4x +2y -10 = 0 \\
  4x -2y -10 = 0
\end{array} \\
\hline
\multicolumn{1}{r}{0 = 0}
\end{array}
\]
share|improve this answer

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.