Sometimes it is hard to keep track of labels, particularly in large documents with many figures, tables or equations. Unless you remember all label names by heart, you will likely scroll up and down till you find the particular position in the text where the label is defined. The showlabels package provides a convenient way for keeping track of label names. It displays them in the PDF next to the text element it was defined for.
Usage is straight forward, it is sufficient to load the package in the preamble of the document:
\usepackage{showlabels}
By default, labels are printed to the outer margin. Options are available to display labels in the inner/left/right margin or inline. See the package documentation for more details.
Furthermore, you can print arguments to pretty much any command. This is particularly useful for cite. See below for an example.
\showlabels{cite}
Obviously, this is not something you want in the final document. Either just delete all the code related to the package or better, use the final option to mute it:
\usepackage[final]{showlabels}
Example: figure
Example: equation
Example: enumerate
Example: cite
\documentclass{article}
\usepackage{showlabels, bibentry}
\usepackage{blindtext}
\showlabels{cite}
\begin{filecontents}{publication.bib}
@article{lamport1986latex,
title={LaTEX: User's Guide \& Reference Manual},
author={Lamport, L.},
year={1986},
publisher={Addison-Wesley}
}
\end{filecontents}
\begin{document}
\blindtext
\section{Figure}
\begin{figure}[ht]
\centering
\rule{4cm}{3cm}
\caption{default}
\label{fig:default}
\end{figure}
\section{Equation}
\begin{equation}\label{eq:default}f(x)=ax^2+bx+c\end{equation}
\section{Enumerate}
\begin{enumerate}
\item First item\label{itm:first}
\item Second item\label{itm:second}
\end{enumerate}
\section{Citation}
\cite{lamport1986latex}\\
\nobibliography{publication}
\end{document}
First seen here.

October 2nd, 2012 at 5:08 pm
Thanks for this tip. I hope I see this article two years ago:-)
October 2nd, 2012 at 7:19 pm
Good package! – I wish I had known about this yesterday, my document was getting jumbled and mixed up with table, equation, and figure references.
October 3rd, 2012 at 2:08 am
I’m trying to use this package with the memoir class and it doesn’t work. Do you have any idea about implementing this package in the class memoir?
October 3rd, 2012 at 5:48 am
Hi Charlie,
Interesting! I briefly tried to reproduce the issue and it works for me (see code below). Please provide a minimal working example and I’ll try to help you.
Thanks, Tom.
\documentclass{memoir} \usepackage{showlabels} \begin{document} \begin{figure}[ht] \centering \rule{4cm}{3cm} \caption{default} \label{fig:default} \end{figure} \end{document}March 21st, 2013 at 3:10 pm
Thanks a lot, I knew there had to be a way to do this.
March 21st, 2013 at 3:21 pm
For those who have long labels, you might want to rotate them to avoid going over the edge of the document:
\usepackage{rotating} \usepackage[right]{showlabels} \renewcommand{\showlabelsetlabel}[1] {\begin{turn}{90}\showlabelfont #1\end{turn}}March 23rd, 2013 at 6:57 am
Cool, thanks for this! Tom.