2

I need help aligning the inequalities inside an eqnarray. The problem is that the first term before the inequality remains in the right. I tried manipulating the spaces but it just does not look right. Thank you

The eqn is the following:

\begin{eqnarray}
\finv(F^{\mathrm{CE}},F^\mathrm{a})=
     \begin{cases}
     \dfrac{F^{\mathrm{CE}}}{\varepsilon}\left({\dfrac{\varepsilon-F^{\mathrm{a}}}{F^{\mathrm{a}}+\varepsilon/A_{\mathrm{f}}+\xi}+{\dfrac{F^\mathrm{a}}{F^\mathrm{a}+\xi}}}\right) - \dfrac{F^\mathrm{a}}{F^\mathrm{a}+\xi},   F^{\mathrm{CE}}  &<0 \\
     \nonumber \\
     \dfrac{F^{\mathrm{CE}}-F^\mathrm{a}}{F^{\mathrm{a}}+F^{\mathrm{CE}}/A_{\mathrm{f}}+\xi},  0  &\leq F^{\mathrm{CE}} <F^\mathrm{\mathrm{a}} \\
     \nonumber \\
     \dfrac{F^{\mathrm{CE}}-F^\mathrm{a}}{\dfrac{{(2+2/A_{\mathrm{f}})}{(F^\mathrm{a}\flen - F^{\mathrm{CE}})}}{\flen - 1}+\xi},  F^\mathrm{a} & \leq  F^{\mathrm{CE}} < 0.95F^\mathrm{a}\flen  \\
     \nonumber \\
    f_{v_0} + \dfrac{F^{\mathrm{CE}} - 0.95F^\mathrm{a} \flen }{\varepsilon F^\mathrm{a} \flen}(f_{v_1} - f_{v_0}),  0.95F^\mathrm{a} \flen & \leq  F^{\mathrm{CE}} 
     \end{cases}
\end{eqnarray}
Paola
  • 21

3 Answers3

1

I don't think you need the eqnarray environment at all. Instead, embed the cases (or, as shown in the example below, a dcases) environment inside an ordinary equation environment.

enter image description here

\documentclass{article}
\usepackage[a4paper,margin=2.5cm]{geometry} % choose paper size and margins
\usepackage{mathtools}  % for 'dcases' environment
\def\flen{\bar{F}^\mathrm{M}_{\mathrm{len}}} 
\def\finv{{(\bar{F}^{\mathrm{M}}_{\mathrm{V}}})^{-1}}
\begin{document}
\begin{equation}
\finv(F^{\mathrm{CE}},F^\mathrm{a})=
\begin{dcases}
   \frac{F^{\mathrm{CE}}}{\varepsilon}\left(\frac{\varepsilon-F^{\mathrm{a}}}{F^{\mathrm{a}}+\varepsilon/A_{\mathrm{f}}+\xi}+{\frac{F^\mathrm{a}}{F^\mathrm{a}+\xi}}\right) - \frac{F^\mathrm{a}}{F^\mathrm{a}+\xi}\,,  & \phantom{0\le{}} F^{\mathrm{CE}}  <0 \\[1.5ex]
   \frac{F^{\mathrm{CE}}-F^\mathrm{a}}{F^{\mathrm{a}}+F^{\mathrm{CE}}/A_{\mathrm{f}}+\xi}\,, &  0  \leq F^{\mathrm{CE}} <F^\mathrm{\mathrm{a}} \\[1.5ex]
   \frac{F^{\mathrm{CE}}-F^\mathrm{a}}{\dfrac{{(2+2/A_{\mathrm{f}})}{(F^\mathrm{a}\flen - F^{\mathrm{CE}})}}{\flen - 1}+\xi}\,, & F^\mathrm{a}  \leq  F^{\mathrm{CE}} < 0.95F^\mathrm{a}\flen  \\[1.5ex]
   f_{v_0} + \frac{F^{\mathrm{CE}} - 0.95F^\mathrm{a} \flen }{\varepsilon F^\mathrm{a} \flen}(f_{v_1} - f_{v_0})\,, & 0.95F^\mathrm{a} \flen  \leq  F^{\mathrm{CE}} 
\end{dcases}
\end{equation}
\end{document}

Addendum: If you want the conditioning statements to feature exact alignments on the inequalities, it turns out to be easier to use an array environment instead of a dcases environment. Personally, I don't think the result looks better than what's achieved above (i.e., with a dcases environment and less than perfect alignment of the inequalities). In case you're curious: the @{}>{{}}c<{{}}@{} constructs serve to center-set the ineqality symbols while assigning the proper amount of whitespace to their left and right.

enter image description here

\documentclass{article}
\usepackage[a4paper,margin=2.5cm]{geometry} % choose paper size and margins
\usepackage{amsmath} % for \dfrac macro
\usepackage{array}
\def\flen{\bar{F}^\mathrm{M}_{\mathrm{len}}} 
\def\finv{(\bar{F}^{\mathrm{M}}_{\mathrm{V}})^{-1}}
\begin{document}
\begin{equation}
\finv(F^{\mathrm{CE}},F^\mathrm{a})=
\left\{ 
\begin{array}{ >{\displaystyle}l @{\quad} r @{}>{{}}c<{{}}@{} c @{}>{{}}c<{{}}@{} l @{} }
\frac{F^{\mathrm{CE}}}{\varepsilon}\left(\frac{\varepsilon-F^{\mathrm{a}}}{F^{\mathrm{a}}+\varepsilon/A_{\mathrm{f}}+\xi}+{\frac{F^\mathrm{a}}{F^\mathrm{a}+\xi}}\right) - \frac{F^\mathrm{a}}{F^\mathrm{a}+\xi}\,,  
    & & & F^{\mathrm{CE}}& <&0 \\[4ex]
\frac{F^{\mathrm{CE}}-F^\mathrm{a}}{F^{\mathrm{a}}+F^{\mathrm{CE}}/A_{\mathrm{f}}+\xi}\,, 
   &  0  &\leq& F^{\mathrm{CE}} &<&F^\mathrm{\mathrm{a}} \\[4ex]
\frac{F^{\mathrm{CE}}-F^\mathrm{a}}{\dfrac{{(2+2/A_{\mathrm{f}})}{(F^\mathrm{a}\flen - F^{\mathrm{CE}})}}{\flen - 1}+\xi}\,, 
   & F^\mathrm{a}  &\leq&  F^{\mathrm{CE}} &<& 0.95F^\mathrm{a}\flen  \\[7ex]
f_{v_0} + \frac{F^{\mathrm{CE}} - 0.95F^\mathrm{a} \flen }{\varepsilon F^\mathrm{a} \flen}(f_{v_1} - f_{v_0})\,, 
   & 0.95F^\mathrm{a} \flen & \leq & F^{\mathrm{CE}} \\
\end{array}\right.
\end{equation}
\end{document}
Mico
  • 506,678
  • Thank you so much. Will it be possible to align all the less than or less and equal symbols for each case? – Paola Feb 03 '15 at 19:42
  • @Paola - I've posted an addendum to show how alignment on the inequality symbols might be achieved via an array environment. – Mico Feb 03 '15 at 20:15
  • Thank you so much Mico. Unfortunately, my advisor likes it that way. You are a genius! – Paola Feb 03 '15 at 20:35
  • @Paola - Satisfying the stylistic and aesthetic whims of one's advisor can indeed be a chore. Glad my code works for you. – Mico Feb 03 '15 at 20:38
1

You can use the empheq package (which loads amsmath and mathtools) and the alignat* environment:

\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc}[1ex]
\usepackage[hmargin=2.5cm] {geometry}
\usepackage[overload]{empheq}
\usepackage{amsmath} 
\usepackage{lmodern}
\def\flen{\bar{F}^\mathrm{M}_{\mathrm{len}}} \def\finv{{\bigl(\bar{F}^{\mathrm{M}}_{\mathrm{V}}}\bigr)^{-1}}

\begin{document}

\begin{alignat*}{2}[left ={\finv(F^{\mathrm{CE}},F^\mathrm{a})=\empheqlbrace}]%{align*}
& \dfrac{F^{\mathrm{CE}}}{\varepsilon}\left({\dfrac{\varepsilon-F^{\mathrm{a}}}{F^{\mathrm{a}} + \varepsilon/A_{\mathrm{f}}+\xi}+{\dfrac{F^\mathrm{a}}{F^\mathrm{a}+\xi}}}\right) - \dfrac{F^\mathrm{a}}{F^\mathrm{a}+\xi},\hskip-1em & F^{\mathrm{CE}} & <0 \\[1ex]
& \dfrac{F^{\mathrm{CE}}-F^\mathrm{a}}{F^{\mathrm{a}}+F^{\mathrm{CE}}/A_{\mathrm{f}}+\xi}, & 0\leq F^{\mathrm{CE}}& <F^\mathrm{\mathrm{a}} \\[1ex]
& \dfrac{F^{\mathrm{CE}}-F^\mathrm{a}}{\dfrac{{(2+2/A_{\mathrm{f}})}{(F^\mathrm{a}\flen - F^{\mathrm{CE}})}}{\flen - 1}+\xi}, & F^\mathrm{a} \leq F^{\mathrm{CE}} & < 0.95F^\mathrm{a}\flen \\[1ex]
& f_{v_0} + \dfrac{F^{\mathrm{CE}} - 0.95F^\mathrm{a} \flen }{\varepsilon F^\mathrm{a} \flen}(f_{v_1} - f_{v_0}), &0.95F^\mathrm{a} \flen & \leq F^{\mathrm{CE}}
\end{alignat*}

