Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question
1  
In my case, \usepackage{cleveref} caused that error. After removing that package, everything worked as expected. –  koppor Apr 1 at 9:29

1 Answer 1

up vote 7 down vote accepted

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

share|improve this answer
2  
I wouldn't use a number in the name of the type. This will break if some command try to use e.g. \thetheorem1. –  Ulrike Fischer Jul 27 '12 at 10:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.