Short answer
\penalty-10000
and \linebreak
are very much different from each other. And \allowbreak
is very different from both.
Long answer
The macros \nobreak
, \allowbreak
and \break
mean, respectively,
\penalty 10000
\penalty 0
\penalty -10000
They are in LaTeX because they are in Plain TeX and the original LaTeX loaded lplain.tex
which was a slightly edited copy of plain.tex
. They are documented neither in the LaTeX manual nor in the LaTeX Companion. Actually, \nobreak
appears in the index of the latter, with a reference to p. 234, but it's probably a typo for \nopagebreak
).
Those macros are included for back compatibility: many old LaTeX documents used Plain TeX programming. However they shouldn't be used in newer documents because they are against LaTeX's guidelines of distinguishing commands that go in horizontal and vertical mode.
The problem with \break
is that
abc\break def
and
abc\par\break def
mean two very different things: the first one breaks the line (like \linebreak
), the second introduces a page break.
With LaTeX's command \linebreak
you'd get a line break in the first case and an error in the second one.
In macros, where the programmer can control precisely the timing, those shortcuts can be handy. However
\allowbreak
appears only once in the LaTeX kernel, in the definition of \pmod
which is copied from plain.tex
;
\break
appears twice, in the definition of \eject
(again copied from plain.tex
) and in the definition of \@gnewline
(part of the code for \\
, but in the macro an \ifvmode
test is made, so this \break
can appear only in horizontal or math mode);
\nobreak
appears more frequently, but always in controlled situations, where the mode can be predicted; a typical appearance is \if@nobreak\ifvmode\nobreak\fi\fi
.
The conclusion is easy: don't use those macros in documents. You're allowed to use them in lower level programming, but you should know what you're doing. Don't blame LaTeX if one of your macros using \break
issues a page break rather than a line break.
\allowbreak
is\penalty0
,\linebreak
throws an error if used in vertical mode and else without optional argument issues\penalty-10000
(and inserts the last skip if there was one)