# How to number an inline-math equation? [duplicate]

I want to add an equation number in a formula, but I've got an error: "You can't use \eqno' in math mode.". This is my code:

$e_{33} = 0 \eqno(4.4)$


How I can fix it?

-

## marked as duplicate by cmhughes, moewe, Svend Tveskæg, Heiko Oberdiek, barbara beetonApr 6 '14 at 16:23

Why not use some display-math environment, such as equation? –  Jubobs May 6 '13 at 16:02
Which format are you using (LaTeX or plain TeX)? There are environments in LaTeX for displayed equations with equation number (e.g. equation). In plain TeX $$...$$ is used. Or do you want to number a equation inside a text paragraph? –  Heiko Oberdiek May 6 '13 at 16:02
I want to number equation inside text paragraph. Is it possible? –  Edvard May 6 '13 at 16:09
\documentclass[a4paper,14pt]{extarticle} \begin{document} $e_{33} = 0\ \eqno(4.4)$ \end{document} –  Edvard May 6 '13 at 16:14

I don't think numbering inline-math equations is wise, because

• It might be difficult for your readers to locate those numbered inline equations in a block of text; inline math doesn't stand out as much from the main text as display math does.
• The equation number, since it does not get flushed to the right (as it does by default in display math), may be mistakenly interpreted as part of the inline equation itself.

However, you could do the following:

\documentclass{article}
\usepackage{amsmath}
\newcommand\inlineeqno{\stepcounter{equation}\ (\theequation)}
\begin{document}
$e_{33} = 0 \inlineeqno$
\end{document}


-
Thanks a lot. But why it is unwise? –  Edvard May 6 '13 at 16:18
Is it possible to make this command parameterized. For using like this \inlineeqno(4.4)? –  Edvard May 6 '13 at 16:20
I'm not sure I understand. Do you want to number the inline equation manually? In that case, you can just typeset "(4.4)" after it, but you'd be losing the benefits of automating equation numbering made possible by the equation counter. –  Jubobs May 6 '13 at 16:23
I decide to use $$e_{33} = 0\ \eqno(4.4)$$. So it's not important now. –  Edvard May 6 '13 at 16:39
@Edvard: do not use  (see Why is [ … ] preferable to $$…$$?). Moreover, you don't have to specify the equation number: LaTeX itself does this work for you (i.e. try $$e_{33} = 0$$`). –  Claudio Fiandrino May 6 '13 at 16:50