0

I'm trying to remove unused labels from my latex document. I realize that this question has been addressed before. However, it doesn't answer my query, because the package refcheck is not compatible with cleverer, which is what I have used in my document. Hence, recheck is declaring all labels unused in my document.

EDIT: The solution here, written for the explicit purpose of making refcheck compatible with cleveref, doesn't work for me either. Labels for theorems and sections are recognized, but labels for equations are not.

An example from my code would be:

\documentclass{article}
\begin{document}
\begin{equation}
\label{eq1} 
a=b
\end{equation}
Refer to \cref{eq1}
\end{document}

refcheck claims that that eq1 is an unused label.

  • Did you check https://tex.stackexchange.com/questions/87610/making-refcheck-work-with-cleveref as well? – Marijn Feb 18 '22 at 14:13
  • I hadn't. I just used the method explained there, and it still is not working for me. I am getting error messages for labels that I have used in the document. – Ryan Hendricks Feb 18 '22 at 14:23
  • Then please add the code for a small but complete document to your question with one or two labels and the \refcheckize parts from the other question and mention which error messages you get with that document. – Marijn Feb 18 '22 at 14:26
  • @Marjin- I've added more context. – Ryan Hendricks Feb 18 '22 at 14:36
  • @fierydemon: are you looking for a solution employing latex-specific tools? Otherwise there's always the option to grep \ref (and the like) with your latex editor or a good text editor would do; a couple of regex searches would do... – marquinho Feb 18 '22 at 14:45
  • @fierydemon your update is helpful (mentioning that the problem is specifically with equations) but still your question would be much easier to answer if you can add a small document (with some equation labels and references) that allows to reproduce the problem easily. – Marijn Feb 18 '22 at 15:02
  • @Marijn- Thank you. I have now added a model snippet of code. – Ryan Hendricks Feb 18 '22 at 15:07
  • 1
    refcheck is basically stale since 2004. The author has had many years to upgrade it in order to support cleveref, but doesn't seem interested in doing it. – egreg Feb 18 '22 at 15:14
  • @fierydemon -- The requested code should begin with \documentclass and end with \end{document}. That way, no guessing is necessary on the part of potential helpers. – barbara beeton Feb 18 '22 at 15:17
  • 1
    If I apply \refcheckize{\cref} as suggested in my answer to the linked question, I have no problem. – egreg Feb 18 '22 at 15:17
  • What is that "cleverer" you mentioned in your question?
  • If you use \cref, you should have a \usepackage{cleveref} in the preamble.
  • If you want to use the refcheck package, you need a \usepackage{refcheck} in the preamble.
  • \refcheckize{\cref} from egreg's answer to https://tex.stackexchange.com/q/87610 makes refcheck aware of \cref (as pointed out in egreg's comment).
  • – Stephen Jun 14 '23 at 08:50