28

Working with documents with huge amount of equations it becomes cumbersome to go back and remind yourself what you labeled a certain equation to (I try to name them in a smart way, but there are too many).

Is there a convenient way to have equations print the label along with the tag/number, so that I can easily check the label in the compiled document?

Something like this would be perfect:

x = y               (14.1) eq:my_label
35

Use the showkeys package (it's compatible with amsmath):

enter image description here

\documentclass{article}
\usepackage{amsmath}% http://ctan.org/pkg/amsmath
\usepackage{showkeys}% http://ctan.org/pkg/showkeys
\begin{document}
\section{A section} \label{sec:label}
It is clear that
\begin{equation}
   a = b \label{eq:my_label}
\end{equation}
so, from~\eqref{eq:my_label} in Section~\ref{sec:label}, we see that\ldots
\end{document}​

It highlights the use of \label, \ref, \pageref, \cite and \bibitem within your document by means of an "overlay" so as to not affect the typesetting of the document.

| improve this answer | |
27

The refcheck package does something like that. Questionmarks around the label indicate that you haven't referred to that equation yet. (You have to compile twice for this check to work.)

sample output with refcheck and a couple of equations

\documentclass{article}
\usepackage{amsmath}
\usepackage{refcheck}
\usepackage{kantlipsum}

\begin{document}
\kant[1]
\begin{equation}\label{eq:1}
a = b
\end{equation}
\kant[2]
\begin{gather}
a = b \label{eq:2}\\
c = d \label{eq:3}
\end{gather}

See \eqref{eq:1}.
\end{document}
| improve this answer | |
10

showkeys package does exactly this.

| improve this answer | |
7

Another package providing similar functionality is showlabels

| improve this answer | |
2

All three packages suggested above:

  • showlabels
  • showkeys
  • refcheck

worked for me. Yet, I had to increase the right margin such that the printed labels are not cut off \usepackage[a4paper,left=1cm,right=4cm,top=1cm,bottom=1cm]{geometry}.

| improve this answer | |
  • This does have the desired result of showing the full label, but be aware that it will change the line breaking, so the original page geometry should be restored before trying to produce the final version of your document. (On the other hand, since breaking wide display math to fit is often a problem, working with a narrower line width may be an advantage.) – barbara beeton Jan 9 at 18:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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