I would like to globally prevent LaTeX from hyphenating 'Objective-C'. I am aware of the \hyphenation command, but I don't see how I can make use of it. If I pass 'Objective-C' to this command, the dash will be treated as a hint to hyphenate the word there.
One solution I found is wrapping Objective-C into an mbox each time I use it. However, the document I am writing contains this name a lot, and wrapping it into an mbox each time is ugly (as is defining a command and using this over and over again in the source code).
I'd be happy about any suggestions!
Best, JP
You can load hyphenat with the command \usepackage[none]{hyphenat} to prevent any hyphenation in a single-language document.
You can avoid informal punctuation by replacing with a more formal punctuation alternative. Dashes can be replaced by several other punctuations including commas, colons and brackets.
Manual fix To fix this problem manually, turn off hyphenation and delete the hyphens. Click the Text Box Tools Format tab, and then click Hyphenation. In the Hyphenation dialog box, clear the Automatically hyphenate this story check box. Delete any hyphens that remain in your text.
Turn off hyphenation Choose Hyphenation from the Paragraph panel menu or Control panel menu and deselect Hyphenate from the Hyphenation Settings dialog box.
Why is defining a new command ugly? It's how \LaTeX\ defines itself.
\def\ObjectiveC{\mbox{Objective-C}}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With