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.

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?

share|improve this question
    
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

1 Answer 1

up vote 2 down vote accepted

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}$

Output:

enter image description here

share|improve this answer
2  
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

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.