[texhax] how to create a non-breaking hyphen

Philip TAYLOR P.Taylor at Rhul.Ac.Uk
Mon May 15 00:14:54 CEST 2006


For your (trivial) example, an \hbox {} will suffice :

	For a long time I used to go to be early.  Sometimes, when when
	\hbox {hyphen-word}
	put out my candle, the thing. my eyes would close so quickly that I

For more complex examples (e.g., /never/ turn the line after an
explicit hyphen), something slightly more sophisticated is required :

	\documentclass[12pt, openright, twoside ]{memoir}

	\catcode `\- = \active
	\def -{\hbox {\char `\- }}
	\textwidth = 0,5 \textwidth %%% to shew that hyphenation still occurs
	
	\begin{document}
	
	For a long time I used to go to be early.  Sometimes, when when
	hyphen-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

Philip Taylor
-------
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


More information about the texhax mailing list