# Combinations in TeX

Show 40 post(s) from this thread on one page
Page 2 of 2 First 12
• May 14th 2006, 04:55 AM
CaptainBlack
Quote:

Originally Posted by ThePerfectHacker
Here is something I discovered.

If you want to define a piecewise function say the absolute value function what you do is:
Code:

|x|=       \left\{                 \begin{array}{c}                   x \mbox{ if } x\geq 0\\                                                     -x \mbox{ if } x<0                      \end{array}       \right
If that is your whole code, then you can igonore the last part.
Code:

|x|= \left\{     \begin{array}{c}         x \mbox{ if } x\geq 0\\             -x \mbox{ if } x<0
The reason is because there is nothing following this. You cannot do this if there would be something following the code, but other here this trick works and saves me time.
----
$\left\{ \begin{array}{c} x\mbox{ if } x\geq 0\\ -x\mbox{ if } x<0$

I think I would like the "if"s verticaly alligned as in:

$
|x|=
\left\{
\begin{array}{cc}
x &\mbox{ if } x\geq 0\\
-x &\mbox{ if } x<0
$

which requires only a minor mod:

Code:

|x|=     \left\{         \begin{array}{cc}             x &\mbox{ if } x\geq 0\\             -x &\mbox{ if } x<0
RonL
Show 40 post(s) from this thread on one page
Page 2 of 2 First 12