11

I am having trouble with the hyphenation of a project I am writing. More precisely it will not hyphenate the word $\ast$-homomorphism. I have tried with \hyphenation{ho-mo-mor-phism}, but to no luck. Of course I suspect that it is the $\ast$- which courses the problem, but why? and how do I make the word hyphenate?

Here is an example where my problem occurs:

\documentclass[a4paper,10pt,draft]{article}

\hyphenation{ho-mo-mor-phism}

\begin{document}

I would really much like to have the---frequently
appearing---word $\ast$-homomorphism hyphenated.

\end{document}
Kristian
  • 1,131

2 Answers2

8

The package hypenat is designed to allow for this sort of thing.

\documentclass[a4paper,10pt,draft]{article}
\usepackage{hyphenat}

\begin{document}

I would really much like to have the---frequently appearing---word $\ast$\hyp{}homomorphism hyphenated.

\end{document}

It makes the the point after the dash breakable, whence the following word can be hyphenated.

hyphenation of homomorphism

(The hyphenation point is slightly different as I actually used the standalone class to produce this image and it did it with a different line width.)

Andrew Stacey
  • 153,724
  • 43
  • 389
  • 751
  • 1
    Actually between $\ast$ and homomorphism is the only place I don't want the word hyphenated. How do I make hyphenation possible in homomorphism but tell LaTeX that it should not hyphenate after $\ast$? Is there no solution such as \hyphenate{...}, so that you specify where hyphenation is to take place and avoid replacing - with \hyp{} in all occurrences of $\ast$-homomorphism, becuase I already have quite a few pages. – Kristian Sep 20 '12 at 15:55
  • Ah, that wasn't clear from your question. In that case, I have bad news for you: take a look at http://tex.stackexchange.com/q/2706/86 Indeed, based on that comment I'd say this question is (unfortunately - given the answer there) a duplicate of that one. – Andrew Stacey Sep 20 '12 at 16:19
  • No, this was not one of my questions. Your answer just made me ralize that it was a problem I had not thought of. The real question was how to make LaTeX hyphenate the word $\ast$-homomorphism. I'm just sorry that I have to search and replace all the files in my document. But I guess that's life. Thanks. – Kristian Sep 20 '12 at 17:34
3

Using a "local hyphenation" technique:

enter image description here

\documentclass[a4paper,10pt,draft]{article}

\begin{document}

I would really much like to have the---frequently
appearing---word $\ast$-ho\-mo\-mor\-phism hyphenated.

\end{document}​
Werner
  • 603,163