8

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?

jub0bs
  • 58,916
Edvard
  • 183
  • 2
    Why not use some display-math environment, such as equation? – jub0bs May 06 '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 06 '13 at 16:02
  • I want to number equation inside text paragraph. Is it possible? – Edvard May 06 '13 at 16:09
  • \documentclass[a4paper,14pt]{extarticle}
    \begin{document}
    
    $e_{33} = 0\ \eqno(4.4)$
    
    \end{document}
    
    – Edvard May 06 '13 at 16:14

1 Answers1

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}

enter image description here

jub0bs
  • 58,916