[texhax] how to create a non-breaking hyphen

Paul Tremblay phthenry at iglou.com
Sun May 14 23:32:34 CEST 2006


On Sun, May 14, 2006 at 05:04:11PM -0400, Barbara Beeton wrote:
> 
> to suppress a single hyphen, it's probably easiest
> to pop the word into an mbox:
>   \mbox{hyphen-word}
> 							-- bb

Thanks. I just discovered the mbox in my LaTeX book. However, that
presents another problem. I am not writing the LaTeX directly.
Instead, I am converting XML into LaTeX. I guess there is no way to
stop a hypen *after* the hyphen itself? 

I am guessing there is no way. That means I need to do a search and
replace, using the pattern /\s(\S+)u'\u2011'(\S+)/mbox{\1-\2}/ 

Yes, this regular expression is a pain, and is just a rough guess. 
It basically looks for a a space, a series of non-spaces, a
non-breaking hyphen, and a series of non-spaces, and replaces them
with the mbox.

Paul


-- 

************************
*Paul Tremblay         *
*phthenry at iglou.com    *
'***********************


More information about the texhax mailing list