46

LaTeX tends to break words at the end of the line when that causes better typography. Great. I'd like to have some sort of influence on where the words are broken, though.

For example, LaTeX currently breaks cryptography into cryptog-raphy when it does not fit, while I would much rather break it into crypto-graphy.

I've tried putting an mbox around it (or around both parts of the word) but that just ends up overflowing the hspace.

Is there a way I can put a box around the word but still allow a break at designated points, i.e. after crypto and before graphy? I'm fine with doing this on a per-word basis manually.

  • 7
    In the document where you use the word: cryp\-to\-graphy or better as a rule in the preamble \hyphenation{cryp-to-graphy} – clemens Jun 30 '13 at 12:53
  • The Merriam-Webster dictionary says cryp•tog•ra•phy link If you use American spelling, you should follow Webster for hyphenation. – egreg Jun 30 '13 at 12:56
  • 1
    @egreg yep but then there is more than one school when it comes down to hyphens – Frank Mittelbach Jun 30 '13 at 13:01
  • 5
    @Joost Hyphenation is not a "personal choice": it's a convention that should be followed. Americans hyphenate fo•togra•phy, while Britons prefer fo•to•graphy. If you follow British spelling, also do \usepackage[british]{babel} – egreg Jun 30 '13 at 13:04
  • 3
    You've come across a well-known aspect of US-English hyphenation rules: Words that end in "ography" (cryptography, photography, etc) are supposed to be hyphenated between g and r, whereas the associated adjectives (cryptographic, photographic, etc) are supposed to be hyphenated before the gr group. If that's not in conformance with your hyphenation preferences, be sure to load the babel package with the appropriate language option. In your case, the british option may be appropriate. – Mico Jun 30 '13 at 14:46
67

Various possibilities:

  • use the right kind of hyphenation rules, e.g., in your case it is possibly \usepackage[british]{babel} instead of the default hyphenation patterns
  • use \- inside a word to explicitly denote the allowed places to break, e.g. cryp\-to\-graphy
  • specify exceptions via \hyphenation{cryp-to-graphy}

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.