A method for re-indexing LaTeX files

Getting the Files

It will be necessary to download these files to your computer and put them
into a directory in your path.

How to use the program

The file that you should now run is called
scrub.bat, you can change the name if you want. Here is how it works.

You have to be a little careful how you number your
labels in the latex file. For example for lemmas's use a label like \label{l.abc}
and for theorems \label{t.cameron-martin} and for equations I use \label{e.123}
etc. It is important to have a prefix for each new environment. Otherwise the
label program may screw things up.

Here is how you use the program.

Run Latex on the file first two times. Make
sure there are no duplicate labels or undefined labels. (Say the file is
named bounds.tex.)

Run the batch file scrub.bat on the file (bounds.tex)
by typing: scurb bounds

The computer should respond:

The output files name
is BOUNDS.CNG
Use this file as the table when using the Scrublist program.
Do you want a numbering prefix? (Y/N)

You now must answer Y or N. If you answer N
jump to (#) below and while if you answer Y
you will see.

Enter an optional prefix for
numbering.

At this point you might enter bb (and then return)(#) You will see then see:

What the program has done

Run scrublst.exe on bounds.aux to produce a
``change'' file bounds.cng

Run filscrub.exe filscrub bounds.cng bounds.tex
bounds.ttt
The result it store the relabled TeX file in bounds.ttt

copy bounds.tex to bounds.tmp

copy bounds.ttt bounds.tex

del bounds.ttt

So the old tex file is now in bounds.tmp
The new relabeled tex file is again called bounds.tex

Remark: If you answered Y above then you
will see labels in the file like:

\begin{prop} \label{p.bb1.2} Let $X$ solve Eq. (\ref{e.bb1.3})

So all labels will be of the form {??.bb?.??}. If you
answered N above you would get instead:

\begin{prop} \label{p.1.2} Let $X$ solve Eq.
(\ref{e.1.3})

Hints

You may want to answer yes above and choose a prefix
like ``bb'' when you are going to merge two files together that have
conflicting labels. So you would run through the above procedure on one of
the files with a label prefix. Then merge the two files together and then run
through the routine on the merged file.

When I am writing I tend to just use very simple
labels like \label{e.a} and \label{t.1} etc. Then every once in a while I
run the above procedure to clean things up when it gets to messy. Then I go
back to using the simple labels for the new text that I am writing and look at
the hard copy when referring to previously defined labels.

Warning!! I have had
fairly good luck with this program but I take no responsibility if it
screws up your file. (So
always back up your
file before using this program on it. ) However you should be careful
with it. I always run latex on the relabeled file immediately after relabeling
to make the sure the references work out right. If they do not and the file is
messed up, the original file is stored in file.tmp , i.e. bounds.tmp in the
example above.