TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In the amsmath package documentation it is written:


The last example shows how to prohibit a linebreak after the hyphen but allow normal hyphenation in the following word. (It suffices to add a zero-width space after the hyphen.)

I am thinking that this can be used to make the more general commands \nbhyphen and \nbendash like this :

Electron\nbhyphen electron interaction. Maxwell\nbendash{}Boltzmann distribution.

and then use them in my document instead of writing the dashes explicitly.


Is this a good idea? Will it work everywhere, or is it like to cause unforeseen problems? Should I use the commands with space after, or {}? Why is this not default behavior in LaTeX?

share|improve this question
up vote 5 down vote accepted

Why something isn't available as a default is a difficult question to answer. In this particular case, who wants to mark up a document source always with such long commands? If fear only a few people so that such commands would end up not being very useful as such.

However, LaTeX offers something like this as part of the Babel interface for languages and there in a manner that makes input fairly painless: all languages that support " as a babel shorthand have abbreviations like "= (compound word mark allowing hyphenation in the remainder) and a bunch of others like "" and "- and "~ defining various alternative behaviors for explicit or implict hyphens.

However, none of them is really what you are looking for, the reason being that in languages like German the compound word mark is really a preferable break point (not a forbidden one).

Also those shorthands are only set up for some languages typically those that needed input methods for diacritical character. So, for example, for English nothing is being set up by default. But you can always define your own shorthands, so to achieve what you are looking for with a (imho) useful input syntax you could do





which gives you

enter image description here

share|improve this answer

By all means have them in macros (but another two macro names to remember). They can produce bad output in minipars and possibly captions and other narrow texts. See MWE for marginpar problems.


\marginpar{\raggedright Electron\nbhyphen electron interaction. Maxwell\nbendash{}Boltzmann distribution.}

\marginpar{\raggedright Electron-electron interaction. Maxwell--Boltzmann distribution.}

This is the sort of micro corrections I would rather do manually once the manuscript is finished.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.