Fine-tuning LaTeX documents

Slashdot it! Delicious Share on Facebook Tweet! Digg!

Completing the Picture

The proofreading phase concludes with the finalization of the layout. Particularly important here are page breaks, line breaks, hyphenation, and ligatures. Normally, LaTeX takes care of all of these things automatically, so you don't have to worry about them. However, once in a while it's necessary to intervene in the layout process.

The first and last paragraph of a page normally consists of more than one line; otherwise, the layout looks bad. In the preamble, you can specify how strictly LaTeX should apply this rule via the following command:

\clubpenalty = 10000
\widowpenalty = 10000

This command allows you to set penalties for first (line 1) and last (line 2) paragraphs of a page, which are made up of a single line. The greater the value you enter, the more strictly LaTex will apply the rule. The value chosen in this example represents strict application.

Alternatively, you can use the nowidow [6] package. This package can be integrated into the preamble via the following command:

\usepackage[defaultlines=2,all]{nowidow}

This command stipulates that single lines at the beginning and end of a page are prohibited and that the first and last paragraph of a page contain at least two lines.

When in doubt, you can manually intervene in the layout. A page break can be generated via the \pagebreak command. The manual approach also lets you perform minor workarounds to solve layout problems.

LaTeX also automatically takes care of line breaks and hyphenation, so you should only have to resort to manual operations in isolated cases. The microtype  [7] package handles an extensive number of smaller corrections that make for an improved layout. This package and its standard settings can be installed with:

\usepackage{microtype}

Moreover, multiple detail settings are available. In particular, the program can arrange the individual letters of a line so that fewer gaps appear in the text and line breaks are improved.

If an individual situation requires that a line break be created manually, you can do this via the \linebreak command.

When confronted with compound words or with words from a foreign language, you may need to specify where LaTex should separate the syllables. Awkward word breaks can otherwise lead to stumbling blocks with-in th-e te-xt . You can tag the location of a syllable separation in two ways.

When the tag for a separation point applies to the entire document, then the command shown below should be used in the preamble.

\hyphenation{
Guard-house
}

When the separation only applies to one of the specified words, then LaTeX will divide the word at the tagged location. In the document itself, you can tag locations for syllable separations in a single word by using the \- command (e.g., guard\-house ).

A ligature ties two or three letters together to create a special character (e.g., ae) or to improve the readability and flow of the text (e.g., fi) However, a ligature is not always desirable. In the event that two letters should not be joined with a ligature, you should add the command \/ between the letters (example: sales\/man ).

Conclusion

LaTeX does not lag behind Office programs with respect to spellchecking, tagging modifications, and manual access to the layout. The spellcheck is problematic in that commands and text are treated equally, which in turn results in commands being subject to a spellcheck.

This problem gradually disappears as commands are accepted into the user dictionary during the proofreading process. The disadvantage to the modification tagging feature in LaTeX files is that each modification must be marked with its own command. This leads to additional typing. In terms of layout, LaTeX already offers excellent results; nonetheless, it allows for even better results with the use of additional packages and targeted manual intervention.

Infos

  1. Hunspell: http://hunspell.sourceforge.net
  2. Aspell: http://www.aspell.net
  3. Dictionaries for GNU Aspell: ftp://ftp.gnu.org/gnu/aspell/dict/0index.html
  4. Changes package for LaTeX: http://www.ctan.org/pkg/changes/
  5. "Creating Vector Graphics with LaTeX and TikZ" by Daniel Tibi, Ubuntu User , Issue 22, 2014: http://www.ubuntu-user.com/Magazine/Archive/2014/22/Creating-vector-graphics-with-LaTeX-and-TikZ/%28language%29/eng-GB
  6. Nowidow package for LaTeX: http://www.ctan.org/pkg/nowidow
  7. Microtype package for LaTeX: http://www.ctan.org/pkg/microtype

Buy this article as PDF

Express-Checkout as PDF

Pages: 4

Price $0.99
(incl. VAT)

Buy Ubuntu User

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content