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'm using the array environment to give multiple definitions of some value, let's call it x. I can easily get a reference to all 3 definitions together, but I want each one to have its own reference. For now it looks like this :

    / a + b
x = | c + d    (1)
    \ e + f

And I want it to look like this :

    / a + b    (1.a)
x = | c + d    (1.b)
    \ e + f    (1.c)

I've tried combining all sorts of other packages with array and they just won't play nice. Any ideas? Here's the code I use to get the first result :

\begin{equation}
x = \left\{ \begin{array}{rl}
  & a + b \\
  & c + d \\
  & e + f
\end{array} \right.
\label{eq:PSF_mag}
\end{equation}
share|improve this question

2 Answers 2

up vote 8 down vote accepted

The empheq package was made for this:

\documentclass[a4paper]{memoir}
\usepackage{empheq} % autoload amsmath
\begin{document}

\begin{subequations}
\label{eq:tot}
\begin{empheq}[left={x=}\empheqlbrace]{align}
  & a + b \\
  & c + d \label{eq:b}\\
  & e + f
\end{empheq}
\end{subequations}

Total group: \eqref{eq:tot}, just one: \eqref{eq:b}

\end{document}
share|improve this answer
    
Thanks a lot. I'd never used empheq like that before. –  ticster Sep 26 '12 at 14:04

The subnumcases environment from cases helps for this layout:

enter image description here

\documentclass{article}
\usepackage{cases}% http://ctan.org/pkg/cases

\begin{document}

\begin{subnumcases}{x=}
  a + b \\
  c + d \\
  e + f
\end{subnumcases}

\end{document}

Subequation numbering can be modified using (say)

\renewcommand{\thesubequation}{\themainequation.\alph{equation}}
share|improve this answer
    
Thanks a lot. I knew subequations worked with align but not with arrays. I didn't realize something like numcases existed out there. –  ticster Sep 26 '12 at 14:05

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.