4

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}
3

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

enter image description here

\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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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