1
\documentclass[11pt]{article}  
\usepackage{graphicx}  
\usepackage[margin=1in]{geometry}  
\usepackage{amsmath}  
\usepackage{float}  

\begin{eqnarray*}  
8+4-3*2&=&x (1)    
8+4-6&=&x (2)    
12-6&=&x (3)  
x&=&6 (4)  
\end{eqnarray*}

This is how I want the document to look, but I cannot figure out how to align the numbers (1,2,3,4) on the right on the same line as the equations

enter image description here

Stefan Pinnow
  • 29,535
  • 1
    Hi and welcome to TeX.SE! Please have a look here about eqnarray. – mickep Sep 22 '17 at 18:47
  • 2
    remove all the numbers in brackets and remove the * so the equations are numbered automatocally – David Carlisle Sep 22 '17 at 18:47
  • If you want to set the numbers manually, you can reset the counter before the eqnarray (\setcounter{equation}{0}). If you don't want to use numbers, use \tag{...}. – jaytar Sep 22 '17 at 18:59

1 Answers1

1

You shouldn't use eqnarray as it produces bad spacing around the alignment point. Usealign from amsmath, which further more has a simpler syntax:

\documentclass[11pt]{article}
\usepackage[margin=1in]{geometry}
\usepackage{mathtools}

\begin{document}

\begin{align}
8+4-3*2 &= x \\
8+4-6 &= x \\
12-6&= x \\
x &= 6
\end{align}

\end{document}

Bernard
  • 271,350