TransWikia.com

How to reduce the number of hyphenation?

TeX - LaTeX Asked by pythonee on December 14, 2020

Sometimes, assume our document contain many long words, TeX may generate some hyphenation at the end of line. But it really hinder our smooth reading. Although I know we can add the hyphenation rule at the preamble. It can’t reduce hyphenation number but effect the hyphenation position.
It is said that microtype package can give us more compact output. But it require expert level to tuning the parameter.

4 Answers

Some time ago, I wanted to deactivate hyphenation completely (without switching to raggedright).

I found out that setting pretolerance=10000 turns off the complete hyphenation mechanism: it tells TeX to not even look for hyphenation positions.

In addition, there is the parameter hyphenpenalty. For example, hyphenpenalty=10000 will (probably) also suppress hyphenation.

Naturally, forbidding hyphenation might cause underfull/overfull lines. That's why I added tolerance=2000 emergencystretch=10pt. The tolerance parameter controls how much white space TeX considers to be "acceptable"; and the emergencystretch configures TeX to use at most 10pt of additional white space per line in order to avoid underfull/overfull lines.

My solution to suppress hyphenation completely was

pretolerance=10000
tolerance=2000 
emergencystretch=10pt

Now, I am aware that you expressed doubts on "tuning complicated parameters". But I encourage you to experiment with pretolerance and/or hyphenpenalty in combination with my suggestions for tolerance and emergencystretch.

The value 10000 is special in TeX, it means "disable this feature" - it is kind of "black or white". I would expect that any value between 0 and 10000 (exclusive) will "reduce" the number of hyphenations (i.e. a "grayshade").

According to my notes, I stumbled over the details on the mentioned parameters in Knuth, D.: Computers & Typesetting – The TEXbook. AddisonWesley, 1986 on page 96.

Correct answer by Christian Feuersänger on December 14, 2020

Based on the other answers on this page (especially the accepted answer), I found these settings to be perfect to prevent hyphenation without being ugly:

tolerance=9999
emergencystretch=10pt
hyphenpenalty=10000
exhyphenpenalty=100

tolerance=9999 allows as much whitespace as possible.

emerencystretch=10pt allows some extra whitespace per line.

hyphenpenalty=10000 disables hyphens completly.

exhyphenpenalty=100 allows using hyphens which were already present.

Answered by Alexander Braekevelt on December 14, 2020

In my opinion you only get good results by combining two of the already given answers. I am using the following:

pretolerance=5000

I want some hyphenation, but when it makes sense, so I am not disabling it completely.

tolerance=9000

I personally do not mind a little bit of space between words and it turned out, that if the tolerance is too low, words might still go over the margin, because a low tolerance leaves tex no other choice, since the whitespace added if the word was moved to the next line, would be declared as unacceptable.

emergencystretch=0pt

I don't ever want to write over the margin, so no stretching here.

righthyphenmin=4
lefthyphenmin=4

I like to get into the flow of a word while reading it before the hyphenation, so that I might already get an idea of what the complete word is. This is more likely to happen, if there are at least 4 characters before the hyphen. If I can figure out what the word is without looking at the next line, the break does not mean that the flow of reading is interrupted.

Answered by Zelphir Kaltstahl on December 14, 2020

Disabling hyphenation entirely frequently creates more problems than it solves. You may want to fiddle with the lefthyphenmin and righthyphenmin parameters instead. Their default values in many document classes are 2 and 3, respectively; put differently, the left-hand and right-hand fragments must contain at least 2 and 3 letters. You could reset them, say as follows,

lefthyphenmin4
righthyphenmin4

and recompile the document. Only words containing at least 8 characters will now be hyphenated. The success rate (i.e., the reduction in hyphenation frequency) of this approach will depend crucially on the language in use; if its words are generally short, you'll likely see a huge reduction in hyphenations.

Answered by Mico on December 14, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP