Text FormattingEquation Numbering

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
chrisr34000
Posts: 10
Joined: Mon Aug 15, 2011 9:40 pm

Equation Numbering

Post by chrisr34000 »

Hello!

I'm having the following code:

Code: Select all

$&=& P(u+\displaystyle \sum_{k=1}^{n}(cY_{k}-X_{k})<0$ für ein $n \geq 1)$

}
$&=& P(\displaystyle \sum_{k=1}^{n}(X_{k}-cY_{k})>u$ für ein $n\geq 1)$
}

$&=& P(\displaystyle \sup_{n\geq 1}\sum_{k=1}^{n}(X_{k}-cY_{k})>u)$  &&  \text{ (1.1)}

&\Leftrightarrow\delta(u) =\ P(\sup_{n\geq 1}\sum_{k=1}^{n}(X_{k}-cY_{k})\leq u)

&=&\ P(\sup_{n\geq 1}R_{n}\leq u)\ \square
As you can see, I have a block of equations here and I want to number the equation, where I have \text{(1.1)} automatically with (1.1). The whole block is between "align" tags. However, the align command does not produce numbering for every line, like I was expecting it. I thought that these command, generates numbering for every line and then I just need to cross the other lines off with the \nonumber command. But align, doesn't produce here any kind of numbering.

Code: Select all

\begin{eqnarray}
produces the numbering at the last line only.

How would you fix this?

Thanks!
Last edited by chrisr34000 on Tue Aug 23, 2011 11:38 pm, edited 1 time in total.

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Equation Numbering

Post by Stefan Kottwitz »

Hi,

have a close look at the align environment syntax. This could be a start for you:

Code: Select all

\begin{align}
  &= P(u+\displaystyle \sum_{k=1}^{n}(cY_{k}-X_{k})<0 \text{ für ein } n \geq 1)\nonumber\\
  &= P(\displaystyle \sum_{k=1}^{n}(X_{k}-cY_{k})>u \text{ für ein } n\geq 1)\nonumber\\
  &= P(\displaystyle \sup_{n\geq 1}\sum_{k=1}^{n}(X_{k}-cY_{k})>u)\\
  &\Leftrightarrow\delta(u) =\ P(\sup_{n\geq 1}\sum_{k=1}^{n}(X_{k}-cY_{k})\leq u)\nonumber\\
  &=\ P(\sup_{n\geq 1}R_{n}\leq u)\ \square\nonumber
\end{align}
Stefan
LaTeX.org admin
chrisr34000
Posts: 10
Joined: Mon Aug 15, 2011 9:40 pm

Equation Numbering

Post by chrisr34000 »

Excellent, that worked! Thanks again!

Is it possible to use the

Code: Select all

align*
command with some command where I can specify which line to be numbered? A

Code: Select all

numberthis
command? It would be easier than using a the

Code: Select all

nonumber
command over and over again...
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Equation Numbering

Post by Stefan Kottwitz »

If you would like to use just one number for an aligned multiline environment, you could use a split environment inside an equation environment, for getting a vertically centered number, such as:

Code: Select all

\begin{equation}
\begin{split}
  &= P(u+\displaystyle \sum_{k=1}^{n}(cY_{k}-X_{k})<0 \text{ für ein } n \geq 1)\\
  &= P(\displaystyle \sum_{k=1}^{n}(X_{k}-cY_{k})>u \text{ für ein } n\geq 1)\\
  &= P(\displaystyle \sup_{n\geq 1}\sum_{k=1}^{n}(X_{k}-cY_{k})>u)\\
  &\Leftrightarrow\delta(u) =\ P(\sup_{n\geq 1}\sum_{k=1}^{n}(X_{k}-cY_{k})\leq u)\\
  &=\ P(\sup_{n\geq 1}R_{n}\leq u)\ \square
\end{split}
\end{equation}
Then there's no need for \nonumber, further it's also centered if there's an even number of lines.

Stefan
LaTeX.org admin
Post Reply