# Equation Numbers Appearing Below Equations

I am new to LaTex, but I am trying to make it so that my equation numbers are aligned with my equations. However, what keeps happening (and I can't explain why) is my equation numbers start appearing below my equations at about the 10th equation. The first 9 equations seem to be okay though, but I haven't really changed anything in regards to my formatting so I am not able to explain what the problem is. Additionally, I am not sure how you would go about getting some extra space before the equation numbers because it appears to be fairly cluttered.

Like I said, I am fairly new to LaTex so my code is probably gross, but if somebody has any recommendations I would be happy to hear them.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{lipsum}
\usepackage[margin=1in, includefoot]{geometry}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{enumitem}
\usepackage{ stmaryrd }
\usepackage{comment}

\begin{document}

\begin{align}
\min_{L_{t}} \quad & \sum_{i=1}^I\sum_{j=1}^J\sum_{t=1}^T(a + b L_{t}^{ij}) G_{t,PostDispersal}^{ij} \\
\text{s.t.} \quad & j_{t,k} = sj_{t-1,k-1}  & k=2,...,kmax; \quad \forall i,j,t \\
\quad & j_{t,1} = dJ_{t-1} + \tilde{d}\mathcal{G}_{t-1} & \forall i,j,t  \\
\quad & J_{t} = \sum_{k=1}^{kmax} j_{t,k}  & \forall i,j,t \\
\quad & S_{t} = \max\left\{S_{t-1} + sj_{t-1,kmax} - G_{t-1,NewGrowth}, 0\right\} & \forall i,j,t \\
\quad & R_{t} = G_{t-1,PostTreatment} & t=1, ... ,T; \quad \forall i,j \\
\quad & \mathcal{G}_{t} =  \mathcal(1-\tilde{d})\mathcal{G}_{t-1} + R_{t} & \forall i,j,t \\
\quad & G_{t,B4Dispersal} = G_{t-1,PostTreatment} & \forall i,j,t \\
\quad & D_{t}^{(i,j)_n \shortrightarrow(i,j)} = \lambda\sum_{(o,p) \in N}G_{t,B4Dispersal} & \forall i,j,t \\
\quad & D_{t}^{(i,j)\shortrightarrow(i,j)} = \lambda\mathcal{N}G_{t,B4Dispersal} & \forall i,j,t \\
\quad & G_{t,PostDispersal} = \max\left\{G_{t,B4Dispersal}+D_{t}^{(i,j)_n\shortrightarrow(i,j)} -D_{t}^{(i,j)\shortrightarrow(i,j)}, 0\right\} & \forall i,j,t & \tag{11}\\
\quad & G_{t,NewGrowth} = \frac{G_{t,PostDispersal}^{2}} {G_{t,PostDispersal}^{2} + a^2} S_{t}  & \forall i,j,t & \tag{12}\\
\quad & G_{t,PostTreatment} = (1-L_{t})G_{t,NewGrowth} & \forall i,j,t & \tag{13}\\
\quad & \sum_{i=1}^I\sum_{j=1}^J\sum_{t=1}^TbL_{t}^{ij} \le B & \forall i,j,t & \tag{14}
\end{align}
\begin{align*}
S_{0},R_{0},\mathcal{G}_{0}, J_{0},G_{0,PostTreatment} \ge 0
\end{align*}

\end{document}

• Edited to include that, thank you. – Dennis Gray Oct 30 at 0:02

It happens because equation (11) is to long. You can solve the problem using \mathrlap from mathtools with the last part of this equation. It took the opportunity to add some code simplification and a few improvements to the layout:

\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[margin=1in, includefoot]{geometry}
\usepackage{mathtools, nccmath}
\usepackage{amssymb}
\usepackage{ stmaryrd }
\usepackage{lipsum}
\usepackage{enumitem}
\usepackage{comment}

\begin{document}

\begin{alignat}{2}
\min_{L_{t}} \quad & \sum_{i=1}^I\sum_{j=1}^J\sum_{t=1}^T(a + b L_{t}^{ij}) G_{t, \text{PostDispersal}}^{ij} \\
\text{s.t.} \quad & j_{t,k} = sj_{t-1,k-1} & k=2,...,k_{\max}; \quad &\forall i,j,t \\
& j_{t,1} = dJ_{t-1} + \tilde{d}\mathcal{G}_{t-1} & & \forall i,j,t \\
& J_{t} = \sum_{k=1}^{\mathclap{k_{\max}}} j_{t,k} & & \forall i,j,t \\
& S_{t} = \max\left\{S_{t-1} + sj_{t-1,k_{\max}} - G_{t-1,\text{NewGrowth}}, 0\right\} & & \forall i,j,t \\
& R_{t} = G_{t-1,\text{PostTreatment}} & t=1, ... ,T; \quad & \forall i,j \\
& \mathcal{G}_{t} = \mathcal(1-\tilde{d})\mathcal{G}_{t-1} + R_{t} & & \forall i,j,t \\
& G_{t,\text{B4Dispersal}} = G_{t-1,\text{PostTreatment}} & & \forall i,j,t \\
& D_{t}^{(i,j)_n \shortrightarrow(i,j)} = \lambda\sum_{\mathclap{(o,p) \in N}}G_{t,\text{B4Dispersal}} & & \forall i,j,t \\
& D_{t}^{(i,j)\shortrightarrow(i,j)} = \lambda\mathcal{N}G_{t,\text{B4Dispersal}} & & \forall i,j,t \\
& G_{t,\text{PostDispersal}} = \max\Bigl\{G_{t,\text{B4Dispersal}}+D_{t}^{(i,j)_n\shortrightarrow(i,j)} -\mathrlap{D_{t}^{(i,j)\shortrightarrow(i,j)}, 0\Bigr\}} && \forall i,j,t \\
& G_{t,\text{NewGrowth}} = \frac{G_{t,\text{PostDispersal}}^{2}} {G_{t,\text{PostDispersal}}^{2} + a^2} S_{t} && \forall i,j,t \\
& G_{t,\text{PostTreatment}} = (1-L_{t})G_{t,\text{NewGrowth}} & & \forall i,j,t \\
& \smash[b]{\sum_{i=1}^I\sum_{j=1}^J\sum_{t=1}^T}bL_{t}^{ij} \le B & & \forall i,j,t
\end{alignat}
\useshortskip
\begin{align*}
S_{0},R_{0},\mathcal{G}_{0}, J_{0},G_{0,\text{PostTreatment}} \ge 0
\end{align*}

\end{document}


• This is so much more presentable than what I had. Without putting too much of a burden on you, could you provide an explanation on a couple of the key areas that you changed so that things aligned properly? I'm fairly new to LaTex so i'm just trying to absorb what I can. – Dennis Gray Oct 30 at 14:15
• The main change is that you did not seem to perceive that a multiline equation with 2 alignment points (indeed two alignment columns) requires 3 ampersands: each column but the first requires a first & to mark the beginning of the new alignment column, and another to mark the alignment point inside that column. When the second & is missing, there's an alignment of the end of lines. Furthermore, I used alignat because it gives you control on the spacing of the alignment columns. I hope to be clear… – Bernard Oct 30 at 14:35

You are forcing an alignment such that the for-all and k==.. conditions are to the right of the longest entry in the display, which makes them a long way from the terms they relate to and forces the lines to be too wide to take the equation number on the same line.

I dropped that alignment, and while there used \mathrm around multi-letter identifiers (never use math italic, it is designed for products of one-letter variables, not words) and allowed the lines to auto-number rather than using \tag beware using \tag with numbers, it will be very confusing if used on conjunction with automatically numbered constructs.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{lipsum}
\usepackage[margin=1in, includefoot]{geometry}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{enumitem}
\usepackage{ stmaryrd }
\usepackage{comment}

\begin{document}

\begin{align}
\min_{L_{t}} \quad & \sum_{i=1}^I\sum_{j=1}^J\sum_{t=1}^T(a + b L_{t}^{ij}) G_{t,\mathrm{PostDispersal}}^{ij} \\
j_{t,1}  &= dJ_{t-1} + \tilde{d}\mathcal{G}_{t-1} \qquad\forall i,j,t  \\
J_{t}  &= \sum_{k=1}^{kmax} j_{t,k}  \qquad\forall i,j,t \\
S_{t}  &= \max\left\{S_{t-1} + sj_{t-1,\mathrm{kmax}} - G_{t-1,\mathrm{NewGrowth}}, 0\right\} \qquad\forall i,j,t \\