For example, the following is not very nice:

f(x)  \text{       if } f(x) \le N, \\
\newline N  \text{     if } f(x) \gt N.

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

Insert ampersands & as alignment symbols:

    f(x) &\text{ if } f(x) \le N, \\
    \newline N &\text{ if } f(x) > N.


enter image description here

  • 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

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.