# Using showkeys and cleveref together

I'd like to use showkeys to show me the labels of my definitions (this works) and the labels of the used references (this does not work). The reason for the latter problem is that I use the cleveref package, i.e. \Cref{thm:something} instead of \ref{thm:something}. Changing all \Cref to \ref helps, but I'd like to stick to \Cref.

\documentclass[12pt,a4paper]{scrbook}
\usepackage[]{showkeys}
\usepackage{cleveref}
\begin{document}
\chapter{A}
\label{cha:A}
\chapter{B}
In \Cref{cha:A} something was done.
In \ref{cha:A} something was done.
\end{document}


showkeys defines \SK@def to hook itself on to other commands, I think you want
\makeatletter

• Seems not to work for \cref{A,B} – user4514 Apr 1 '14 at 0:15
• @user4514 I just tried the analogous definition for cref and it worked for me: \SK@def\cref#1{\SK@\SK@@ref{#1}\SK@cref{#1}}% – David Carlisle Apr 1 '14 at 0:21