# How to move equation numbers to right hand side?

I'm writing a mathematical article and I want the equation numbers to appear on the right hand side and the end of the line however they are currently appearing underneath the equation on the left. How can I change this?

EXAMPLE:

\documentclass{article}
\usepackage[utf8]{inputenc}

\usepackage{natbib}
\usepackage[section]{placeins}
\usepackage{graphicx}
\usepackage{wrapfig}
\usepackage{float}
\usepackage{mathtools}
\usepackage{amsmath}
\usepackage{geometry}
\geometry{ a4paper, total={170mm,257mm}, left=20mm, top=20mm, }

\begin{document}
\maketitle

\section{Equations}
The horizontal and vertical links and network nodes can now be defined as the following matrices: \

For 1 \leq i \leq m+1 \ $and$ \ 1 \leq j \leq n

\begin{description}
\item[(a)]

$$A_{ij}^X= \begin{cases} 1, & \text{if the link between (i,j) and (i,j+1) exists}\ \ 0, & \text{otherwise}\ \ \end{cases}$$ 

\item[(b)]

$$X_{ij} = l_{ij}$$

where $l_{ij}$ is the length of the link between ($i,j$) and ($i,j+1$). If >there is no link between ($i,j$) and ($i,j+1$) then $l_{ij}$=0

\end{description}

\bibliographystyle{plain}
\bibliography{references}
\end{document}

• Welcome to TeX.SX! Right hand side is the default, so you have leqno or some different setup apparently?
– user31729
Commented Nov 16, 2015 at 17:41
• Which document class do you use?
– Mico
Commented Nov 16, 2015 at 17:42
• I'm using article at the moment
– MCCR
Commented Nov 16, 2015 at 17:43
• Do you use at one-column or a two-column layout?
– Mico
Commented Nov 16, 2015 at 17:44
• A one-column layout
– MCCR
Commented Nov 16, 2015 at 17:44

Your coding style is, shall we way, not exactly tidy. Here's a minimalist fix-up that should get you going, at least for a little while. Good news: after the code clean-up, the equation numbers show up on the right-hand edge.

\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage{natbib}
\usepackage[section]{placeins}
\usepackage{graphicx}
\usepackage{wrapfig}
\usepackage{float}
\usepackage{mathtools}
%%\usepackage{amsmath}  is loaded by 'mathtools' -- no need to load it explicitly
\usepackage{geometry}
\geometry{ a4paper, total={170mm,257mm}, left=20mm, top=20mm}

\begin{document}

\section{Equations}

The horizontal and vertical links and network nodes can now be defined as the following matrices

For $1 \leq i \leq m+1$ and $1 \leq j \leq n$

\begin{description}
\item[(a)]
$$A_{ij}^X= \begin{cases} 1, & \text{if the link between (i,j) and (i,j+1) exists}\\ 0, & \text{otherwise} \end{cases}$$

\item[(b)]
$$X_{ij} = l_{ij}$$
where $l_{ij}$ is the length of the link between ($i,j$) and ($i,j+1$).
If there is no link between ($i,j$) and ($i,j+1$) then $l_{ij}$=0

\end{description}
\end{document}

• Thanks yeah that's changed it :) yeah I have just been googling as I go along...
– MCCR
Commented Nov 16, 2015 at 18:16