# Tabulating all labelled equation numbers with their labels in latex

Is there any way in Latex to collect the labels for references from a document in a table? I'm writing a long document but would like to collect together my references of various kinds (i.e. equations, theorems, figures etc) in tables in a secondary document to help me with document maintenance.

I'd like this process to be automatic, i.e. that the referencing would update with every build (of the reference document) using the aux file of the main document. I'm aware (see this question) of the xr package, which should take care of defining the references for me in the secondary document.

What I'd like to know is how to build a table, say, of all equation numbers that have a label, along with the label, in each case - also how to adapt the code for figures, theorems etc if it's not immediately obvious (I'm not that bright when it comes to all things latex)

-

The best approximation to your wish that I can think of is to use the showkeys or showlabels packages, that print labels near the number they refer to. I believe that this is better than having the labels collected somewhere else.

You can also do what I found here

After a LaTeX run over texfile.tex, do

grep newlabel texfile.aux > labels.tex


You'll prepare also a file called label_main.tex that has

\documentclass{article}
\renewcommand\newlabel[2]{#1 & \newsublabel#2\\}
\newcommand\newsublabel[2]{#1 &  #2}

\begin{document}

\begin{tabular}{lrr}
Label & ref & page \\\hline
\input{labels.tex}
\end{tabular}

\end{document}


Running LaTeX over this file will produce the list of labels.

-