How to strip “eq.” from cleveref?

How can I make cleveref output (1) instead of eq. (1) when referencing equations only?

• Just use \eqref (needs amsmath). – egreg Jul 2 '13 at 20:42
• Um..., I might want to change my style later, isn't that what cleveref is meant for? Just want to be consistent. Thanks. – Andriy Drozdyuk Jul 2 '13 at 20:50

Use \crefformat (notice that the same formatting can be achieved simply using \eqref from amsmath):

\documentclass{article}
\usepackage{amsmath}
\usepackage{cleveref}

\crefformat{equation}{(#2#1#3)}

\begin{document}
\ref{eq:test}\eqref{eq:test}\cref{eq:test}

$$\label{eq:test} a=b.$$

\end{document}


You might also want to use a similar formatting for a range:

\crefrangeformat{equation}{(#3#1#4) to~(#5#2#6)}


and for multiple references, with the "and" between them (e.g. (1), (2) and (3)).:

\crefmultiformat{equation}{(#2#1#3)}%
{ and~(#2#1#3)}{, (#2#1#3)}{ and~(#2#1#3)}


NOTE: In crefmultiformat spaces are important.

Both examples were taken from official doc, and eq part simply removed.

• Ah, great tip on range format. I missed that one. Thanks a bunch! – Andriy Drozdyuk Jul 2 '13 at 20:57
• Added crefmultiformat to your answer, hope you don't mind :-) – Andriy Drozdyuk Jul 6 '13 at 1:14
• @drozzy by no means :-) Thanks for the valuable addition. – Gonzalo Medina Jul 6 '13 at 3:39

Even simpler, just put

\crefname{equation}{}{}


in your preamble. Then all the formats get defined for you automatically. (No need to redefine all of \crefformat, \crefmultiformat, \crefrangeformat, \labelcrefformat!)

These days, cleveref is...clever enough to omit the usual non-breaking space after the cross-reference name if you define an empty name.