# How to use the inline equation format in the equation environment

I have a very long equation and have to use a equation environment to get a equation number. But I still want the equation to use the inline equation format, which automatically do line breaks and is more compact than manually doing break lines.

Here is the test tex:

\documentclass[twocolumn]{article}

\begin{document}

Equation \ref{eq1}.

$f=a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c$

$$\label{eq1} f=a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c$$

\end{document}


I want the following:

Update: I want the equation to be citeable using label and ref command. This is also why　Ｉ　ｎｅｅｄ　ｔｈｅ　ｅｑｕａｔｉｏｎ　ｅｎｖｉｒｏｎｍｅｎｔ．

• Do you have any interest that the intended reader is actually able to read that equation? This will look really awfull and one wil not be able to read this properly. Use the split environment and align your big equation to look nice. – MaxNoe Oct 3 '14 at 20:23

\documentclass[twocolumn]{article}

\begin{document}

\begin{center}
\refstepcounter{equation}$f=a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c$\\
\hspace*{\fill}(\theequation)
\end{center}

\end{document}

• Thanks for the swift response indeed. But I also need to use label{} inside this equation and cite it elsewhere. Can the solution be improved to support this? – Changwang Zhang Oct 3 '14 at 16:27
• @Leo It does support label, just use label after refstepcounter as always – David Carlisle Oct 3 '14 at 16:34

You can define a longequation environment:

\documentclass[twocolumn]{article}

\usepackage{lipsum} % just for the example

\newenvironment{longequation}
{$$\begin{minipage}{.9\columnwidth}} {\end{minipage}$$}

\begin{document}

Equation \ref{eq1}.

\lipsum*[2]
\begin{longequation}\label{eq1}
f=a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+
c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+f+a+b+c+d+e+
f+a+b+c+d+e+f+a+b+c
\end{longequation}
\lipsum[3]

\end{document}