185

I have an equation like this:

   \begin{align}
      P(A \cup B) = \sum_{\omega \in A \cup B} P(\omega) = \sum_{\omega \in A} P(\omega) + \sum_{\omega \in B} P(\omega)
      = P(A) + P(B)
    \end{align}

For some reason, LaTeX is automatically labeling the equation. How do I turn that off? Secondly how do I write something in LaTeX on this site. I tried enclosing in '$' but it doesn't work.

Torbjørn T.
  • 206,688
user1046
  • 1,953

7 Answers7

214

Do a \begin{align*} ... \end{align*}. That should do the trick.

levesque
  • 12,993
  • 12
  • 43
  • 52
87

If you only want some of the lines in an align environment to not be numbered, just put \nonumber before the end characters on each of the lines you don't want to have numbers. Otherwise, use align* as JCL suggested so that none of the lines will be numbered.

Scott H.
  • 11,047
Rebekah
  • 9,838
  • 1
  • 17
  • 9
45

As a sidenote, the mathtools package, which makes some improvements on amsmath, provides a way of labeling only those equations that are referenced in the text.

enter image description here

\documentclass{article}  
\usepackage{mathtools}  
\mathtoolsset{showonlyrefs}  
\begin{document}  
\begin{gather}  
  a = b \label{eq1} \\  
  c = d \label{eq2}  
\end{gather}  
Some text, \eqref{eq2}.  
\end{document}

In this case, only the second of the equations, c = d, is numbered, as that is the only one being referenced in the text.

Notes

  • three compiler passes are required for the references to show up properly
  • this does not work with cleveref, but the cleveref manual mentions another package, autonum, that performs the same task, yet is compatible with cleveref.
  • the manual of the present version (dated 2012/05/10) notes two bugs, one can cause that the number is printed close to, or on top of, the equation, the other relates to ntheorem. Refer to the manual for details.
Torbjørn T.
  • 206,688
44

If you use this:

\begin{equation}
...
\end{equation}

try this instead:

\begin{equation*}
...
\end{equation*}

This solution requires the use of the package amsmath.

Viesturs
  • 7,895
Soroush
  • 555
31

Note whilst the above answers are relevant to the question, a lot of people include equations in LaTeX using the \begin{equation} which works without explicitly including the amsmath package in a LaTeX document. However when one attempts to the use \begin{equation*} directive (to omit numbering) an error is generated. Thus in this case it should be pointed out that one needs to explicitly import the amsmath package:

\usepackage{amsmath}
Thorsten
  • 12,872
Pierz
  • 479
3

"\nonumber" sometimes does not work for me. Another possibility is to do:

\begin{center}
$ P(A \cup B) = \sum_{\omega \in A \cup B} P(\omega) = \sum_{\omega \in A}
P(\omega) + \sum_{\omega \in B} P(\omega) = P(A) + P(B) $
\end{center}
msbar
  • 39
  • 1
    Please be a bit more specific about the circumstances when "\nonumber ... doesn't work for me". You should probably insert a \displaymath directive immediately after the opening $ symbol so that the \sum symbols will be set in "large" mode, as this is the generally expected behavior for displayed equation. A downside to your proposed method is that the vertical spacing above and below a center environment is not likely to be the same as for displayed equations. – Mico Jan 04 '14 at 21:10
  • 1
    I would strongly advise against this method, as math typeset in text-mode (ie. using $) and set in display-mode (ie. using a dedicated environment) have quite different spacing to the text above and below. On top of that, certain characters are typeset differently, as @Mico mentions, and even though \displaymath takes care of this, the spacing will remain wrong. – spet Mar 05 '14 at 07:21
0
\documentclass{article}
\usepackage{amsmath}
\begin{document}
  Solve these problems
  \begin{align*}
  1. \;\; &   x= y+z & 2.\;\; &x^n= y^n+z^n \\  
   3.\;\; &  x= y+z &  4.\;\;  & x^n= y^n+z^n \\ 
    \end{align*}

    {\bf  This is some sample text we will use to create a somewhat longer text
        spanning a few lines.}

        \begin{align*}
   5.\;\; &  x= y+z & 6.\;\; & x^n= y^n+z^n\\   
  \end{align*}
\end{document}

This gives required output.

Stefan Kottwitz
  • 231,401
vaman
  • 81