[texhax] how to create a non-breaking hyphen

Uwe Lück uwe.lueck at web.de
Mon May 15 00:09:26 CEST 2006


At 23:32 14.05.06, you wrote:
>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.

This seems to be an XML or some script issue,
having nothing to do with LaTeX -- therefore I can't help,
having only a very rough idea of XML or of AWK/Pearl etc.
(that kind of regular expressions).
And I don't know who types which kind of text input
with your application. If it is /you/ who types it,
can't you type `//hyphen//' instead of `-', so the
replacing is nearly 100% reliable!? And I thought that
XML gives the possibility of /macro/ or "alias" definitions ...

Best, Uwe.





More information about the texhax mailing list