Notice how I've used the syntax of LaTeX to format the equation into the way you want - subscripts need the _ key, and I've used { } to indicate "k_p" should itself be a subscript. Also note how to make fractions by using the \frac{}{} command.
You would probably want to use an align environment
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
\label{cons1}
x_i+w_{mi}&\le X_j &&\text{if $i$ is to the left of $j$}\\
\label{cons2}
x_i-w_{mj}&\ge X_j &&\text{if $i$ is to the right of $j$}\\
\label{cons3}
y_i+h_{mi}&\le y_j &&\text{if $i$ is below of $j$}\\
\label{cons4}
y_i-h_{mj}&\ge y_j &&\text{if $i$ is above of $j$}
\end{align}
\end{document}
Best Answer
One of the simplest ways to input an equation into LaTeX is to write something like
Notice how I've used the syntax of LaTeX to format the equation into the way you want - subscripts need the _ key, and I've used { } to indicate "k_p" should itself be a subscript. Also note how to make fractions by using the \frac{}{} command.