[Tex/LaTex] No Counter Theorem1 is defined

counterserrorsnumberingtheorems

I got an exception in the following latex code: "No Counter Theorem1 is defined", what is the problem?

\documentclass[conference]{IEEEtran}

\newtheorem{definition}[theorem1]{Definition}
\begin{document}

\title{Title}

\maketitle

\begin{abstract}
%\boldmath
The abstract goes here.
\end{abstract}




\section{Introduction}
\begin{definition}[dd]
sdfa
\end{definition}


\end{document}

Best Answer

You have declared a new theorem type "Definition" which uses the counter of the theorem type "theorem1" -- but such a type hasn't been declared. The following works:

\documentclass[conference]{IEEEtran}

\newtheorem{theorem1}{Special Theorem}
\newtheorem{definition}[theorem1]{Definition}

\begin{document}

\section{Introduction}

\begin{theorem1}
foo
\end{theorem1}

\begin{definition}[dd]
sdfa
\end{definition}

\end{document}

enter image description here

Related Question