showbox in LaTeX

Not a first time when I need to trace a LaTeX layout by digging into the details, and again I've spend time remembering how to do it. Fixing the magic in writing.

First, content should be wrapped by a box:

... content ...

Now dump it into the log-file:


The non-obvious thing here is setting showboxdepth and showboxbreadth. For some reason, LaTeX disables box-printing by setting these values to -1. I don't know where from one could know about it.

Finally, return the box to the document:

Categories: TeX