I don't want to prevent LaTeX from hyphenating - unfortunately I write in a language, which consists of rather long words. That results in quite a lot of hyphenations, not to mention that I have to deal with plenty of them manually. Albeit I use babel package.

My guess is LaTeX operates with a certain value, which says how many percent of line can be blank/without characters. It probably takes into consideration all lines in the paragraph or on the page. Am I correct? Any way to change such parameter?

Or should I rather make the text block wider? That could help?

  • 3
    The relevant TeX parameters are \lefthyphenmin and \righthyphenmin. For English language documents, these are usually set to 2 and 3, respectively; hyphenation point won't occur before the second character or after the third-to-last character of a word. For German language documents, these parameters are usually set to 2 and 2, respectively. Which language do you write in? Do you use the babel and/or polyglossia packages? They provide not only generic language-specific settings but also provide language-appropriate hyphenation exception patterns. – Mico Jan 26 '14 at 19:42
  • I do use relevant babel (Czech), which does hyphenate most of words correctly. Yet, it doesn't hyphenate all of them. I mean, the results themselves are not that bad - I just want to play with settings a little bit and see the differences. – Vochmelka Jan 26 '14 at 19:51
  • 3
    The TeX/LaTeX hyphenation algorithm operates on one paragraph at a time. To be more restrictive about permissible hyphenation, e.g., to have only longer words hyphenated, and even then only in the "middle" of the words, you could experiment with \renewcommand\czechhyphenmins{44}. To be more permissive about hyphenation, you could issue the instruction \renewcommand\czechhyphenmins{22}. (Be forewarned that being "permissive" in this sense may induce LaTeX to identify hyphenation points that aren't appropriate.) – Mico Jan 26 '14 at 19:58
  • 7
    If you aren’t loading microtype, adding it will help. – Thérèse Jan 26 '14 at 21:26
  • 1
    @morbusg Of course I can't understand a word out of it. ;-) If you increase \hyphenpenalty you also need to increase \tolerance, so wider interword spaces are accepted by TeX. – egreg Jan 29 '14 at 16:14

There are some demerits related to hyphenation in TeX, such as:

  • \doublehyphendemerits, added for two consecutive lines ending with discretionary break, and
  • \finalhyphendemerits added for second-last line of paragraph

where demerits are in units of "badness squared". And for actual badness, there is

  • \hyphenpenalty for line break after discretionary hyphen,
  • \exhyphenpenalty for line break after explicit hyphen, and
  • \brokenpenalty for page break after a hyphenated line.

These are in addition to the ones mentioned in the comments (\left- and \righthyphenmin).

The obvious choice would therefore be upping the \hyphenpenalty (I think it's 50 by default).

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.