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)

1 Answer 1


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

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


Label & ref & page \\\hline


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


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.