Go to page:

Search:   Help

Edit

# PreventingLinebreakInInlineFormula

<< | Page list | >>

## How can I prevent LaTeX from inserting a linebreak in an inline formula?

### Problem

If I have an inline formula at the end of a line, LaTeX may break this formula and split it over two lines. How can I prevent this?

### Quick solution

Put the formula inside an mbox

### Detailed solution

1. Enter to math mode (either for inline formula or display formula)
2. Type \mbox and then a press ENTER or SPACE
3. The text "\mbox" disappears and a blue box appears in its place
4. Select math mode (again!)
5. Type the equation inside the box

### Another solution

This solution simply prevents line breaking formulas unless a very extreme case happens. To use this solution just add the following lines to the latex-preamble:

```\relpenalty=9999
\binoppenalty=9999```

setting the number to 10000 will prevent all the line breaks, including in extreme cases.