[Tex/LaTex] prepare correct position for equation

equationspositioning

my goal

Hi all,

I want to write my equation which is like the attached picture.
I tried to write this code below but I couldn't make "Hp" starting from the same positions.

How should I write code to have the picture like this.

\begin{eqnarray} \label{eq:5}
Se & = & \left\{
                \begin{array}{ll}
                  \frac{1}{{[1+|\alpha H_{p}|^{n}]}^{m}}     & \quad H_{p}<0\\
                  1  & \quad H_{p} \geq0
                \end{array}
              \right.   \nonumber
 \\
 \theta & = & \left\{
                \begin{array}{ll}
                  \theta_{r}+Se(\theta_{s}-\theta_{r})  & \quad H_{p}<0\\
                  \theta_{s}     & \quad H_{p} \geq0 
                \end{array}
              \right. 
\\  
C & = & \left\{
                \begin{array}{ll}
                  \frac{\alpha m}{1-m}(\theta_{s}-\theta_{r})Se^{\frac{1}{m}}\left(1-Se^{\frac{1}{m}}\right)^{m}    & \quad H_{p}<0\\
                  0     & \quad H_{p} \geq0
                \end{array}
              \right.   \nonumber   
\\  
k_{r} & = & \left\{
                \begin{array}{ll}
                  Se^{l}\left[1-\left(1-Se^{\frac{1}{m}}\right)^{m} \right]^2   & \quad H_{p}<0\\
                  1     & \quad H_{p} \geq0
                \end{array}
              \right.   \nonumber                                            
\end{eqnarray}

Best Answer

Please do not use eqnarray! It is deprecated since years. For such things, there are cases from amsmath or the newer mathtools. Just put everything inside of an align. The trick in order to align the most right column is to use an \hphantom here. I hope, this is what you wanted to have.

% arara: pdflatex

\documentclass{article}
\usepackage{mathtools}
\newcommand{\Se}{\operatorname{\mathit{S\kern-.15em e}}}

\begin{document}
\begin{align*}
    \theta &=  
    \begin{dcases}
        \theta_{r}+\Se(\theta_{s}-\theta_{r}) & H_{p}<0 \\ 
        \mathrlap{\theta_{s}}\hphantom{\frac{\alpha m}{1-m}(\theta_{s}-\theta_{r})\Se^{\frac{1}{m}}\bigl(1-\Se^{\frac{1}{m}}\bigr)^{m}} & H_{p} \geq 0 
    \end{dcases}\\
    \Se &=  
    \begin{dcases}
        \frac{1}{{\bigl[1+\lvert\alpha H_{p}\rvert^{n}\bigr]}^{m}} & H_{p}<0 \\ 
        \mathrlap{1}\hphantom{\frac{\alpha m}{1-m}(\theta_{s}-\theta_{r})\Se^{\frac{1}{m}}\bigl(1-\Se^{\frac{1}{m}}\bigr)^{m}} & H_{p} \geq 0 
    \end{dcases} \\
    C &=
    \begin{dcases} 
        \frac{\alpha m}{1-m}(\theta_{s}-\theta_{r})\Se^{\frac{1}{m}}\bigl(1-\Se^{\frac{1}{m}}\bigr)^{m} & H_{p}<0 \\ 
        0 & H_{p} \geq 0 
    \end{dcases} \\
    k_{r} &= 
    \begin{dcases}
        \Se^{l}\Bigl[1-\bigl(1-\Se^{\frac{1}{m}}\bigr)^{m} \Bigr]^2 & H_{p}<0 \\ 
        \mathrlap{1}\hphantom{\frac{\alpha m}{1-m}(\theta_{s}-\theta_{r})\Se^{\frac{1}{m}}\bigl(1-\Se^{\frac{1}{m}}\bigr)^{m}} & H_{p} \geq 0 
    \end{dcases}
\end{align*}
\end{document}

enter image description here


As recommended by daleif, you could also define some certain width and put your lower rows in a mathmakebox with left alignment. This would look like:

\begin{align*}
    \theta &=  
    \begin{dcases}
        \theta_{r}+\Se(\theta_{s}-\theta_{r}) & H_{p}<0 \\ 
        \mathmakebox[5cm][l]{\theta_{s}} & H_{p} \geq 0 
    \end{dcases}\\
    \Se &=  
    \begin{dcases}
        \frac{1}{{\bigl[1+\lvert\alpha H_{p}\rvert^{n}\bigr]}^{m}} & H_{p}<0 \\ 
        \mathmakebox[5cm][l]{1} & H_{p} \geq 0 
    \end{dcases} \\
    C &=
    \begin{dcases} 
        \frac{\alpha m}{1-m}(\theta_{s}-\theta_{r})\Se^{\frac{1}{m}}\bigl(1-\Se^{\frac{1}{m}}\bigr)^{m} & H_{p}<0 \\ 
        \mathmakebox[5cm][l]{0} & H_{p} \geq 0 
    \end{dcases} \\
    k_{r} &= 
    \begin{dcases}
        \Se^{l}\Bigl[1-\bigl(1-\Se^{\frac{1}{m}}\bigr)^{m} \Bigr]^2 & H_{p}<0 \\ 
        \mathmakebox[5cm][l]{1} & H_{p} \geq 0 
    \end{dcases}
\end{align*}
Related Question