So I was wondering if pdflatex
was writing all the labels used from a main.tex
document.
When you're working on a hundred pages-long document like a phd dissertation, it is humanly impossible to remember all the references and point to them :0 !
I ran into
Tex editor able to recover all labels of a document
and How to get a list of all the labels in a LaTeX document in WinEdt
But I figured one may also wish to get one's labels without scrolling tex code, switching editor nor move to windows. That got me blowing some dust off the manual, and produce the small script below, but still...
The open question:
Does tex not provide a way to do that??
.aux
file in lines beginning\newlabel
. The mechanism is described in this answer. So looking for all instances of\newlabel
in the.aux
file will give you the information you are looking for. There is also a packageshowlabels
that will print out the information in the margin of your output. – barbara beeton Jan 23 '20 at 19:05main.aux
, and running through the.tex
source has the advantage providing some context. Packageshowlabel
looks good :) I'd also like avoiding scrolling over and over again through the whole pdf when working on a specific part though... – shevket Jan 23 '20 at 19:39find
with the/V
switch: At a command promptfind /V "\\newlabel" myfile.aux > myfile.lab
. Load myfile.lab in separate window in you preferred est editor. If you have several aux-files, use afor %i in (*.aux) do find /V "\\newlabel" >>myfile.lab
-loop – Sveinung Jan 23 '20 at 20:44showlablels
is the opposition:-) don't forget to mention teshowkeys
package (which does the same thing:-) – David Carlisle Jan 23 '20 at 21:32grep
through the.aux
then you'd might as wellgrep
through all the*.tex
usingfind
! and I definitely prefer the ouput :) prints me directories, filenames, line numbers, context... – shevket Jan 24 '20 at 11:56