如何使用命令 \rotatebox 和 \begin{subtable} 将两个转置的表格放在一起

如何使用命令 \rotatebox 和 \begin{subtable} 将两个转置的表格放在一起

大家好。提前感谢你们的帮助!我试图将两个长表格放在一页上,我的代码如下,但它不起作用。我试图自己弄清楚,但失败了……

\documentclass[12pt]{article}
\usepackage{subcaption}
\usepackage{rotating} 

\begin{table}
\begin{subtable}[t]{0.2\textwidth}
\scalebox{0.7}{\Rotatebox{90}{%
\begin{tabular}{lcccccccccc} \hline
 & (1) & (2) & (3) & (4) & (5) & (6) & (7) & (8) & (9) & (10) \\
VARIABLES & Age & Sex & Mstatus & Education & Famsize & IHSincome & droughtdummy & buyIBIdummy & Cultlandsize10\_a & HaveSaving12\_a \\ \hline
\\
\multicolumn{11}{c}{ Panel A: aggregate treatment} \\
treatment & -0.159 & -0.049 & 0.011 & -0.281 & 0.212 & 0.192 & -0.072 & 0.040 & -0.455 & -0.029 \\
 & (1.088) & (0.064) & (0.018) & (0.367) & (0.242) & (0.511) & (0.044) & (0.038) & (0.605) & (0.052) \\
  R-squared & 0.000 & 0.006 & 0.004 & 0.006 & 0.008 & 0.002 & 0.028 & 0.012 & 0.006 & 0.003 \\ 
\\
\multicolumn{11}{c}{ Panel B two separate treatment} \\
randomgr1\_2 & -0.416 & -0.038 & 0.018 & -0.286 & 0.318 & 0.481 & -0.063 & 0.001 & 0.145 & -0.042 \\
 & (1.307) & (0.077) & (0.022) & (0.529) & (0.290) & (0.611) & (0.053) & (0.045) & (0.718) & (0.062) \\
randomgr1\_3 & 0.145 & -0.061 & 0.002 &  0.126 & 0.086 & -0.152 & -0.082 & 0.087* & -1.169 & -0.013 \\
 & (1.386) & (0.081) & (0.023) & (0.467) & (0.307) & (0.648) & (0.056) & (0.047) & (0.762) & (0.066) \\
 &  &  &  &  &  &  &  &  &  &  \\
R-squared & 0.002 & 0.007 & 0.008 & 0.009 & 0.013 & 0.010 & 0.029 & 0.039 & 0.031 & 0.005 \\ 
Observations & 94 & 94 & 94 & 94 & 94 & 94 & 94 & 94 & 94 & 94 \\\hline
\multicolumn{11}{l}{ Standard errors in parentheses} \\
\multicolumn{11}{l}{ *** p$<$0.01, ** p$<$0.05, * p$<$0.1} \\
\end{tabular}}}%
\caption{\footnotesize 1}
\label{tab:table1_a}
\end{subtable}

\hspace{\fill}

\begin{subtable}[t]{0.2\textwidth}
\flushright
\scalebox{0.7}{\Rotatebox{90}{%
\begin{tabular}{lcccccccccc} \hline
 & (1) & (2) & (3) & (4) & (5) & (6) & (7) & (8) & (9) & (10) \\
VARIABLES & Age & Sex & Mstatus & Education & Famsize & IHSincome & droughtdummy & buyIBIdummy & Cultlandsize10\_a & HaveSaving12\_a \\ \hline
\\
\multicolumn{11}{c}{ Panel A: aggregate treatment} \\
treatment & -0.159 & -0.049 & 0.011 & -0.281 & 0.212 & 0.192 & -0.072 & 0.040 & -0.455 & -0.029 \\
 & (1.088) & (0.064) & (0.018) & (0.367) & (0.242) & (0.511) & (0.044) & (0.038) & (0.605) & (0.052) \\
  R-squared & 0.000 & 0.006 & 0.004 & 0.006 & 0.008 & 0.002 & 0.028 & 0.012 & 0.006 & 0.003 \\ 
\\
\multicolumn{11}{c}{ Panel B two separate treatment} \\
randomgr1\_2 & -0.416 & -0.038 & 0.018 & -0.286 & 0.318 & 0.481 & -0.063 & 0.001 & 0.145 & -0.042 \\
 & (1.307) & (0.077) & (0.022) & (0.529) & (0.290) & (0.611) & (0.053) & (0.045) & (0.718) & (0.062) \\
randomgr1\_3 & 0.145 & -0.061 & 0.002 &  0.126 & 0.086 & -0.152 & -0.082 & 0.087* & -1.169 & -0.013 \\
 & (1.386) & (0.081) & (0.023) & (0.467) & (0.307) & (0.648) & (0.056) & (0.047) & (0.762) & (0.066) \\
 &  &  &  &  &  &  &  &  &  &  \\
R-squared & 0.002 & 0.007 & 0.008 & 0.009 & 0.013 & 0.010 & 0.029 & 0.039 & 0.031 & 0.005 \\ 
Observations & 94 & 94 & 94 & 94 & 94 & 94 & 94 & 94 & 94 & 94 \\\hline
\multicolumn{11}{l}{ Standard errors in parentheses} \\
\multicolumn{11}{l}{ *** p$<$0.01, ** p$<$0.05, * p$<$0.1} \\
\end{tabular}}}%
\caption{\footnotesize 2}
\label{tab:table1_b}
\end{subtable}

\caption{\footnotesize 1}
\label{tab:table1}
\end{table}
\end{document}

