Math & Sciencethe equation number

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
mathselpi
Posts: 30
Joined: Wed Dec 31, 2008 4:50 pm

the equation number

Post by mathselpi »

hi!
I want to make that the example below

... (2.1)

... (2.2)

... (3.1)

... (3.2)

etc.

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
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Re: the equation number

Post by gmedina »

Which document class are you using? From the title of the thread, you are talking about the counter for equations, right? In (2.1) the "2" represents the number of the current chapter, section? and I guess that the "1" will represent the first equation inside that sectional unit. Is that correct?

Please try to describe your requests more explicitly, and including all the relevant information.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
mathselpi
Posts: 30
Joined: Wed Dec 31, 2008 4:50 pm

the equation number

Post by mathselpi »

Code: Select all

\documentclass[12pt,a4paper,oneside]{report}
\usepackage{graphicx}
\usepackage{amsmath}
\begin{document}
\renewcommand{\theequation}{1.\arabic{equation}}
\begin{eqnarray}
a
\end{eqnarray}
\begin{eqnarray}
b
\end{eqnarray}
\renewcommand{\theequation}{2.\arabic{equation}}
\begin{eqnarray}
c
\end{eqnarray}
\begin{eqnarray}
d
\end{eqnarray}

\end{document} 
I want to make
c (2.1)

d (2.2)

instead of

c (2.3)

d (2.4)

thanks
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

the equation number

Post by gmedina »

Simply reset the counter:

Code: Select all

\documentclass[12pt,a4paper,oneside]{report}
\usepackage{graphicx}
\usepackage{amsmath}
\begin{document}
\renewcommand{\theequation}{1.\arabic{equation}}
\begin{align}
a
\end{align}
\begin{align}
b
\end{align}
\renewcommand{\theequation}{2.\arabic{equation}}
\setcounter{equation}{0}
\begin{align}
c
\end{align}
\begin{align}
d
\end{align}

\end{document}
eqnarray shouldn't be used anymore: Avoid eqnarray!
1,1,2,3,5,8,13,21,34,55,89,144,233,...
mathselpi
Posts: 30
Joined: Wed Dec 31, 2008 4:50 pm

Re: the equation number

Post by mathselpi »

thank you very much
Post Reply