Math & Sciencetwo different align environments - eqn numbering

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
zzziop
Posts: 7
Joined: Wed Mar 18, 2009 3:19 pm

two different align environments - eqn numbering

Post by zzziop »

Hello,

I have two different align environments, where I would like the equation numbering to start over in the 2nd one. However, the equation number just picks right back up from the last number in the first environment. Any ideas?

Here is my code:

Code: Select all

\begin{align}
F = f_1+f_2+f_3+…+f_n
\intertext{can be written as}
\sum_1^n{f_i}
\end{align}

\begin{align}
(a+b)^3 &= (a+b)^2(a+b)\\
&=(a^2+2ab+b^2)(a+b)\\
&=(a^3+2a^2b+ab^2) + (a^2b+2ab^2+b^3)\\
&=a^3+3a^2b+3ab^2+b^3
\end{align}

Thanks in advance.

Recommended reading 2024:

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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

two different align environments - eqn numbering

Post by localghost »

For the first equation system you can use the align* environment which leaves you with unnumbered equations.


Best regards
Thorsten¹
zzziop
Posts: 7
Joined: Wed Mar 18, 2009 3:19 pm

Re: two different align environments - eqn numbering

Post by zzziop »

I'm not sure that would solve my problem. If I used {align*} in the first environment, that would get rid of the equation numbering there; however, I do want the equations to be numbered in both sections, and I just want the 2nd section to start over and number from 1 again...
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

two different align environments - eqn numbering

Post by localghost »

Obviously I understood you wrong. You only have to reset the equation counter right after the first equation system.

Code: Select all

\setcounter{equation}{0}
Note that referencing will not be possible anymore and hyperref (if used) may give warnings.
zzziop
Posts: 7
Joined: Wed Mar 18, 2009 3:19 pm

Re: two different align environments - eqn numbering

Post by zzziop »

Thanks, that works perfectly!
Post Reply