LaTeX Debugging – Visual Debugging of Lengths in Paragraphs and Environments

debugginglengths

During my searches, I found a couple of online images, which I doubt are produced with Latex – however, I found them immensely useful in understanding what is going on.

I'm pretty sure the images below were not produced automatically by latex – so I was wandering if there is a Latex package (or a method) – that would visualize demanded lengths with arrows (and possibly even length values?), like on the images below (apparently, adding them from web adds a copy on imgur; I've added the original links as well).

In the cases below, they are related to lists (enumerate/itemize) parameters – but I'd be interested in visualizing \parindent or \parskip in context of paragraphs as well.

Fig_enumerateS.jpg

listaparametrit.gif

listparams.png

Would there be anything out there that allows for similar visualization (possibly one that would work on a 'per page request' basis too; wouldn't want a 100 pg .pdf choke full with arrow vectors on every paragraph :))

Best Answer

One default package to display length is the package layouts. It produces black/white images with represented lengths.

For example the example below produces the following images for list-environments.

enter image description here

\documentclass{article}
\usepackage{layouts}
\begin{document}
\listdiagram
\end{document}

However the coloured images are probably made by packages like TikZ or PSTricks.