\end{document} 

enter image description here

Bernard
  • 271,350
  • Bernard thank you also for your help. YOu are all very smart and patient towards a novice latex person like me :) – Paola Feb 03 '15 at 20:37
0

If you want them to be aligned with the left curly bracket then remove the "&" sign, If you want the conditions to be aligned then use a "&" in front of ","

\begin{document}

\begin{eqnarray}
\finv(F^{\mathrm{CE}},F^\mathrm{a})=
     \begin{cases}
     \dfrac{F^{\mathrm{CE}}}{\varepsilon}\left({\dfrac{\varepsilon-F^{\mathrm{a}}}{F^{\mathrm{a}}+\varepsilon/A_{\mathrm{f}}+\xi}+{\dfrac{F^\mathrm{a}}{F^\mathrm{a}+\xi}}}\right) - \dfrac{F^\mathrm{a}}{F^\mathrm{a}+\xi}&,   F^{\mathrm{CE}}   <0 \\
     \nonumber \\
     \dfrac{F^{\mathrm{CE}}-F^\mathrm{a}}{F^{\mathrm{a}}+F^{\mathrm{CE}}/A_{\mathrm{f}}+\xi}&,  0   \leq F^{\mathrm{CE}} <F^\mathrm{\mathrm{a}} \\
     \nonumber \\
     \dfrac{F^{\mathrm{CE}}-F^\mathrm{a}}{\dfrac{{(2+2/A_{\mathrm{f}})}{(F^\mathrm{a}\flen - F^{\mathrm{CE}})}}{\flen - 1}+\xi}&,  F^\mathrm{a}  \leq  F^{\mathrm{CE}} < 0.95F^\mathrm{a}\flen  \\
     \nonumber \\
    f_{v_0} + \dfrac{F^{\mathrm{CE}} - 0.95F^\mathrm{a} \flen }{\varepsilon F^\mathrm{a} \flen}(f_{v_1} - f_{v_0})&,  0.95F^\mathrm{a} \flen  \leq  F^{\mathrm{CE}} 
     \end{cases}
\end{eqnarray}

%--------------- From here on was added after the edit.

You can use a tabular inside the cases, not very clean, but does the job!

\begin{eqnarray}
\finv(F^{\mathrm{CE}},F^\mathrm{a})=
     \begin{cases}
     \begin{tabular}{lr}
          $\dfrac{F^{\mathrm{CE}}}{\varepsilon}\left({\dfrac{\varepsilon-F^{\mathrm{a}}}{F^{\mathrm{a}}+\varepsilon/A_{\mathrm{f}}+\xi}+{\dfrac{F^\mathrm{a}}{F^\mathrm{a}+\xi}}}\right) - \dfrac{F^\mathrm{a}}{F^\mathrm{a}+\xi}$&,   $F^{\mathrm{CE}}   <0$ \\
     %\nonumber \\
     $\dfrac{F^{\mathrm{CE}}-F^\mathrm{a}}{F^{\mathrm{a}}+F^{\mathrm{CE}}/A_{\mathrm{f}}+\xi}$&,  $0   \leq F^{\mathrm{CE}} <F^\mathrm{\mathrm{a}}$ \\
%     \nonumber \\
     $\dfrac{F^{\mathrm{CE}}-F^\mathrm{a}}{\dfrac{{(2+2/A_{\mathrm{f}})}{(F^\mathrm{a}\flen - F^{\mathrm{CE}})}}{\flen - 1}+\xi}$&,  $F^\mathrm{a}  \leq  F^{\mathrm{CE}} < 0.95F^\mathrm{a}\flen $ \\
    % \nonumber \\
    $f_{v_0} + \dfrac{F^{\mathrm{CE}} - 0.95F^\mathrm{a} \flen }{\varepsilon F^\mathrm{a} \flen}(f_{v_1} - f_{v_0})$&,  $0.95F^\mathrm{a} \flen  \leq  F^{\mathrm{CE}} $
     \end{tabular}
     \end{cases}
\end{eqnarray}
  • Hello I changed it to array. What I want to align the inequalities to the right while having the equations to the left. – Paola Feb 03 '15 at 19:36