# How can I automatically identify certain boxes in the \tracingoutput log?

I have a program that is automatically generating a tex file describing a document. I want to be able to record the position and page number where a few boxes were ultimately laid out.

Is there any simple way to match up parts of the document with the matching part of the log file created by \tracingoutput? For example, is it possible to name boxes somehow and have those names show up in the log?

Are you sure you want \tracingall, You can be more specific in what you put out, eg

\documentclass{article}
\loggingoutput\scrollmode
\begin{document}

\sbox0{\parbox{2cm}{on two three four five six$a=2$seven}}

\typeout{my first box looks like this:}
\showbox0 \usebox0

\sbox0{\parbox{4cm}{on two three four five six$a=2$seven}}

\typeout{my second box looks like this:}
\showbox0 \usebox0

\end{document}


which produces

my first box looks like this:
> \box0=
\hbox(33.97223+28.97221)x56.9055
.\mathon
.\vbox(33.97223+28.97221)x56.9055
..\hbox(6.94444+0.0)x56.9055, glue set 0.5633
...\hbox(0.0+0.0)x0.0
...\OT1/cmr/m/n/10 o
...\OT1/cmr/m/n/10 n
...\glue 3.33333 plus 1.66666 minus 1.11111
...\OT1/cmr/m/n/10 t


and

my second box looks like this:
> \box0=
\hbox(27.97223+22.97221)x113.81102
.\mathon
.\vbox(27.97223+22.97221)x113.81102
..\hbox(6.94444+0.0)x113.81102, glue set 4.2553fil
...\hbox(0.0+0.0)x0.0
...\OT1/cmr/m/n/10 o
...\OT1/cmr/m/n/10 n
...\glue 3.33333 plus 1.66666 minus 1.11111
...\OT1/cmr/m/n/10 t

• Ahh, cool. Thanks. I am not sure at all. I have used it a lot for writing papers, but have never attempted this kind of stuff. (I will accept in a couple of hours in case anyone else has suggestions, but it seems this should work nicely.) – Doug McClean Dec 17 '13 at 16:25