I see this problem especially with short lines (e.g., multicolumn academic papers, small paper sizes lik A5): sometimes the line break or right justify algorithm goes wrong and a line runs on too long (especially noticeable in right justify mode).
The problem appears to occur more often if I have a fixed-width font (e.g., using {\tt xxx}) or if I use \dots on a line. I mostly use times but am not sure it's specific to the font.
Going through the typeset version looking for bad lines and fixing them by changing the wording isn't a good solution.
Currently using TeXshop but I've seen this problem many times in the past.
Any ideas?
General ⇒ right justify line break bug
NEW: TikZ book now 40% off at Amazon.com for a short time.
-
- Posts: 17
- Joined: Thu Aug 07, 2008 7:51 pm
right justify line break bug
The fundamental problem is that it simply isn't possible to typeset some lines of text without leaving either too much white-space, or making the line wider. This is nothing to do with LaTeX; it's a general typesetting problem.
When LaTeX encounters a line that won't fit in the available space, it errs on the side of writing past the margin. This is noticeable, but a whole lot better than moving the last word to the next line and adding extra white-space between the words, which is much harder to see by proof-reading.
This is known as an "overfull \hbox", and you will see warnings about it on the LaTeX console output.
It is not possible to avoid this problem completely, but there are some things you can do to make it happen much less often, such as setting hyphenation points correctly, and increasing the \tolerance value in places where extra white-space is allowable (such as narrow columns). You can also use the draft class option to highlight the lines which are overfull (since these can be hard to see if smaller than a few points).
For whole paragraphs of monospace fonts, you probably want to use \raggedright, which will allow LaTeX to put as much space as it likes at the right-hand side of the line, as full-justified monospaced text will not line up as extra space is inserted between words.
For a more complete discussion, see http://www.tex.ac.uk/cgi-bin/texfaq2html?label=overfull
See also the section on "Getting Rid of Overfull Boxes" at http://www.linuxjournal.com/article/3387
Hope that helps,
—Robert J Lee
When LaTeX encounters a line that won't fit in the available space, it errs on the side of writing past the margin. This is noticeable, but a whole lot better than moving the last word to the next line and adding extra white-space between the words, which is much harder to see by proof-reading.
This is known as an "overfull \hbox", and you will see warnings about it on the LaTeX console output.
It is not possible to avoid this problem completely, but there are some things you can do to make it happen much less often, such as setting hyphenation points correctly, and increasing the \tolerance value in places where extra white-space is allowable (such as narrow columns). You can also use the draft class option to highlight the lines which are overfull (since these can be hard to see if smaller than a few points).
For whole paragraphs of monospace fonts, you probably want to use \raggedright, which will allow LaTeX to put as much space as it likes at the right-hand side of the line, as full-justified monospaced text will not line up as extra space is inserted between words.
For a more complete discussion, see http://www.tex.ac.uk/cgi-bin/texfaq2html?label=overfull
See also the section on "Getting Rid of Overfull Boxes" at http://www.linuxjournal.com/article/3387
Hope that helps,
—Robert J Lee