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.

How do I typeset something like, X = 0 if a=1 & b=1 & c= 5 & d=9 ; 0 otherwise, using those huge left braces and specifying each condition in a line (4 conditions in 4 separate lines)?

share|improve this question
    
Can you show an approximate picture of the output you wish? –  egreg Oct 21 '13 at 7:37
    

2 Answers 2

It's not clear to me if the conditions for X=1 are separate (logical "or") or cumulative (logical "and"). Assuming it's the former, the following two expressions may meet your needs.

enter image description here

\documentclass{article}
\usepackage{amsmath} % for cases environment and \text command
\begin{document}
\[
X = 
\begin{cases}
1 & \text{if $a=0$ or $b=1$ or $c=5$ or $d=9$} \\
0 & \text{otherwise}
\end{cases}
\]

\[
X =
\begin{cases}
1 & \text{if $a=0$} \\
1 & \text{if $b=1$} \\
1 & \text{if $c=5$} \\
1 & \text{if $d=9$} \\
0 & \text{otherwise}
\end{cases}
\]
\end{document} 

Personally, I strongly prefer the first of these two forms -- at least for the setup you've provided. Should the conditions be more elaborate, the second form may well be the better option.

share|improve this answer

As far as I understand, your want the following construction:

\documentclass{article}
\begin{document}

\[
\left\{
\begin{array}{rl}
X=1 & \mbox{if $a=1$},\\
X=10 & \mbox{if $a=2$},\\
X=100 & \mbox{if $a=3$},\\
X=1000 &\mbox{otherwise}
\end{array}
\right.
\]

or

\[
\left\{
\begin{array}{ll}
X=1 & \mbox{if $a=1$},\\
X=10 & \mbox{if $a=2$},\\
X=100 & \mbox{if $a=3$},\\
X=1000 &\mbox{otherwise}
\end{array}
\right.
\]

\end{document}

enter image description here

share|improve this answer
1  
I think OP is looking for a cases solution –  percusse Oct 21 '13 at 0:01

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.