# Prevent linebreak if word begins with hyphen

Words beginning with hyphens such as suffixes in linguistic texts can break right after the hyphen which is undesirable.

To prevent this I know I could do \exhyphenpenalty=10000 or what the answers here suggest, but I was wondering if anyone has come up with a solution that would automatically prevent linebreaks if preceded by a space or at the beginning of line, without having to use a special command and without also preventing compounds-with-hyphens to break?

• would markup such as \?ing rather than -ing be acceptable? with \def\?{\mbox{-}} as a non-breakable hyphen? – David Carlisle Nov 14 '16 at 19:05
• @DavidCarlisle Hmm, I was hoping there was some automated solution, since I'd have to do a bunch of seach&replace in the the document, and also since I have a setup where I export the text also to word (for advisor comments) where I then would have to do a reverse search&replace again ... – jan Nov 14 '16 at 19:21
• \newcommand{\suffix}[1]{\mbox{#1}} and \suffix{-ing} will solve the issue. – egreg Nov 14 '16 at 20:18
• @JasonZentz egreg These are great hints, thank you, and I recognize the merit of defining a separate command. Nonetheless I'm still curious whether there is any way to achieve this without a separate command. – jan Nov 15 '16 at 6:37