3

I'm new to LaTeX. I was writing this equation the other day.

\begin{equation}
 \sum_{1}^{n} =
   \left\{\begin{array}{lr}
       1, & n=1\\
       n+\sum_{1}^{n-1}, &\forall n>1
    \end{array}\right.
 \end{equation}

But when I executed it, there was always this (1) dangling on the side.

enter image description here

Can anyone help get rid of it?

1
  • 1
    JamesT has answered your question, but the idea of the (1) is that elsewhere in your paper you can say "as we saw/see in Equation (1)". You can even use LaTeX's label/ref mechanism to have the (1) automatically change if you rearrange your equations.
    – Teepeemm
    May 31, 2023 at 12:45

2 Answers 2

7

You need to use the starred environments to remove the automatic equation numbering i.e. \begin{equation*} and \end{equation*}:

enter image description here

\documentclass{article}

\usepackage{mathtools}

\begin{document}
\begin{equation*}
 \sum_{1}^{n} =
   \left\{\begin{array}{lr}
       1, & n=1\\
       n+\sum_{1}^{n-1}, &\forall n>1
    \end{array}\right.
 \end{equation*}
\end{document}

A more succinct way that reduces typing is to follow the advice from @barbara beeton and use \[ and \] to wrap the one-line equation in:

\documentclass{article}

\usepackage{mathtools}

\begin{document}
\[
 \sum_{1}^{n} =
   \left\{\begin{array}{lr}
       1, & n=1\\
       n+\sum_{1}^{n-1}, &\forall n>1
    \end{array}\right.
\]
\end{document}

which produces the same output image.

3
  • 1
    Thank you very much!
    – Sean
    May 31, 2023 at 0:40
  • 4
    @Sean - The "starred" varieties of LaTeX commands and environments often [but not universally] serve to eliminate numbering. This is the case not only for equation/equation* display-math environments, but also for other, multi-line math environments -- align vs. align*, gather vs. gather*, etc -- and for commands such as \chapter, \section, and \subsection. To create unnumbered chapter, section, and subsection level headers, just write \chapter*, \section*, and \subsection*.
    – Mico
    May 31, 2023 at 5:23
  • 1
    An alternative to equation* is to wrap the (one-line) display in \[ ... \]. May 31, 2023 at 12:46
2

Using cases enviroment.

\documentclass[12pt]{article}
\usepackage{amsmath,amssymb}
\begin{document}
\begin{equation*}
\sum_{1}^{n} = \begin{cases}
       1, & n=1\\
       n+\sum_{1}^{n-1}, &\forall n>1
\end{cases}
\end{equation*}
\end{document}

enter image description here

2
  • 4
    In order to answer the question itself, you would need to use the starred equation environment ;)
    – KersouMan
    May 31, 2023 at 10:52
  • 1
    @KersouMan Thank you very much for your advice.
    – Sebastiano
    Jun 1, 2023 at 7:26

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