Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
    
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
add comment

2 Answers 2

up vote 5 down vote accepted

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.

share|improve this answer
    
Pretty amazing, thanks! –  Jukka Suomela Oct 15 '10 at 14:59
    
Ingenious routine. Just tried it with narrower text and various \hyphenpenalty values. –  Yiannis Lazarides Oct 16 '10 at 19:51
add comment

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.

share|improve this answer
    
I agree, the answer is no. –  Taco Hoekwater Oct 13 '10 at 19:41
1  
OK, thanks for the answers. I'll wait a while before accepting this answer, though, just in case someone comes up with a clever trick. –  Jukka Suomela Oct 14 '10 at 9:25
1  
@Jukka Suomela: Good choice! –  TH. Oct 16 '10 at 19:27
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.