[Tex/LaTex] Inserting a vertical table in a two column article

landscapetwo-column

I'm writing an article in a a twoside format and I want to insert a vertical table in one of the columns so I can write up the results in the next column. Following several threads from this webpage I ended up very close, as I get the table in one of the columns. However, I can't get the text on the next column as the text jumps to the next page.

I have a whole article written with twoside so I'd prefer to keep using twoside instead of changing to twocolumns.

Here's an example of what I'm doing:

\documentclass[twoside]{article}
\usepackage{rotating}
\usepackage{tabularx}
\usepackage{multicol}
\usepackage{lipsum}
\usepackage{booktabs}
\begin{document}
\begin{multicols}{2} % Two-column layout throughout the main article text

\lipsum[3-5]

\begin{sidewaystable*}
\centering
\caption{}
\begin{tabular}{@{}ccc|cc|cc|cc|cc|cc@{}}
\midrule \bottomrule
\\
\multicolumn{1}{l}{}                  &          & \multicolumn{1}{l}{} & \multicolumn{2}{c}{2007}  & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} &          & \multicolumn{1}{l}{} & \multicolumn{2}{c}{2009} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{}      
\\   \cmidrule(l){2-6} \cmidrule(l){8-12}                                    & \multicolumn{2}{c}{M1}          & \multicolumn{2}{c}{M2}   & \multicolumn{2}{c}{M3}                      & \multicolumn{2}{c}{M1}          & \multicolumn{2}{c}{M2}   & \multicolumn{2}{c}{M3}                           \\ 
                                      & Beta     & S.E                   & Beta         & S.E        & Beta                 & S.E                   & Beta     & S.E                   & Beta          & S.E       & Beta                 & \multicolumn{1}{c|}{S.E}   \\
Treatment                             & -1.15    & -1.17                 & -0.83        & -0.75      & -0.62                & -0.62                 & 0.75     & -1.51                 & 0.64          & -1.32     & -0.29                & \multicolumn{1}{c|}{-0.36} \\
Indigenous                            & -2.87*   & -1.25                 & -2.42**      & -0.80      & -2.35***             & -0.67                 & -1.30    & -1.60                 & -1.02         & -1.40     & -0.72                & \multicolumn{1}{c|}{-0.40} \\
Treatment*Indigenous                  & 1.41     & -1.75                 & 1.35         & -1.12      & 1.62                 & -0.92                 & -0.31    & -2.25                 & -0.33         & -1.97     & 0.48                 & \multicolumn{1}{c|}{-0.54} \\ \midrule
With SES controls                     & \multicolumn{2}{c|}{No}          & \multicolumn{2}{c|}{Yes}  & \multicolumn{2}{c|}{Yes}                     & \multicolumn{2}{c|}{No}          & \multicolumn{2}{c|}{Yes}  & \multicolumn{2}{c|}{Yes}                          \\
With family controls                  & \multicolumn{2}{c|}{No}          & \multicolumn{2}{c|}{No}   & \multicolumn{2}{c|}{Yes}                     & \multicolumn{2}{c|}{No}          & \multicolumn{2}{c|}{No}   & \multicolumn{2}{c|}{Yes}                          \\
With children characteristics control & \multicolumn{2}{c|}{No}          & \multicolumn{2}{c|}{No}   & \multicolumn{2}{c|}{Yes}                     & \multicolumn{2}{c|}{No}          & \multicolumn{2}{c|}{No}  & \multicolumn{2}{c|}{Yes}                          \\
With classroom and states control     & \multicolumn{2}{c|}{No}          & \multicolumn{2}{c|}{No}   & \multicolumn{2}{c|}{Yes}                     & \multicolumn{2}{c|}{No}          & \multicolumn{2}{c|}{No}  & \multicolumn{2}{c|}{Yes}                          \\ \midrule
Intercept                               & 92.71*** & -0.78                 & 98.5***      & -0.54      & 98.81***             & -2.09                 & 95.56*** & -1.01                 & 97.28***      & -0.89     & 91.46***             & \multicolumn{1}{c|}{-1.20} \\
N                                     & \multicolumn{2}{c|}{8287}        & \multicolumn{2}{c|}{8287} & \multicolumn{2}{c|}{8287}                    & \multicolumn{2}{c|}{7311}        & \multicolumn{2}{c|}{7311} & \multicolumn{2}{c|}{7311}     \\ \midrule \bottomrule
\end{tabular}
\end{sidewaystable*}

\lipsum[3-5]

