# what are the ways to align conditions in cases

For example, the following is not very nice:

[f(x)]_N=\begin{cases}
f(x)  \text{       if } f(x) \le N, \\
\newline N  \text{     if } f(x) \gt N.
\end{cases}


How can I make it nicer?

-
Welcome to tex.sx! A tip: If you indent lines by 4 spaces, then they are marked as a code sample. You can also highlight the code and click the "code" button (with "101010" on it). –  Caramdir Apr 15 '11 at 22:46
Thanks, Caramdir. –  Qiang Li Apr 15 '11 at 23:08

Insert ampersands & as alignment symbols:
$[f(x)]_N=\begin{cases} f(x) &\text{ if } f(x) \le N, \\ \newline N &\text{ if } f(x) > N. \end{cases}$

I would delete the \newline in the answer; if more vertical space is needed, there's \\[3ex] (or any other dimension). –  egreg Apr 16 '11 at 9:42
@egreg: good tip! I just modified the code in the question for the desired horizontal alignment. \newline shouldn't be there. –  Stefan Kottwitz Apr 16 '11 at 9:58