1 Introduction to cleveref
The cleveref package, as the name suggests, is to be quoted wisely.
For example, when you define the label of a theorem (theorem) as \label{thm:firstTheorem}, you use
\Cref{thm:firstTheorem}
, Latex will display theorem xx, if you are using
\ref{thm:firstTheorem}
, Latex will only display xx, theorem needs to be added by yourself.
Cleveref is applicable to pictures, tables, theorems, lemmas, and algorithm environments.
2 cleveref use
The required package, the hyperref package must be defined in front of the cleveref package
\usepackage{hyperref}
\usepackage{cleveref}
Just use \Cref{tag} when quoting.
If the reference is theorem, and you don’t want it to automatically display theorem xx, but you want it to display the theorem xx, we can add
\crefname{theorem}{定理}{定理}
\crefname{lemma}{引理}{引理}
\crefname{definition}{定义}{定义}
\crefname{figure}{图}{图}
\crefname{table}{表}{表}
\crefname{algorithm}{算法}{算法}