# Center align formula, right align text

I am trying to write a formula and then number it (5). The formula is meant to be center aligned and the numbering should be right aligned on the same line. This was my best attempt at doing that but when the flushright environment begins it starts a new line so the text and formula do not appear on the same line. Is there a clever way of doing this?

\begin{center} $1-\alpha$
\begin{flushright}(5)
\end{flushright}
\end{center}

-
Use amsmath and then \begin{align} 1-\alpha \tag{5} \end{align}. It's that easy. –  Werner Aug 28 '13 at 23:54
Thank you! I'm new to using latex compilers; I am using MikTex for compiling the code into pdf. I see that in the link you gave it says that amsmath is contained in MikTex. If amsmath is a library how can I include it to make \tag{5} work? –  user35873 Aug 29 '13 at 0:32
@user35873 \usepackage{amsmath} in the preamble (i.e., before \begin{document}). –  Gonzalo Medina Aug 29 '13 at 0:43
This is brilliant thank you so much, it looks professional now :D –  user35873 Aug 29 '13 at 1:06
\eqno still works (most of the time) as well. –  John Kormylo Aug 29 '13 at 3:38

As Werner and Gonzalo Medina say, just use

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\noindent Horse, horse, horse, horse, horse, horse, horse, horse, horse, horse, horse, horse, horse.
$$1-\alpha \tag{5}$$
Horse, horse, horse, horse, horse, horse, horse, horse, horse, horse, horse, horse, horse.

\end{document}


-