views:

970

answers:

4

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 ?

+5  A: 

From http://www.tex.ac.uk/cgi-bin/texfaq2html?label=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).

KennyTM
Thanks a lot. As I suspected, there is no "perfect" answer. Because I'm not the only author in that document, I don't really want to force the others to use a `\newcommand` everywhere (that's why I was seeking something based on `\hyphenation`). I guess I'll just keep it ''as is'' by default, and add explicit hyphens manually when Latex complains about overfull hboxes.
Gyom
A: 

I answered something similar here: http://stackoverflow.com/questions/1609837/latex-breaking-up-too-many-words

I said:

you should set a hyphenation penalty somewhere in your preamble:

\hyphenpenalty=750

The value of 750 suited my needs for a two column layout on letter paper (8.5x11 in) with a 12 pt font. Adjust the value to suit your needs. The higher the number, the less hyphenation will occur. You may also want to have a look at the hyphenatpackage, it provides a bit more than just hyphenation penalty

Mica
+2  A: 

I think it will hyphenate it if you write it as {multi}-{disciplinary}.

lhf
Sorry, that did not work in the few experiments I tried. The only thing that did was to write "multi-disci\-pli\-na\-ry" explicitly in the text. If you have many occurrences of that word, follow KennyTM's advice and define a macro for it: \def\multidisciplinary{multi-disci\-pli\-na\-ry}.
lhf
A: 

To avoid hyphenation in already hyphenated word I used non-breaking space ~ in combination with backward space \!. For example, command

3~\!\!\!\!-~\!\!\!D

used in the text, suppress hyphenation in word 3-D. Probably not the best solution, but it worked for me!

Igor