\end{multicols}
\end{document}

Any help is appreciated.

Thanks.

Best Answer

There couple of issues with your current format. If the entirety of your document is two-columned, I suggest to drop the idea of multi-column in the way you did it and instead, try twocolumn as option of the documentclass. This means: \documentclass[twoside, twocolumn]{article}. Once you do this, you can simply switch from sidewaystable* to sidewaystable and you should be fine.

\documentclass[twoside, twocolumn]{article}
\usepackage{rotating}
\usepackage{tabularx}
\usepackage{multicol}
\usepackage{lipsum}
\usepackage{booktabs}

\begin{document}

\lipsum[3-5]

\begin{sidewaystable}
\centering
\caption{}
\begin{tabular}{@{}ccc|cc|cc|cc|cc|cc@{}}
\midrule \bottomrule
\\
\multicolumn{1}{l}{}                  &          & \multicolumn{1}{l}{} & \multicolumn{2}{c}{2007}  & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} &          & \multicolumn{1}{l}{} & \multicolumn{2}{c}{2009} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{}      
\\   \cmidrule(l){2-6} \cmidrule(l){8-12}                                    & \multicolumn{2}{c}{M1}          & \multicolumn{2}{c}{M2}   & \multicolumn{2}{c}{M3}                      & \multicolumn{2}{c}{M1}          & \multicolumn{2}{c}{M2}   & \multicolumn{2}{c}{M3}                           \\ 
                                      & Beta     & S.E                   & Beta         & S.E        & Beta                 & S.E                   & Beta     & S.E                   & Beta          & S.E       & Beta                 & \multicolumn{1}{c|}{S.E}   \\
Treatment                             & -1.15    & -1.17                 & -0.83        & -0.75      & -0.62                & -0.62                 & 0.75     & -1.51                 & 0.64          & -1.32     & -0.29                & \multicolumn{1}{c|}{-0.36} \\
Indigenous                            & -2.87*   & -1.25                 & -2.42**      & -0.80      & -2.35***             & -0.67                 & -1.30    & -1.60                 & -1.02         & -1.40     & -0.72                & \multicolumn{1}{c|}{-0.40} \\
Treatment*Indigenous                  & 1.41     & -1.75                 & 1.35         & -1.12      & 1.62                 & -0.92                 & -0.31    & -2.25                 & -0.33         & -1.97     & 0.48                 & \multicolumn{1}{c|}{-0.54} \\ \midrule
With SES controls                     & \multicolumn{2}{c|}{No}          & \multicolumn{2}{c|}{Yes}  & \multicolumn{2}{c|}{Yes}                     & \multicolumn{2}{c|}{No}          & \multicolumn{2}{c|}{Yes}  & \multicolumn{2}{c|}{Yes}                          \\
With family controls                  & \multicolumn{2}{c|}{No}          & \multicolumn{2}{c|}{No}   & \multicolumn{2}{c|}{Yes}                     & \multicolumn{2}{c|}{No}          & \multicolumn{2}{c|}{No}   & \multicolumn{2}{c|}{Yes}                          \\
With children characteristics control & \multicolumn{2}{c|}{No}          & \multicolumn{2}{c|}{No}   & \multicolumn{2}{c|}{Yes}                     & \multicolumn{2}{c|}{No}          & \multicolumn{2}{c|}{No}  & \multicolumn{2}{c|}{Yes}                          \\
With classroom and states control     & \multicolumn{2}{c|}{No}          & \multicolumn{2}{c|}{No}   & \multicolumn{2}{c|}{Yes}                     & \multicolumn{2}{c|}{No}          & \multicolumn{2}{c|}{No}  & \multicolumn{2}{c|}{Yes}                          \\ \midrule
Intercept                               & 92.71*** & -0.78                 & 98.5***      & -0.54      & 98.81***             & -2.09                 & 95.56*** & -1.01                 & 97.28***      & -0.89     & 91.46***             & \multicolumn{1}{c|}{-1.20} \\
N                                     & \multicolumn{2}{c|}{8287}        & \multicolumn{2}{c|}{8287} & \multicolumn{2}{c|}{8287}                    & \multicolumn{2}{c|}{7311}        & \multicolumn{2}{c|}{7311} & \multicolumn{2}{c|}{7311}     \\ \midrule \bottomrule
\end{tabular}
\end{sidewaystable}

\lipsum[3-5]

\end{document}

enter image description here

If you insist on using multicols environment, there is a solution that you can find in this answer.