3

Is it possible to align two formulas in two lines inside a case block, that are not of the same lenght? For example, I have these two formulas and I would like to align vertically the left hand part before = and align the two fractions on the right hand part in order to occupy the same space.

\begin{cases}
E_{\theta}=\dfrac{num}{denom}\dfrac{very long num}{shorter denom}  \\ 
E_{\phi}=\dfrac{longer num}{denom}\dfrac{1}{long denom}
\end{cases}
  • 1
    What do you mean by “occupy the same space”? – egreg Jun 7 '18 at 9:47
  • Are you asking how to align the invidual \dfrac expressions? Please advise. – Mico Jun 7 '18 at 9:51
  • Exactly, the two formulas are composed by two \dfracand I'd like that the two are vertically aligned the one to the other – Shika93 Jun 7 '18 at 9:55
3

Here are two possible solutions. Both make use of array environments. The upper solution centers both pairs of fractional terms vertically. The lower solution right-aligns the first pair of terms and left-aligns the second pair. Note that \times directives have been inserted to make sure that the readers understands how the fractional terms in a given row are supposed to be associated with each other.

enter image description here

\documentclass{article}
\usepackage{array,amsmath}
\newcolumntype{C}{>{\displaystyle}c}
\newcolumntype{L}{>{\displaystyle}l}
\newcolumntype{R}{>{\displaystyle}r}
\newcolumntype{z}{>{{}}c<{{}}} % for mathbin & mathrel operators
\begin{document}

\setlength\arraycolsep{0pt}

\[
\left\{
\begin{array}{RzCzC}
E_{\theta}&=&\frac{\text{num}}{\text{denom}}&\times&
           \frac{\text{very very long num}}{\text{shorter denom}}  \\[2ex]
E_{\phi}  &=&\frac{\text{longer num}}{\text{denom}}&\times&
         \frac{1}{\text{long denom}}
\end{array}
\right.
\]

\[
\left\{
\begin{array}{RzRzL}
E_{\theta}&=&\frac{\text{num}}{\text{denom}}&\times&
           \frac{\text{very very long num}}{\text{shorter denom}}  \\[2ex]
E_{\phi}  &=&\frac{\text{longer num}}{\text{denom}}&\times&
         \frac{1}{\text{long denom}}
\end{array}
\right.
\]
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.