latexhyphenation

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


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?


Solution

  • From https://texfaq.org/FAQ-nohyph:

    TeX won’t hyphenate a word that’s already been hyphenated. For example, the (caricature) English surname Smyth-Postlethwaite wouldn’t hyphenate, which could be troublesome. This is correct English typesetting style (it may not be correct for other languages), but if needs must, you can replace the hyphen in the name with a \hyph command, defined

     \def\hyph{-\penalty0\hskip0pt\relax}
    

    This is not the sort of thing this FAQ would ordinarily recommend… The hyphenat package defines a bundle of such commands (for introducing hyphenation points at various punctuation characters).


    Or you could \newcommand a command that expands to multi-discipli\-nary (use Search + Replace All to replace existing words).