[Tex/LaTex] Aligning two columns in one equation!

alignequations

Consider the following

\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{amssymb}


\begin{document}
\begin{align}
X_{n}=\begin{cases}
               X_{n}^{I}= t_{1}\nu_{1}^{n}+r_{1}\nu_{2}^{n}, \quad -N\leq n<-d, \\
               X_{n}^{II}= t_{2}\nu_{1}^{n}+r_{2}\nu_{2}^{n}, \quad \ -d<n<-1, \\
               X_{n}^{III}=t_{3}\nu_{1}^{n}+r_{3}\nu_{2}^{n}, \quad \quad 1<n<d, \\
               X_{n}^{IV}=t_{4}\nu_{1}^{n}+r_{4}\nu_{2}^{n}, \quad \quad d<n\leq N, \\
\end{cases}
\end{align}

\end{document}

how can I make sure that the = sign in the left column is aligned as well as the inequalities on the right?

Best Answer

One option is to try the array environment instead of the cases one.

\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{amssymb}    
\begin{document}

\begin{equation}
a_{n}=\left\{%
       \begin{array}{@{}r@{{}={}}l@{\quad}r@{{\,n\,}}l@{}}
       X_{n}^{I}  & t_{1}\nu_{1}^{n}+r_{1}\nu_{2}^{n}, & -N \leq& <-d, \\
       X_{n}^{II} & t_{2}\nu_{1}^{n}+r_{2}\nu_{2}^{n}, & -d    <& <-1, \\
       X_{n}^{III}& t_{3}\nu_{1}^{n}+r_{3}\nu_{2}^{n}, &  1    <& <d, \\
       X_{n}^{IV} & t_{4}\nu_{1}^{n}+r_{4}\nu_{2}^{n}, &  d    <& \leq N, \\
\end{array}\right .
\end{equation}

\end{document}

enter image description here