4

I am looking to produce an equation with the three objectives outlined in the image below. I'm unable to use \tag inside 'cases' and have been unsuccessful with other attempts. As described in the image, the three goals are:

  1. to center the equation and align the equations from each row with each other,
  2. put the texts in each row ("for case 1" and "for case 2") centered relative to the centered equation and the label for each row, and
  3. have individual equation labels for each row (4a, 4b) whereby the number is obtained automatically from the natural order of other equations in the text (i.e., the number is not hardcoded). But if needed, hardcoded is OK.

Thank you in advance.

enter image description here

MWE:

\documentclass[12pt,a4paper]{article}
\usepackage{cases}
\usepackage{subeqnarray}
\usepackage{longtable,tabularx}
\usepackage{amsmath,mathrsfs}
\usepackage{mathtools}


\begin{document}

Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla bla bla bla bla: \begin{equation} A =  \begin{cases}  \begin{aligned}
      0.55 B~, \quad\quad \text{\rm for~case 1}~,& \\
      0.75B~, \quad\quad \text{\rm for~case 2}~.& \end{aligned} \end{cases} \end{equation}

where Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla bla bla bla bla bla.

\end{document}

1 Answer 1

4

With empheq:

\documentclass{article}
\usepackage{amsmath,empheq}

\begin{document}

\begin{subequations}
Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla 
bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla bla bla bla bla:
\begin{empheq}[left={A=\empheqlbrace}]{alignat=2}
  &0.55 B, &\qquad\qquad&\rlap{for~case 1,} \\
  &0.75 B, &&\rlap{for~case 2,}
\end{empheq}
where Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla 
Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla bla bla 
bla bla bla.
\end{subequations}

\end{document}
  1. \rm has been deprecated for about 30 years.
  2. ~, has excessive space; maybe \,, (not that I'd use it).

far labels

On the other hand, I don't see why moving the labels too far.

\documentclass{article}
\usepackage{amsmath,empheq}

\begin{document}

\begin{subequations}
Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla
bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla bla bla bla bla:
\begin{empheq}[left={A=\empheqlbrace}]{alignat=2}
  &0.55 B, &\quad&\text{for~case 1,} \\
  &0.75 B, &&\text{for~case 2,}
\end{empheq}
where Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla
Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla bla bla
bla bla bla.
\end{subequations}

\end{document}

nearer labels

Third possibility, but I see no improvement; actually, I think it's worse typesetting.

\documentclass{article}
\usepackage{amsmath,empheq}

\begin{document}

\begin{subequations}
Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla 
bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla bla bla bla bla:
\begin{empheq}[left={A=\empheqlbrace}]{alignat=2}
  &0.55 B, &&\rlap{\quad for~case 1,} \\
  &0.75 B, &&\rlap{\quad for~case 2,}
\end{empheq}
where Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla 
Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla bla bla 
bla bla bla.
\end{subequations}

\end{document}

center

3
  • Thanks for your quick response. I tried this and the equation is not centered since the &\quad&\text{for~case 1,} part of the code shifts the centering of the equation to the left of it. As mentioned in the initial request, can the A = ... etc be centered and independent of the text portion? thank you!
    – jrjrjr
    Commented Aug 14 at 20:46
  • 1
    @jrjrjr I added a third possibility, but I discourage you to use it: it's really unbalanced.
    – egreg
    Commented Aug 14 at 20:50
  • thank you! this works.
    – jrjrjr
    Commented Aug 14 at 21:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .