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

When writing documents, I consider it to be necessary that all figures and tables are referenced (\ref) in the text, whether or not I've remembered to \label them. LaTeX does not currently warn if a figure or table is not referenced. Is there a way to ensure that this is flagged up as a warning?

Note that I am specifically concerned about figures and tables, not chapter or section headings; it will be no good looking just at \labels that don't have an associated \ref.

In other words, it should report boo and not report bla in the following MWE:

In Section~\ref{bla} we do something.
share|improve this question
for anyone wondering about cleveref, see Making refcheck work with cleveref – cmhughes Dec 6 '13 at 20:58
up vote 50 down vote accepted

Use the package refcheck. It is

Intended to check references in a document, looking for numbered but unlabelled equations, for labels which are not used in the text, for unused bibliography references.

Note that it checks for labels that are not used in the text but not for tables and figures that are not labelled. Thus if you got a table or figure without a label you'll not get warned. If you compile the following you'll get a demonstration of its core features (the idea for this is from the package's excellent demo):




\begin{equation}\label{eq:1}% Labelled and referred to


\begin{equation}\label{eq:2}% Labelled but not referred to

\begin{equation}% Not labelled nor referred to

1 & 2 \\
3 & 4 \\
\caption{Numbers}\label{tab:1}% Labelled but not referred to

\begin{figure}[h]\label{fig:1}% Labelled but not referred to


The last two equations will be marked by "?" in the output because they're not labelled and referred to. The table and figure will be marked by "?" because they're labelled but not referred to. Also the .log file will contain:

 Unused label `eq:2' on page 1
 Unlabelled equation (3) on page 1
 Unused label `tab:1' on page 1
 Unused label `fig:1' on page 1

Note that refcheck should be loaded after the ams packages and the hyperref package.

Relatedly you may also want to check for duplicate labels.

share|improve this answer
Fantastic, thanks for the quick and great answer. – Bill Cheatham Aug 15 '11 at 10:58
@BillCheatham I've updated my answer with a better example and a note on it not warning for figures and tables that are not labelled (it only warns for tables and figures that are labelled but not referred to). – N.N. Aug 15 '11 at 11:11

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.