3

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}
5
  • 3
    Use amsmath and then \begin{align} 1-\alpha \tag{5} \end{align}. It's that easy.
    – Werner
    Aug 28, 2013 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, 2013 at 0:32
  • 1
    @user35873 \usepackage{amsmath} in the preamble (i.e., before \begin{document}). Aug 29, 2013 at 0:43
  • This is brilliant thank you so much, it looks professional now :D
    – user35873
    Aug 29, 2013 at 1:06
  • \eqno still works (most of the time) as well. Aug 29, 2013 at 3:38

1 Answer 1

2

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.
\begin{equation}
1-\alpha \tag{5}
\end{equation}
Horse, horse, horse, horse, horse, horse, horse, horse, horse, horse, horse, horse, horse.

\end{document}

output

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .