TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

While working on a document, it would be helpful if instead of a ? for unresolved references or citations the tag used in the \ref{thisthings} or \cite{Bloke1978} could appear instead.

Is there a package that turns on this behaviour?

share|improve this question
up vote 13 down vote accepted

Rather than redefining \cite or connected commands, one might consider using the showkeys package, that will print every key and mark every usage of \label so that, during document preparation, cross-references can be checked quite easily.

This has a drawback: line and page break can be different when using or not using the package. However, line and page break are not much of a concern when we are writing our manuscript. When finalizing the project just comment out the call to showkeys: the cross-references should be OK, at that point.

share|improve this answer
That is a more useful solution than just replacing the unresolved labels. Thanks! – Alex Feb 18 '12 at 22:46

Even if there is no such package, it's easy to modify the corresponding commands with the help of the etoolbox package. This may, however, fail if some package redefines the commands in an incompatible way.



\patchcmd{\@setref}{\bfseries ??}{[\texttt{#3}]}{}{%
  \GenericWarning{}{Failed to patch \protect\@setref}}
\patchcmd{\@citex}{\bfseries ?}{\texttt{\@citeb}}{}{%
  \GenericWarning{}{Failed to patch \protect\@citex}}



share|improve this answer
One might also consider the showkeys package. – egreg Feb 18 '12 at 11:16
@egreg: That's cool! Your comment should be an answer. – Andrey Vihrov Feb 18 '12 at 11:18
Adding to this MWE the package \usepackage{natbib} it does not work anymore. How has the \patchcmd for citex be modified? – Hotschke Jul 27 '15 at 9:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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