GeneralEquation numbering problem

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
amadsen
Posts: 3
Joined: Mon Mar 24, 2008 8:22 pm

Equation numbering problem

Post by amadsen »

Hi

I have a problem with the equation numbering of my document.
At some point in my document, the counter {equation} will not "update" and the equations are all numbered (8.0), (8.0)...

I am using \renewcommand{\theequation}{\arabic{section}.\arabic{equation}} and have been setting the counter to zero before each section by \setcounter{equation}{0}.

I have also tried to use the \numberwithin{equation}{section} instead, but it gives the same result. No "update" of the equation number...


Can anyone help me on this topic?



Kind regards
Andy

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 problem

Post by Stefan Kottwitz »

Hi Andy,

I don't see the problem in the code snippets that you posted.
Can you provide a minimal working example that shows the problem?

Stefan
amadsen
Posts: 3
Joined: Mon Mar 24, 2008 8:22 pm

Re: Equation numbering problem

Post by amadsen »

Hi Stefan_K

It will be rather difficult to make a working example with the error, since it is working fine for the first 7 sections.

I am using
\begin{eqnarray}
math..
\end{eqnarray}

as the last working and right numbered equation. All equations after this gets the number "0". Is there an issue using eqnarray togheter with the command \setcounter{equation}{0}? My equations are quite long, so I have to use eqnarray to breake them in pieces.


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

Equation numbering problem

Post by gmedina »

Without a MWE it can be very difficult to provide effective help; however, you should not use the eqnarray environment anymore (the reasons can be found in l2tabu). You can use the align environment instead, or any of the the equation-like environments provided by the amsmath package (user guide).
1,1,2,3,5,8,13,21,34,55,89,144,233,...
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Re: Equation numbering problem

Post by Stefan Kottwitz »

Hi Andy,

I completely agree with gmedina: you should use environments of amsmath. He gave the link to the user guide, just have a look: amsmath is highly recommendable.

If you want to create an mwe: make a copy of your document, reduce it step by step, that helps to extract the problem. If there are a lot of sections, no problem, empty the contents of the sections. Narrow it down, encircle it. We cannot guess, what code you wrote, we should have a look to it. The less, the better - we don't need content, just code.

Stefan
amadsen
Posts: 3
Joined: Mon Mar 24, 2008 8:22 pm

Re: Equation numbering problem

Post by amadsen »

Hi Stephan_K and gmedina


Thanks a lot for the help :)
The equnarray was the problem. After i removed them and replaced them with \begin{equation}\begin{split} the numbering worked again.

Thanks again for the quick responses!!


\Andy
Post Reply