Math & ScienceHow to number equations in cases.

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
keepitcool
Posts: 2
Joined: Sat Feb 13, 2016 7:42 pm

How to number equations in cases.

Post by keepitcool »

Hello!

I have written the following:

Code: Select all

\[
\begin{cases}
\frac{1}{ T(t)} \partial_{tt} T(t) = - \lambda^2,  \\
\\
c^2  \frac{1}{R(r)} \partial_{rr} R(r) + \frac{1}{R(r)} \frac{1}{r} \partial_{r} R(r) + \frac{1}{r^2} \partial_{\theta \theta} \frac{1}{\Theta ( \theta) } \Theta( \theta ) = - \lambda^2. \label{eq:sep_var2} \\
\end{cases}
\]
I wanted each equation to have a number to ref them later on, but I don't know how to number them.

Best regards

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Stefan Kottwitz
Site Admin
Posts: 10321
Joined: Mon Mar 10, 2008 9:44 pm

How to number equations in cases.

Post by Stefan Kottwitz »

Welcome to the forum!

A cases environment is usually part of a formula structure such as an equation. Equations can be numbered.

Code: Select all

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
  \begin{cases}
  \frac{1}{ T(t)} \partial_{tt} T(t) = - \lambda^2,  \\
    \\
    c^2  \frac{1}{R(r)} \partial_{rr} R(r) + \frac{1}{R(r)} \frac{1}{r}
    \partial_{r} R(r) + \frac{1}{r^2} \partial_{\theta \theta} \frac{1}{\Theta
    ( \theta) } \Theta( \theta ) = - \lambda^2. \label{eq:sep_var2} \\
  \end{cases}
\end{equation}
\end{document}
Stefan
LaTeX.org admin
User avatar
Stefan Kottwitz
Site Admin
Posts: 10321
Joined: Mon Mar 10, 2008 9:44 pm

How to number equations in cases.

Post by Stefan Kottwitz »

For the case that you would like to have each line within that cases environment numbered: you could use the cases package:

Code: Select all

\documentclass{article}
\usepackage{cases}
\begin{document}
\begin{numcases}{}
  \frac{1}{ T(t)} \partial_{tt} T(t) = - \lambda^2,  \\
    c^2  \frac{1}{R(r)} \partial_{rr} R(r) + \frac{1}{R(r)} \frac{1}{r}
    \partial_{r} R(r) + \frac{1}{r^2} \partial_{\theta \theta} \frac{1}{\Theta
    ( \theta) } \Theta( \theta ) = - \lambda^2. \label{eq:sep_var2}
\end{numcases}
\end{document}
Stefan
LaTeX.org admin
keepitcool
Posts: 2
Joined: Sat Feb 13, 2016 7:42 pm

Re: How to number equations in cases.

Post by keepitcool »

Thank you for the reply, it was really helpful!
Post Reply