Equation numbers messed up
LaTeX is including the section number because you told it to do so :-) In the cited post, it appears you're using \numberwithin{equation}{section}
which precisely means:
- reset equation numbering at each section;
- include the section number in the equation number.
This command is effective for the rest of the document (hence for your second included article). You can switch back to per-chapter numbering by issuing \numberwithin{equation}{chapter}
just before including this article (again, this will possibly change equation numbering for all future included articles).
Warning the above solution doesn't work as advertised unless you add \@removefromreset{equation}{section}
every time you use \numberwithin{equation}{chapter}
. The package remreset
is needed for this. (Precision added after reading the comments by Willie Wong and his answer (which works too).)
Clarification You need to make sure @
is a letter when using \@removefromreset
, so the complete invocation looks like \makeatletter\@removefromreset{equation}{section}\makeatother
. (Imported from the comments for the sake of readability.)
Looks like \numberwithin
is not meant to be used the way you are trying to use it. (I'm surprised too!) The problem is that it essentially does two things:
- Calls
\renewcommand*\the<slave counter>{\the<master counter>.\arabic{slave counter}}
- Calls
\@addtoreset{<slave counter>}{<master counter>}
The second one is what change the numbering. Notice that it is "addtoreset". Which means that it will make the increment operation on the master counter trigger a reset of the slave counter. So after calling \numberwithin{equation}{section}
, the trigger has been laid. And a second call of \numberwithin{equation}{chapter}
does not remove the previous trigger. Therefore the equation
counter will still be reset everytime the section
counter increases.
So much for why it does what you see that it does. For a solution, clearly you must stop using the convenient \numberwithin
command. A substitute is the \counterwithin
and \counterwithout
commands provided by the chngcntr
package.
So you should define, in your preamble, the following commands:
\usepackage{chngcntr}
\newcommand*\startappendixeqnumbering{%
\counterwithout{equation}{chapter}%
\counterwithin{equation}{section}%
\renewcommand*\theequation{\thechapter.\thesection.\arabic{equation}}}
\newcommand*\startnormaleqnumbering{%
\counterwithout{equation}{section}%
\counterwithin{equation}{chapter}%
\renewcommand*\theequation{\thechapter.\arabic{equation}}}
\counterwithin{equation}{chapter} %Set the default
And call \startappendixeqnumbering
before the first appendix and \startnormaleqnumbering
after the last appendix, before the start of the next chapter.