Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to prevent LaTeX from hyphenating words containing a dash?

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

like image 772
BVC Avatar asked Jan 04 '11 14:01

BVC


People also ask

How do you make LaTeX not hyphenate words?

You can load hyphenat with the command \usepackage[none]{hyphenat} to prevent any hyphenation in a single-language document.

How do you avoid dashes?

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.

How do I get rid of hyphens in text?

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.

In which panel can you turn off the option to hyphenate text?

Turn off hyphenation Choose Hyphenation from the Paragraph panel menu or Control panel menu and deselect Hyphenate from the Hyphenation Settings dialog box.


1 Answers

Why is defining a new command ugly? It's how \LaTeX\ defines itself.

\def\ObjectiveC{\mbox{Objective-C}}
like image 52
Spacedman Avatar answered Sep 21 '22 02:09

Spacedman