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?


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


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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