How to prevent LaTeX from hyphenation of words containing dashes?

I would like to globally prevent LaTeX from porting Objective-C. I know the \ hyphenation command, but I donโ€™t see how I can use it. If I pass 'Objective-C' to this command, a dash will be considered as a hint to translate this word.

One solution that I found wraps Objective-C in mbox every time I use it. However, the document I am writing contains this name, and porting it to mbox every time is ugly (since it is a definition of a command and using it again and again in the source code).

I would welcome any suggestions!

Best, In JP

+5
source share
3 answers

? \LaTeX\ .

\def\ObjectiveC{\mbox{Objective-C}}
+8

, โ€‹โ€‹:

 \newcommand\dash{\nobreakdash-\hspace{0pt}}

:

Consider the $n$\dash dimensional manifold ... 

, babel "~ . , babel, .

+2

Use \nobreakdash. What LyX creates when I embed unsbreakingdash and convert it to tex.

+2
source

All Articles