Take the 2-minute tour ×
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.

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

1 Answer 1

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

\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.

share|improve this answer

Your Answer

 
discard

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.