2

I would like to align the equation like this but instead have the label (40.a) and (40.b) for the last two lines. I don't know how to do this with subequations because of the \times\left{ that should be aligned with the =.

enter image description here

The code (moved from comment):

\documentclass{article}

\begin{document}
\begin{eqnarray} 
\begin{array}{cl} a & =b(x)\[10pt] & \times\left\{ \begin{matrix}   c&\text{if }x<1, \[10pt] d&\text{if }x>1.   
\end{matrix} \right. 
\end{array} 
\end{eqnarray}.
\end{document}
Zarko
  • 296,517
  • Welcome to TeX.SE! Please provide code by which you generate showed equation. For what you looking for: use \begin{subequations} ...<equations>...\end{subequations}. – Zarko Jun 12 '16 at 14:57
  • I use \begin{eqnarray} \begin{array}{cl} a&=b(x)\[10pt] &\times\left{ \begin{matrix} c&\text{if }x<1, \[10pt] d&\text{if }x>1.
    \end{matrix} \right. \end{array} \end{eqnarray}.
    I don't know how to do this using subequations.
    – user107878 Jun 12 '16 at 14:58
  • 1
    Please, edit your question and add your comment inside it! And add missing preamble etc, that code can be compiled. This time I will do this for you ... – Zarko Jun 12 '16 at 15:02

1 Answers1

1

I suggest you look into using the numcases environment of the cases package (which you should load with the option subnum).

Incidentally, don't use the eqnarray environment -- it's badly deprecated.

enter image description here

\documentclass{article}
\usepackage[subnum]{cases}
\begin{document}
\setcounter{equation}{39} % just for this example

\begin{numcases}{a = b(x) \times}
  c & for $x<1$\\
  d & for $x>1$
\end{numcases}

\end{document}
Mico
  • 506,678
  • I looked at numcases but it's not exactly what I want, the expression b(x) is pretty lentgthy that's why II want the cases in another line. – user107878 Jun 12 '16 at 16:00
  • @user107878 - It would have been really useful if you'd mentioned up front that "b(x)" is "pretty lengthy". – Mico Jun 12 '16 at 20:02