# Cleveref - use both abbreviations and full reference names

I was wondering if it is possible to use both options (full reference name and abbreviations of reference names) in the cleveref package.

The case at hand is a document containing both references within text mode and references above = signs in math mode (e.g. in the example below). Ideally, I would like to use the full reference name (Theorem 0.1) in text mode, while using the abbreviated version (Thm. 0.1 or something like that) in cases like $\stackrel{\text{\Cref{th:theorem1}}}{=}$ for reasons of the space required for printing the reference above the = sign.

Does anyone know how to achieve this?

Below is a minimal working example:

\documentclass[a4paper,english]{scrbook}
\usepackage{amsthm}
\usepackage{amsmath}

\newtheorem{theorem}{Theorem}[chapter]
\newtheorem*{theorem*}{Theorem}

\begin{document}
\begin{theorem}\label{th:theorem1}
If $A$ is closed, then $A$ is closed.
\end{theorem}
\begin{proof}
\end{proof}

In \Cref{th:theorem1} we have seen that ...

$$a + b \stackrel{\text{\Cref{th:theorem1}}}{=} 0\,.$$
\end{document}

• The solution presented in cleveref — using both abbreviated and full form references? should also work in your case. Please also be aware, that \Cref will always result in the non-abbreviated form. Dec 1 '19 at 10:53
• Thank you for pointing that out! I have modified so that it works with both \Cref and \cref in abbreviated and non-abbreviated form. Dec 1 '19 at 11:16

Thanks to leandriis for giving the hint: cleveref -- using both abbreviated and full form references?

This modified solution works for both \Cref and \cref in abbreviated and non-abbreviated form:

\usepackage[nameinlink, noabbrev]{cleveref}

\DeclareRobustCommand{\abbrevcrefs}{%
\Crefname{theorem}{Thm.}{Thms.}%
\Crefname{example}{Ex.}{Exs.}%
\crefname{equation}{eqn.}{eqns.}%
}

\DeclareRobustCommand{\Cshref}[1]{{\abbrevcrefs\Cref{#1}}}
\DeclareRobustCommand{\cshref}[1]{{\abbrevcrefs\cref{#1}}}


I hope it will be helpful.