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

I want to write this equation in Latex.

enter image description here

Sorry, I don't know what's the specific name of this kind of equation. I know title is so general.

share|improve this question
Have a look at the document mathmode -- cases – Marco Daniel Dec 31 '11 at 15:40
up vote 13 down vote accepted

This cannot be solved with the standard cases environment provided by amsmath, but you can use array:

\begin{array}{@{} l c c @{}}
p & \text{fuego}    & p_{R}>R_{T}, p_{G}>G_{T}, p_{B}>B_{T} \\
p & \text{no-fuego} & \text{resto}

For \text you need \usepackage{amsmath}.

share|improve this answer
Thanks for your answer. Works fine. Only another little question, in your sample code I try to put \label to reference this equation but doesn't work. Any solution ? – Jorge Vega Sánchez Dec 31 '11 at 15:58
An unnumbered equation doesn't admit a label. Use equation if you want to number and label it. – egreg Dec 31 '11 at 15:59
ok, thanks another time. Now works like i want. – Jorge Vega Sánchez Dec 31 '11 at 16:00

If you don't need the items centered you could use the cases environment.

If you do need them centered then using array as per egreg's solution is the simplest in this case, but you could also:

  1. Add some manual spacing with \hspace, or
  2. Use a \makebox with a specified width that looks good, or
  3. Use \widthof (requires the calc package) to obtain precise lengths for the \makebox macro:



Using \verb|\cases|:
p \quad\text{fuego}    &p_{R}>R_{T}, p_{G}>G_{T}, p_{B}>B_{T} \\
p \quad\text{no-fuego} &\text{resto}

\verb|\cases| with \verb|\hspace|:
p \quad\text{\hspace{0.5em}fuego}    &p_{R}>R_{T}, p_{G}>G_{T}, p_{B}>B_{T} \\
p \quad\text{no-fuego} &\hspace{5.0em}\text{resto}

\verb|\cases| with \verb|\makebox|:
p \quad\makebox[1.3cm][c]{fuego}    &\makebox[4.4cm][c]{$p_{R}>R_{T}, p_{G}>G_{T}, p_{B}>B_{T}$} \\
p \quad\makebox[1.3cm][c]{no-fuego} &\makebox[4.4cm][c]{resto}

\verb|\cases| with \verb|\makebox| with measured amounts:
\newcommand{\WidestColumnB}{$p_{R}>R_{T}, p_{G}>G_{T}, p_{B}>B_{T}$}

p \quad\CenterColumnA{fuego}    &\CenterColumnB{\WidestColumnB} \\
p \quad\CenterColumnA{no-fuego} &\CenterColumnB{resto}
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.