Thursday, November 17, 2011

Piecewise Functions

Suppose that you are writing a piece-wise function in LaTeX. How do you go about doing it? The trick is to make use of the \begin{cases} ... \end{cases} environment within Math mode. This particular environment acts like a n-row by 2-column array generating a big `{' on the left side for the grouping of the piece-wise function parts. Since this environment acts like an array, don't forget to separate each column with `&' and end each line with `\\'.

2 comments:

roticv said...

dcases looks prettier.

The_Laptop said...

I dunno man... I didn't manage to get dcases to work. The cases environment suffices for my purposes.