# Numbering of Equations and Theorems in Appendix does not start from fresh

When my Appendix starts, the equations and theorems in it should start from (1) and not from the number which ended in the main paper. That is, if the last equation in main paper was numbered (7), then I expect the first equation in Appendix to be numbered (1) and not (8). Similarly, for the numbering of theorems too.

In short, I wish my theorems in Appendix to start from "Theorem 1." and the first equation in Appendix to be numbered with (1).

I am using overleaf.

I request for help.

Thanks

• Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
– Community Bot
Commented Sep 14, 2021 at 4:50

With an up-to-date LaTeX (released 2020-10-01 or later) you can do it in the document preamble:

\documentclass{article}
\usepackage{amsmath}

\newtheorem{theorem}{Theorem}

\setcounter{equation}{0}%
\renewcommand{\theequation}{\thesection.\arabic{equation}}%
\setcounter{theorem}{0}%
\renewcommand{\thetheorem}{\thesection.\arabic{theorem}}%
}

\begin{document}

\section{Text section}

Some text.

\begin{theorem}
Pigs can fly.
\end{theorem}

An equation
$$1+1=2$$

\appendix

\section{Appendix section}

Some text.

\begin{theorem}
Pigs cannot fly.
\end{theorem}

An equation
$$1+1=2$$

\end{document}


With an older LaTeX, you can do it by moving the code after \appendix

\documentclass{article}
\usepackage{amsmath}

\newtheorem{theorem}{Theorem}

\begin{document}

\section{Text section}

Some text.

\begin{theorem}
Pigs can fly.
\end{theorem}

An equation
$$1+1=2$$

\appendix
\setcounter{equation}{0}
\renewcommand{\theequation}{\thesection.\arabic{equation}}
\setcounter{theorem}{0}
\renewcommand{\thetheorem}{\thesection.\arabic{theorem}}

\section{Appendix section}

Some text.

\begin{theorem}
Pigs cannot fly.
\end{theorem}

An equation
$$1+1=2$$

\end{document}