16

I always use something like \overfullrule=1mm when I am writing Latex documents. I do read all warnings regarding overfull \hboxes, but I still prefer the visual output that very clearly shows exactly which boxes are overfull.

Can I somehow have something similar for underfull \hboxes? Some kind of simple visual highlighting that shows exactly where in the final document I have those problematic lines of text?

I am using pdflatex in case it matters.

Jukka Suomela
  • 20,795
  • 13
  • 74
  • 91
  • I think various editors have options to present to you a parsed list of the over/underfull messages from the log and a click then puts you in the right part of the source. At least I seem to recall auctex was able to do so. That is not visual, but already better than reading the log manually. – Taco Hoekwater Oct 13 '10 at 19:40
  • When I get to the point in a paper where I'm fixing typographical errors, I use pdflatex file|egrep '(Over|Under)full' to find the locations I need to focus on. – TH. Oct 13 '10 at 19:47

2 Answers2

9

It's not possible in the general case, but you can visualise when underfull boxes occur by taking apart a paragraph and measuring the badness of the individual lines of the paragraph. An example is shown here: https://gist.github.com/0f42f19422d446490e0e (update: I just edited the file a little to give better results).

It requires that you put markup around your paragraphs, unfortunately, but it's fun to play with. Perhaps the new everyhook package might be helpful to apply these sort of command to every text paragraph in a document, but I suspect that would require major surgery of LaTeX's section heading system.

3

I believe the answer is no. It would be pretty handy though.

Usually, lines that are underfull are pretty clear since the words are spaced out too much. Underfull vboxes are almost always really obvious because there will be space between paragraphs or at the bottom of the page.

TH.
  • 62,639