How do I get LaTeX to hyphenate a word that contains a dash?

Gyom picture Gyom · Feb 3, 2010 · Viewed 120.5k times · Source

In a LaTeX document I'm writing, I get an overfull hbox warning because of the word "multi-disciplinary", which happens to be rendered at the end of a line.

I can get rid of this particular warning by changing it into multi-discipli\-nary, but the same problem will happen elsewhere, since this word is used a lot in the paper.

I'd like to use the \hyphenation{} command instead, but obviously my tentative \hyphenation{multi-disci-pli-na-ry} does not work, because it does not understand the first dash correctly.

What incantation do I need to get correct indentation in a word that already contains a dash?

Bonus question: Where could I have found the answer to that question myself?

Answer

Luke M picture Luke M · Dec 27, 2011

The problem (as KennyTM noted) is that LaTeX won't hyphenate words with dashes in them. Luckily, there's a standard package (part of ncctools) that addresses that very problem, called extdash. This defines new hyphen and dash commands that do not disrupt hyphenation, and which can allow or prevent line breaks at the hyphen/dash. I prefer to use it with the shortcuts option, so I can use, e.g., \-/ rather than \Hyphdash. Here's what you want:

\usepackage[shortcuts]{extdash} ... multi\-/disciplinary

To prevent breaking at that hyphen, use multi\=/disciplinary

(Aside: The Chicago Manual of Style advises dropping the hyphens attaching affixes like 'multi', unless the word is ambiguous or unintelligible without it.)