# formulas on the left

I would like to change the way the formulas are written in my thesis. As it can be seen, I have both equation and eqnarray. Sometimes, the option \\ is used to start a new line. If this option is used for the equation, then the option begin{split} is added.

$$\begin{split} x_{nmk}\in\{0,1\}, f_{kn},u_{kn},r_{ink},y_{in},t_{k}\geq 0, \\ \ i=1,...,N, k=1,...,K,n=1,...,N, \label{nnb8} \end{split}$$
\begin{eqnarray}
f_{kn}\geq f_{km}-\sum_{i=1}^N r_{inkl}-(1-x_{mnk})M, \nonumber \\ \ k=1,...,K,m=0,...,N,n=1,...,N\label{loadbalance8}\\
\end{eqnarray}


I would like to change the way the first line of the formula is displayed when there are more than one line. In that case, the first line of the equation and only the first line of the equation should move to the left. The second line should start as it is suposed from the right. Thank you for your help

• Welcome to TeX SX! You shouldn't use eqnarray, which has been deprecated for more than 20 years and can lead to bad spacing. You should replace it with align from amsmath. May 17 '17 at 9:45
• @Francesco Zangaro, any news? May 23 '17 at 18:35

For single equations split opver more than one line you can use multline which gives the staggered layout automatically. Otherewise use align not eqnarray, also \dots not ...

\documentclass{article}

\usepackage{amsmath}

\begin{document}
aaaa
\begin{multline}
x_{nmk}\in\{0,1\}, f_{kn},u_{kn},r_{ink},y_{in},t_{k}\geq 0, \\
i=1,\dots,N, k=1,\dots,K,n=1,\dots,N, \label{nnb8}
\end{multline}

bbb
\begin{align}
f_{kn}&\geq f_{km}-\sum_{i=1}^N r_{inkl}-(1-x_{mnk})M, \nonumber \\
\end{align}
\end{document}


Like this?

\documentclass{article}
\usepackage{mathtools}

\begin{document}
$$\begin{split}\label{nnb8} x_{nmk}\in\{0,1\}, \quad & f_{kn},u_{kn},r_{ink},y_{in},t_{k}\geq 0, \\ & \ i=1,...,N, k=1,...,K,n=1,...,N, \end{split}$$

\begin{align}
f_{kn}\geq f_{km}-
& \sum_{i=1}^N r_{\mathit{inkl}}-(1-x_{mnk})M,   \nonumber \\
& k=1,\dotsc,K,m=0,\dotsc,N,n=1,\dotsc,N
& f_{k0}= \sum_{i=1}^N \sum_{n=1}^N r_{ink},\ k=1,\dotsc,K
\end{align}
\end{document}


In your MWE is not clear where you have separate variables or text in subscripts. Maybe is my correction of inkl wrong (if this is set of four variables). Also I discourage you to use eqnarray, instead it is better align from amsmath or mathtools package.

Addendum: It seem that probably desired form of equations is:

In eq. 2 is used multlined environment defined in mathtools:

\documentclass{article}
\usepackage{mathtools}

\begin{document}
$$\begin{split}\label{nnb8} x_{nmk}\in\{0,1\}, \quad & f_{kn},u_{kn},r_{ink},y_{in},t_{k}\geq 0, \\ & \ i=1,...,N, k=1,...,K,n=1,...,N, \end{split}$$

\begin{align}
f_{kn}
& \begin{multlined}[t][0.6\hsize]
\geq f_{km} - \sum_{i=1}^N r_{\mathit{inkl}}-(1-x_{mnk})M,   \\
k=1,\dotsc,K,m=0,\dotsc,N,n=1,\dotsc,N
f_{k0} & = \sum_{i=1}^N \sum_{n=1}^N r_{ink},\ k=1,\dotsc,K
\end{align}
\end{document}


I just used your first few set of equations, and tried to attain what you want,

\documentclass[10pt]{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
x_{nmk}\in\{0,1\}, f_{kn},u_{kn},r_{ink},y_{in},t_{k}\geq 0,& \\ \
&i=1,...,N, k=1,...,K,n=1,...,N,
\end{align}
\end{document}


using this will give you

as you asked with one and only the first line of equation on the left, and the rest of the lines starting from right. This you can achieve with the \align equation environment that is available in amsmath package. By following this notion you can set the rest of your equations at your will.