Featured Post

We've moved to tex.my!

It’s been great writing on Blogger.com, but we’ve decided to move to a new platform, thanks to some valuable help from a great, great friend...

Tuesday, September 29, 2015

[Rant Warning] I don't want hyphenation in my document; what do I do?

In recent months, I’ve been getting this query/complaint about “broken words” at the end of lines in LaTEX documents. Some asked me whether this is allowed in thesis writing and documents at all, and could I fix this “serious bug“ in my LaTEX thesis templates ASAP.


tl;dr: OK, a quick way to disable hyphenation is to put \sloppy just after your \begin{document}. There are other ways, but personally I think this is pretty simple. ;-)


Now — here’s the long explanation about the role of hyphenation in professional typesetting. It’s ranty and may be a bit incoherent in places — you’ve been warned.

<RANT>

Not only is hyphenation acceptable in thesis writing (unless your institution expressly forbids it, that is), it is essential in professional book design and publishing. Without hyphenation (like default setting in Microsoft Word), the space between words would be inconsistent, some narrow and some wide, resulting in “rivers” (publishing jargon). See this article on self-publishing, under section “Hyphenation is nonexistent”.

If you look at professional text books published by large publishers (or books published in the 70’s before Microsoft Word became popular) you will notice that those which do not hyphenate words at the end of lines are all left-aligned (not justified) — so that spaces between words don’t have to be stretched. Professionally published books which justify their text, always hyphenate the words at the end of the lines if they do not fit nicely on the same line. See also journal papers published by IEEE and ACM — you will see the hyphenations in action (because they use LaTEX document classes).

Earlier versions of Microsoft Word could not hyphenate words. This is actually a shortcoming of Microsoft Word, not a feature. As comparison, professional desktop publishing software like Adobe InDesign, QuarkXpress, all support text hyphenation (some only recently). Unfortunately, since Microsoft Word was/is so popular (no thanks to bootlegged copies of Microsoft Office) during everyone's secondary school and undergraduate days (in this part of the world anyway, back when copyright laws were not really enforced and intellectual property an unfamiliar concept), one whole generation grew up thinking that hyphenating words is a “bug” and a “defect” (← one thesis examiner actually used these words).

Since TEX and LaTEX was developed to create beautiful books, the default behavior is to hyphenate words. A few papers doctoral theses (co-authored or supervised by Knuth) developed the algorithms to compute the optimum hyphenations, line-breaking and page-breaking, to maximise reading and visual aesthetics:

More recently, there is now also efforts to get good hyphenation working on Web documents, first using JavaScript, and more recently with HTML5 and CSS3. Here are some links:

So is hyphenation a “defect”? NO. It may not always be what you want or suitable for the occasion (e.g. when the text width is narrow!), but it is most definitely not a bug.

</RANT>

(mmmm it’s good to get that rant out of my system)

No comments:

Post a Comment