# Why does \ref only enter the numbers?

Is there way so that one can replace By Theorem \ref{theo1} by By \ref{theo1} without changing output in the following document:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

\usepackage{amsmath}

\newtheorem{theorem}{Theorem}

\begin{document}

\begin{theorem}\label{theo1}
I exist.
\end{theorem}

By Theorem \ref{theo1}, I exist.

\end{document}


The cleveref package provides the macro \cref, which does what you're looking for.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amsmath,amsthm}
\usepackage[noabbrev,capitalize]{cleveref}
\newtheorem{theorem}{Theorem}

\begin{document}
\begin{theorem}\label{theo1}
I think.
\end{theorem}
\begin{theorem}\label{theo2}
I think some more.
\end{theorem}

By \cref{theo1}, I exist.

By \cref{theo1,theo2}, I exist some more.
\end{document}

• Just ve aware if the problems regarding using shared counters – daleif Apr 12 '15 at 15:19