答案1

我会使用\subcaptionbox\rotatebox与交换\scalebox

重要的是不要在子表之间留下空行。

\documentclass[12pt]{article}
\usepackage{subcaption}
\usepackage{rotating} 

\begin{document}

\begin{table}
\centering

\hspace*{\fill}%
\subcaptionbox{1\label{tab:table1_a}}{%
\rotatebox{90}{\scalebox{0.6}{%
\begin{tabular}{lcccccccccc} \hline
 & (1) & (2) & (3) & (4) & (5) & (6) & (7) & (8) & (9) & (10) \\
VARIABLES & Age & Sex & Mstatus & Education & Famsize & IHSincome & droughtdummy & buyIBIdummy & Cultlandsize10\_a & HaveSaving12\_a \\ \hline
\\
\multicolumn{11}{c}{ Panel A aggregate treatment} \\
treatment & -0.159 & -0.049 & 0.011 & -0.281 & 0.212 & 0.192 & -0.072 & 0.040 & -0.455 & -0.029 \\
 & (1.088) & (0.064) & (0.018) & (0.367) & (0.242) & (0.511) & (0.044) & (0.038) & (0.605) & (0.052) \\
  R-squared & 0.000 & 0.006 & 0.004 & 0.006 & 0.008 & 0.002 & 0.028 & 0.012 & 0.006 & 0.003 \\ 
\\
\multicolumn{11}{c}{ Panel B two separate treatment} \\
randomgr1\_2 & -0.416 & -0.038 & 0.018 & -0.286 & 0.318 & 0.481 & -0.063 & 0.001 & 0.145 & -0.042 \\
 & (1.307) & (0.077) & (0.022) & (0.529) & (0.290) & (0.611) & (0.053) & (0.045) & (0.718) & (0.062) \\
randomgr1\_3 & 0.145 & -0.061 & 0.002 &  0.126 & 0.086 & -0.152 & -0.082 & 0.087* & -1.169 & -0.013 \\
 & (1.386) & (0.081) & (0.023) & (0.467) & (0.307) & (0.648) & (0.056) & (0.047) & (0.762) & (0.066) \\
 &  &  &  &  &  &  &  &  &  &  \\
R-squared & 0.002 & 0.007 & 0.008 & 0.009 & 0.013 & 0.010 & 0.029 & 0.039 & 0.031 & 0.005 \\ 
Observations & 94 & 94 & 94 & 94 & 94 & 94 & 94 & 94 & 94 & 94 \\\hline
\multicolumn{11}{l}{ Standard errors in parentheses} \\
\multicolumn{11}{l}{ *** p$<$0.01, ** p$<$0.05, * p$<$0.1} \\
\end{tabular}}}}%
\hspace*{\fill}%
\subcaptionbox{2\label{tab:table1_b}}{%
\rotatebox{90}{\scalebox{0.6}{%
\begin{tabular}{lcccccccccc} \hline
 & (1) & (2) & (3) & (4) & (5) & (6) & (7) & (8) & (9) & (10) \\
VARIABLES & Age & Sex & Mstatus & Education & Famsize & IHSincome & droughtdummy & buyIBIdummy & Cultlandsize10\_a & HaveSaving12\_a \\ \hline
\\
\multicolumn{11}{c}{ Panel A aggregate treatment} \\
treatment & -0.159 & -0.049 & 0.011 & -0.281 & 0.212 & 0.192 & -0.072 & 0.040 & -0.455 & -0.029 \\
 & (1.088) & (0.064) & (0.018) & (0.367) & (0.242) & (0.511) & (0.044) & (0.038) & (0.605) & (0.052) \\
  R-squared & 0.000 & 0.006 & 0.004 & 0.006 & 0.008 & 0.002 & 0.028 & 0.012 & 0.006 & 0.003 \\ 
\\
\multicolumn{11}{c}{ Panel B two separate treatment} \\
randomgr1\_2 & -0.416 & -0.038 & 0.018 & -0.286 & 0.318 & 0.481 & -0.063 & 0.001 & 0.145 & -0.042 \\
 & (1.307) & (0.077) & (0.022) & (0.529) & (0.290) & (0.611) & (0.053) & (0.045) & (0.718) & (0.062) \\
randomgr1\_3 & 0.145 & -0.061 & 0.002 &  0.126 & 0.086 & -0.152 & -0.082 & 0.087* & -1.169 & -0.013 \\
 & (1.386) & (0.081) & (0.023) & (0.467) & (0.307) & (0.648) & (0.056) & (0.047) & (0.762) & (0.066) \\
 &  &  &  &  &  &  &  &  &  &  \\
R-squared & 0.002 & 0.007 & 0.008 & 0.009 & 0.013 & 0.010 & 0.029 & 0.039 & 0.031 & 0.005 \\ 
Observations & 94 & 94 & 94 & 94 & 94 & 94 & 94 & 94 & 94 & 94 \\\hline
\multicolumn{11}{l}{ Standard errors in parentheses} \\
\multicolumn{11}{l}{ *** p$<$0.01, ** p$<$0.05, * p$<$0.1} \\
\end{tabular}}}}%
\hspace*{\fill}

\caption{1}
\label{tab:table1}
\end{table}
\end{document}

在此处输入图片描述

不要\footnotesize在标题中使用声明;使用包提供的适当设置命令caption(由 自动加载subcaption):类似于

\captionsetup{font=footnotesize}

caption文档前言中的设置即可。其他设置请参阅手册。

相关内容