Search code examples
compiler-errorslatexequationmulticol

split an equation with multicols on


I would like to split my large equation in two column. But my file fails to compile when I try to use \{amsmath} and then split, multline, etc... The error says: Package amsmath Error:

\begin{multline} allowed only in paragraph mode. \begin{multline}

Does someone knows how to split a large equation while using multicols?

Here my file:

\usepackage{amsmath}
\begin{multicols}{2}

\begin{equation}
\begin{multline}
E(x_0, y_0)=  \int^{+\infty}_{-\infty} \ , exp \left( az \bigg[ \frac{ax_0}{3z} + \frac{y^2-2y_0 y}{2z} \bigg] \right) \cdot E(x,y)dxdy
 \end{multline}
\label{Equation_1}
\end{equation}

\end {multicols}

Solution

  • The error tells you that you cannot use multline in mathmode (which is entered when you use an equation block). The multline environment already implies mathmode.

    When I remove the equation block it works. Remember you have to add a \\ to actually use multiple lines in your equation.

    Resulting code:

    \begin{multicols}{2}
    
    \begin{multline}
    E(x_0, y_0)=  \int^{+\infty}_{-\infty} \ , exp \left( az \bigg[ \frac{ax_0}{3z} + \frac{y^2-2y_0 y}{2z} \bigg] \right)\\ \cdot E(x,y)dxdy
     \end{multline}
    \label{Equation_1}
    
    \end{multicols}