3

I'm trying to use only one counter for theorems, lemma etc. Normally my code should work but I got a mistake

"Latex error : no counter 'l' defined".

My guess is that I probably use a package which is not compatible with this counter but I'm not sure which one. Thanks in advance.

Here is my code :

\documentclass[10pt]{article}
\usepackage[utf8]{inputenc}
\title{}
\author{}
\date{}
\usepackage{amsfonts}
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{mathrsfs} 
\usepackage{ amssymb }
\usepackage{cleveref}
\usepackage[margin=1in,footskip=0.25in]{geometry}
\usepackage{hyperref}  
\newtheorem{thm}{Theorem}
\newtheorem{lemma}[thm]{Lemma}
\newtheorem{corollary}{Corollary}
\newtheorem{remark}{Remark}
\newtheorem{proposition}{Proposition}
\newtheorem{example}{Example}
\renewcommand*{\proofname}{Proof}
\newtheorem{definition}{Definition}
\begin{document}
\begin{lemma}
test
\end{lemma}
\end{document}
0

1 Answer 1

5

The hyperref package is loaded here after cleveref, which confuses the counter and cross-reference system.

Using the correct load order hyperrefcleveref solves this problem.

\documentclass[10pt]{article}
\usepackage[utf8]{inputenc}
\title{}
\author{}
\date{}
\usepackage{amsfonts}
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{mathrsfs} 
\usepackage{ amssymb }
\usepackage[margin=1in,footskip=0.25in]{geometry}
\usepackage{hyperref}  
\usepackage{cleveref}
\newtheorem{thm}{Theorem}
\newtheorem{lemma}[thm]{Lemma}
\newtheorem{corollary}{Corollary}
\newtheorem{remark}{Remark}
\newtheorem{proposition}{Proposition}
\newtheorem{example}{Example}
\renewcommand*{\proofname}{Proof}
\newtheorem{definition}{Definition}
\begin{document}
\begin{lemma}
test
\end{lemma}
\end{document}
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .