1

I would like the equation numbers to run through chapters and reset at a new part. I have tried this but it doesn't seem to work. I have tried the following shown below however it still resets with the chapter.

\documentclass{report}

\usepackage{chngcntr}

\renewcommand{\theequation}{\Roman{part}~--~\arabic{equation}}
\counterwithin*{equation}{part}


\begin{document}

\part{one}

\chapter{one one}
\begin{equation}
    1+1=2
\end{equation}

\chapter{two two}
\begin{equation}
    1+1=2
\end{equation}

\part{two}

\chapter{one one}
\begin{equation}
    1+1=2
\end{equation}

\chapter{two two}
\begin{equation}
    1+1=2
\end{equation}
\end{document}

1 Answers1

4

\counterwithin{equation}{part} does not remove the equation counter from the chapter reset list. It must be kicked out explicitly with

\counterwithout{equation}{chapter}.

The counter formatting \theequation should be changed afterwards then, since \counterwithout{equation}{chapter}. Or use \counterwithout*{equation}{chapter}

Here's the (modified) MWE:

\documentclass{report}

\usepackage{chngcntr}

\counterwithout{equation}{chapter}
\counterwithin*{equation}{part}

\renewcommand{\theequation}{\Roman{part}~--~\arabic{equation}}

\begin{document}

\part{one}

\chapter{one one}
\begin{equation}
    1+1=2
\end{equation}

\chapter{two two}
\begin{equation}
    1+1=2
\end{equation}

\part{two}

\chapter{one one}
\begin{equation}
    1+1=2
\end{equation}

\chapter{two two}
\begin{equation}
    1+1=2
\end{equation}
\end{document}

enter image description here