# How to prevent the label of a long equation running into the right margin?

I have an equation of the form

$$\label{eq:master} f(x) = E$$


where E is a long expression. The problem is that the label runs into the right margin.

What is the proper way to fix this?

• The proper way is to rewrite the equation to make things fit, possibly spreading E across multiple lines. Without you showing E, this is too broad.
– Werner
Feb 1, 2016 at 20:34

Use the amsmath package and then
\begin{multline}\label{eq:master}