# How to get a single line flushleft in the eqnarray environment

I would like to get a single line in the eqnarray environment flushed left. This is my code so far

\begin{eqnarray}
\delta_{j}      & = & \sum_{i = j+1}^{d} n_{i}  \\
and \nonumber\\
g^{\prime}(x)   & = &  \left\{
\begin{array}{ll}
\cos (n_{p-1} \, \theta_{1})            &  \text{for~~} n_{p} = 0   \\
\sin ( (n_{p-1} + 1) \, \theta_{1})     &  \text{for~~} n_{p} = 1   \\
\end{array}
\right.
\end{eqnarray}


I would like to make the line with the the and \nonumber\\ flush left.

Here is a picture of the current output along with a description of what I would like to happen

I have tried using combinations of \hspace, \hfill and \noindent without success. The reason for typing the code in this manner is because I really want to keep the equal signs aligned.

• do not use eqnarray use align then you can use \intertext{and} Apr 16 '18 at 16:08
• See the answers to the posting eqnarray vs align for a thorough list or reasons why one shouldn't use eqnarray.
– Mico
Apr 16 '18 at 16:26

You shouldn't use eqnarray as it gives bad spacing around the alignment points. Use one of the amsmath environments, align or alignat, which furthermore are simpler to type, and \intertext. Here, I loaded mathtools, an extension of amsmath, for its \shortintertext command (better vertical spacing for a single word). Also I replaced the \left\{\begin{array}{ll} ... \end{array} with the simple cases* environment, which switches the second column in text mode. Note that you don't have to type g^{\prime} for the derivative: a simple g' will do:

\documentclass {book}

\usepackage {mathtools}

\begin {document}

\begin{align}
\delta_{j} & = \smashoperator{\sum_{i = j+1}^{d}} n_{i} \\
\shortintertext{and}
g'(x) & = \begin{cases*}
\cos (n_{p-1} \, \theta_{1}) & for $n_{p} = 0$, \\
\sin ( (n_{p-1} + 1) \, \theta_{1}) & for $n_{p} = 1$. \\
\end{cases*}
\end{align}

\end {document}


• You're right (as usual…). I'll even use the cases* environment,, which sets the second column in text mode. Apr 16 '18 at 16:34