在两列文章中插入垂直表格

在两列文章中插入垂直表格

我正在写一篇双面格式的文章,我想在其中一列中插入一个垂直表格,这样我就可以在下一列中写出结果。根据这个网页上的几个帖子,我最终非常接近了,因为我在其中一列中得到了表格。然而,我无法将文本放在下一列,因为文本会跳转到下一页。

我有一篇用 twoside 编写的整篇文章,因此我宁愿继续使用 twoside 而不是改为 twocolumns。

这是我正在做的事情的一个例子:

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

任何帮助都将受到赞赏。

谢谢。

答案1

您当前的格式有几个问题。如果您的整个文档都是双列的,我建议您放弃使用多列的想法,而是尝试使用 twocolumndocumentclass 的选项。这意味着:\documentclass[twoside, twocolumn]{article}。完成此操作后,您只需从切换sidewaystable*sidewaystable,就可以了。

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

在此处输入图片描述

如果你坚持使用multicols环境,那么你可以在此找到解决方案回答

相关内容