I am having trouble with the interaction between discretionary line breaks and centering.

I have defined macros for math mode that contain discretionary line breaks to help TeX lay out inline formulas without overrunning the paragraph margins. However, in a centering environment, lines always break, even if there is plenty of room to make a longer line. The following is a complete example showing an unnecessary line break in a very short line.

$\qlambda{x} x$ % This would fit in one line but is broken into two

Most of my document is not centered. I noticed the problem when I tried using the following method to center table cells vertically and horizontally.

  $\qlambda{x} x$ % This would fit in one line but is broken into two

How can I make a discretionary line break that doesn't break when a paragraph fits on a single line?


1 Answer 1


\linebreak[1] makes a negative penalty so TeX thinks breaking there is better than doing nothing. In justified text this is counterbalanced by the cost of stretching glue in the short line but when centering (or ragged right or left) stretchable glue fills the short line with no penalty added.

So use \nolinebreak[1] so the break is allowed but discouraged. Or perhaps better instead of using \linebreak tell TeX that the . is being used as a binary operator by using \mathbin{.} which will give different spacing and allow a break.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .