TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

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?

share|improve this question

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

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

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
up vote 9 down vote accepted

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:

\newcommand\inlineeqno{\stepcounter{equation}\ (\theequation)}
$e_{33} = 0 \inlineeqno$

enter image description here

share|improve this answer
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 \begin{equation}e_{33} = 0\end{equation}). – Claudio Fiandrino May 6 '13 at 16:50

Not the answer you're looking for? Browse other questions tagged or ask your own question.