Possible Duplicate:
How to cross-reference theorems with “Theorem”?
I have had this doubt for quite a long time but I am unable to work out a way. This problem concerns referring back to definitions, equations, theorems, lemmas in a mathematical write-up of any sort:
Please consider the following code:
\documentclass{amsart}
\usepackage{amsthm}
\newtheorem{defn}{Definition}
\newtheorem{thm}{Theorem}
\begin{document}
This is an example.
\begin{defn} \label{ring}
A commutative ring $R$ with unity is an abelian group with a binary operation $\cdot $
(frequently referred to as multiplication) which is associative, commutative and has an identity.
\end{defn}
\begin{thm} \label{0pro}
$0_R \cdot r = 0_R$ for all $r \in R$
\end{thm}
The proof of Theorem \ref{0pro} follows from definition \ref{ring}.
\end{document}
In referring back to a theorem, one has to say Theorem \ref{0pro}. My doubt is that it must be possible to automise this: as in every instance of a reference to a theorem must come automatically as Theorem <blah> instead of having to manually type this in.
Example: \ref{0pro} must print Theorem 1 and similar goes for others.
Is there a hack or a work around?
\namerefofhyperrefor\crefofcleverefpackage for this purpose. – bodo Jul 21 '12 at 09:46\usepackage{cleveref}to your preamble after loadingamsthm, but before issuing\newtheorem. In the text body, use\crefinstead of\ref. – lockstep Jul 21 '12 at 09:52cleverefis one of the packages that must be loaded afterhyperref. – lockstep Jul 21 '12 at 09:57