General ⇒ right justify line break bug
-
- Posts: 6
- Joined: Fri Oct 26, 2007 12:46 pm
right justify line break bug
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?
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
-
- Posts: 17
- Joined: Thu Aug 07, 2008 7:51 pm
right justify line break bug
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