TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Want to display two piecewise functions on the same line. Currently using 'cases' to define two piecewise functions on two separate lines. It looks ugly. They can fit on the same line, but how?

share|improve this question
Could you please create an image of the undesired and desired output you're after? It's not that clear from the question. Do so by including an image of both, if you cannot produce it in (La)TeX yourself. You can even create it in another editor (like MS Word), if need be. – Werner Feb 9 '13 at 5:29
up vote 11 down vote accepted

You can cascade two cases on the same line as follows:

enter image description here



f(x) = \begin{cases}
             0  & \text{if } x < 0 \\
             1  & \text{if } x \ge 0
       \end{cases} \quad
g(x) = \begin{cases}
             f(x)+1  & \text{if } x < 0 \\
             f(x)-1  & \text{if } x \ge 0
share|improve this answer

Your Answer


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.