TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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)

share|improve this question
up vote 1 down vote accepted

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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