4

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$

\begin{equation}\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{equation}

\end{document}

I want the following:

enter image description here

Update: I want the equation to be citeable using label and ref command. This is also why I need the equation environment.

1
  • 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, 2014 at 20:23

2 Answers 2

5
\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}
2
  • 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? Oct 3, 2014 at 16:27
  • @Leo It does support label, just use label after refstepcounter as always Oct 3, 2014 at 16:34
3

You can define a longequation environment:

\documentclass[twocolumn]{article}

\usepackage{lipsum} % just for the example

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

\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}

enter image description here

1

You must log in to answer this question.

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