14

Under TeX, when I write a line too long, it prints a fat black box at the end of the line. That is probably a feature, but I dislike it.

How to turn that OFF? Is there a command-line option or something else?

I usually use LaTeX, but I have a complicated file which happens to be plain TeX.

1
  • 8
    Don't fight the consequences, eliminate the cause. Nov 12, 2011 at 22:02

3 Answers 3

15

Since you are using Plain TeX, the answer is

\overfullrule=0pt

before the text starts.

8

I think the draft option, as mentioned by Alan, works with LaTeX classes. Try to set \overfullrule=0pt in Plain TeX.

See The TeXBook.

3
  • 1
    I don't think that PDF is legal.
    – egreg
    Jul 7, 2011 at 17:48
  • 1
    Indeed, while the source code of The TeXBook is on CTAN creating and sharing PDFs from it is not allowed by the copyright holder. A good free alternative is TeX for the Impatient (PDF on CTAN or texdoc impatient). For \overfullrule see page 170 (PDF page 190). @egreg Jul 7, 2011 at 18:10
  • @Martin: I didn’t know that. Thanks for your edit :-)
    – Tobi
    Jul 7, 2011 at 22:41
1

Fixing the illness directly, not the symptoms

The black boxes usually occur alongside the error:

Overfull \hbox (3.14159pt too wide) in paragraph at lines 41--42

This usually means that there is too much text being rendered in a single line of the output PDF:

|The quick brown fox jumped over the lazy doggie.  |  <-- boundary
|This is the rendered output PDF of a TeX document.|  <-- boundary
|This cannot fit on one line without being squashed.| <-- overfull!
|Unfortunately, if TeX made a break before "being" |  <-- boundary
|and "squashed", it would look weird.              |  <-- boundary

One way to fix this is to simply reword the paragraph causing the issue so that TeX can make a line break in a visually pleasing matter. Often, this merely involves removing or adding a few words until the issue disappears:

|The quick brown fox jumped over the lazy doggie.  |  <-- boundary
|This is the rendered output PDF of a TeX document.|  <-- boundary
|This can fit on one line without being squashed.  |  <-- FIXED!
|Unfortunately, if TeX made a break before "being" |  <-- boundary
|and "squashed", it would look weird.              |  <-- boundary

Addressing the symptoms instead

Of course, one can change the tolerances, at the cost of looking less aesthetically pleasing. If we set \sloppy, the result might look like:

|The quick brown fox jumped over the lazy doggie.  |  <-- boundary
|This is the rendered output PDF of a TeX document.|  <-- boundary
|This cannot fit on one line without being         |  <-- UGLY
|squashed. Unfortunately, if TeX made a break      |  <-- UGLY
|before "being" and "squashed", it would look      |  <-- UGLY
|weird.                                            |  <-- UGLY

Instead, if we set \overfullrule=0pt, as described in @egreg's answer, the Overfull \hbox error is silently swept under the rug, but our text still goes over the boundary and/or is overly squashed together, as shown in the first example.

Content and presentation are intertwined. Sometimes we must compromise a bit of one for the other.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .