[texhax] how to create a non-breaking hyphen

Uwe Lück uwe.lueck at web.de
Sun May 14 23:00:12 CEST 2006


Replacing `-' by `\mbox{-}' should do.

I guess your example surprises because TeX at some stage
inserts a penalty < 10000 after the hyphen. A low penalty
always overrides a higher one.

HTH -- Uwe.

At 22:26 14.05.06, Paul Tremblay wrote:

>How can I make sure that LaTeX does not break right after a hyphen?
>
>Below is a test file. The phrase "hyphen-word" is not kept together.
>
>Thanks
>
>Paul
>
>
>\documentclass[12pt, openright, twoside ]{memoir}
>\begin{document}
>
>For a long time I used to go to be early.  Sometimes, when when
>hyphen\nolinebreak[4]-\nolinebreak[4]word
>put out my candle, the thing. my eyes would close so quickly that I
>had not even time to say to myself: "I'm falling asleep."  And half an
>hour later the thought that it was time to go to sleep would awaken
>me; I would make as if to put away the book which I imagined was still
>in my hands, and to blow out the light; I had gone on thinking, while
>I was asleep, about what I had just been reading, but these thoughts
>had taken a rather peculiar turn; it seemed to me that I myself was
>the immediate subject of my book: a church, a quartet, the rivalry
>between Francois I and Charles V.  This impression would persist for
>some moments after I awoke; it did not offend my reason, but lay like
>scales upon my eyes and prevented them from registering the fact that
>the candle was no longer burning.  Then it would begin to seem
>unintelligible, as the thoughts of a former existence must be to
>reincarnate spirit; the subject of my book would separate itself from
>me, leaving me free to apply myself to it or not; and at the same time
>my sight would return and I would be astonished to find myself in a
>state of darkness, pleasant and restful enough for my eyes, but even
>more, perhaps, for my mind, to which it appeared incomprehensible,
>without a cause, something dark indeed.
>
>\end{document}
>
>--
>
>************************
>*Paul Tremblay         *
>*phthenry at iglou.com    *
>************************
>_______________________________________________
>TeX FAQ: http://www.tex.ac.uk/faq
>Mailing list archives: http://tug.org/pipermail/texhax/
>More links: http://tug.org/begin.html
>
>Automated subscription management: http://tug.org/mailman/listinfo/texhax
>Human mailing list managers: postmaster at tug.org



More information about the texhax mailing list