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.

I would like to label some cases with specific tags, and was hoping for something like

\begin{numcases}{A = }
\frac{r}{a} & r > a \tag{G} \\
\frac{a}{r} & r < a \tag{H}
\end{numcases}

utilizing the numcasesenvironment from the cases package, and \tag from amsmath. However, the two don't seem to be compatible:

! Package amsmath Error: \tag not allowed here.

Is there any alternatives that would do what I hope to accomplish?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

You can use the empheq package:

\usepackage{empheq}

\begin{empheq}[left={A=\empheqlbrace}]{alignat=2}
& \frac{r}{a} &&\qquad  r > a \tag{G} \\
& \frac{a}{r} &&\qquad  r < a \tag{H}
\end{empheq}

The syntax is a bit awkward, but the result seems good. You can define an environment for you personal use:

\newenvironment{tagcases}[1][]
  {\empheq[left={#1\empheqlbrace}]{alignat=2}}
  {\endempheq}

and the system before would become

\begin{tagcases}[A=]
& \frac{r}{a} &&\qquad  r > a \tag{G} \\
& \frac{a}{r} &&\qquad  r < a \tag{H}
\end{tagcases}
share|improve this answer
    
Fantastic! Thanks! –  Tomas Lycken Nov 17 '11 at 21:26

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.