How to insert a long equation in whole page of two column format?

Hosein Aqajani picture Hosein Aqajani · Oct 8, 2015 · Viewed 16.4k times · Source

I have an equation like this:

\begin{flalign}&I(pair_1,pair_2)=\nonumber\\
    &\begin{cases} 
        0 & if\:\begin{cases}
        \max\left(r\left(pair_1^{rx}\right),r\left(pair_2^{tx}\right)\right)\leq
        d(pair_1^{rx},pair_2^{tx})  \\ \& \\
        \max\left(r\left(pair_1^{tx}\right),r\left(pair_2^{rx}\right)\right)\leq
        d(pair_1^{tx},pair_2^{rx}) \end{cases}\\ 1 & otherwise
    \end{cases}\nonumber\\
\end{flalign}

I Want to show this equation in whole of two column page. Indeed avoid to put equation in only one column.

Answer

MattAllegro picture MattAllegro · Oct 8, 2015

My first suggestion is that you use multicols environment by multicol package. For example, given your preamble:

\documentclass{doublecol-new}
%\usepackage{natbib,stfloats}
%\usepackage{mathrsfs}
%\usepackage{graphicx}
%\usepackage[tight,footnotesize]{subfigure}
%\usepackage{algorithmic}
%\usepackage{algorithm}
%\usepackage{tabularx}
\usepackage{amsmath}
\usepackage{multicol,lipsum}

\begin{document}
\begin{multicols}{2}
    \lipsum[1]
\end{multicols}

\begin{multicols}{1}
\begin{flalign}&I(pair_1,pair_2)=%\nonumber\\
&\begin{cases} 
0 & if\:\begin{cases}
\max\left(r\left(pair_1^{rx}\right),r\left(pair_2^{tx}\right)\right)\leq
d(pair_1^{rx},pair_2^{tx})  \\ \& \\
\max\left(r\left(pair_1^{tx}\right),r\left(pair_2^{rx}\right)\right)\leq
d(pair_1^{tx},pair_2^{rx}) \end{cases}\\ 1 & otherwise
\end{cases}\nonumber\\
\end{flalign}
\end{multicols}

\begin{multicols}{2}
    \lipsum[2]
\end{multicols}

\end{document}

This would give you the following output:

screenshot of output

Also, a bit better looking:

\begin{multicols}{1}
    \begin{equation}
        I(pair_1,pair_2)=
        \begin{cases}
            0 & \text{if }
            \begin{cases}
                \max\left(r\left(pair_1^{rx}\right),r\left(pair_2^{tx}\right)\right)\leq d(pair_1^{rx},pair_2^{tx}) \\
                \& \\
                \max\left(r\left(pair_1^{tx}\right),r\left(pair_2^{rx}\right)\right)\leq d(pair_1^{tx},pair_2^{rx})
            \end{cases}\\
            1 & \text{otherwise}
        \end{cases}
    \end{equation}
\end{multicols}

enter image description here