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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.