抱歉,这个问题可能有点愚蠢,但我已经花了好几个小时才弄清楚我做错了什么,但仍然没有答案。我有一张很长的表格,我想用 \resizebox 把它放到一个页面中,但是表格可以识别这个命令,下面的注释却不能。我该如何将表格注释放在表格下面?非常感谢。
\documentclass[12pt, italian english]{article}
\begin{document}
\begin{table}[h!]
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\hypertarget{table4}{\caption{Main table results, local level}}
\begin{threeparttable}[b]
\begin{center}
\resizebox{!}{.35\paperheight}{%
\begin{tabular}{l*{2}{c}}
\hline\hline
&\multicolumn{1}{c}{Local level}&\multicolumn{1}{c}{Long table results}\\
&\multicolumn{1}{c}{(1)}&\multicolumn{1}{c}{(2)}\\
\hline
A & 0.0266\sym{**} & 0.0282\sym{**} \\
& (2.01) & (2.12) \\
[1em]
B & 0.0253\sym{***}& 0.0254\sym{***}\\
& (4.55) & (4.55) \\
[1em]
C & -0.0436\sym{*} & -0.0419\sym{*} \\
& (-1.94) & (-1.85) \\
[1em]
D & -0.0362 &
-0.0359 \\
& (-1.31) & (-1.30) \\
[1em]
E\\
[1em]
E1 & -0.0784\sym{*} & . \\
& (-1.82) & . \\
[1em]
E2 & -0.0144 & . \\
& (-0.35) & . \\
[1em]
F\\
[1em]
F1 & . & -0.0766 \\
& . & (-1.47) \\
[1em]
F2 & . & -0.125\sym{**} \\
& . & (-2.34) \\
[1em]
F3 & . & -0.00966 \\
& . & (-0.15) \\
[1em]
F4 & . & -0.158\sym{*} \\
& . & (-1.67) \\
[1em]
F5 & . & -0.117 \\
& . & (-1.24) \\
[1em]
F6 & . & -0.118 \\
& . & (-0.79) \\
[1em]
F7& . & -0.112 \\
& . & (-1.58) \\
[1em]
Constant & 0.334\sym{**} & 0.391\sym{**} \\
& (1.99) & (2.26) \\
[1em]
\textsc{Controls}: & & \\
Population & \textsc{Yes} & \textsc{Yes}\\
Province & \textsc{Yes} & \textsc{Yes}\\
Other controls & \textsc{Yes} &\textsc{Yes}\\
[1em]
\textsc{Ref. Category} & &\\
E:& E3 & .\\
D & D2 & D2\\
F & . & F8\\
\hline
Observations & 388 & 388 \\
\hline\hline
\multicolumn{3}{l}{\footnotesize \textit{t} statistics in parentheses}\\
\multicolumn{3}{l}{\footnotesize \sym{*} \(p<0.1\), \sym{**} \(p<0.05\), \sym{***} \(p<0.01\)}\\
\end{tabular}}
\end{center}
\begin{tablenotes}
\scriptsize
\item Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse faucibus nunc vitae vulputate aliquet. Nam bibendum dui at sem dapibus, nec tincidunt turpis malesuada. Sed porta, tellus eu hendrerit eleifend, nisi metus maximus nisi, et posuere neque ligula eu neque. Sed nec erat lobortis, auctor magna sit amet, scelerisque augue. Vestibulum placerat blandit elementum. Pellentesque convallis ante vel tincidunt placerat. Phasellus facilisis consectetur rutrum. Mauris gravida purus magna, in vehicula ipsum cursus nec. Nunc rutrum porta dolor, id congue odio consectetur sit amet. Ut pellentesque odio quis mauris maximus, ut tempus felis posuere. Fusce eleifend iaculis nisl, quis pellentesque mauris fermentum id.
\end{tablenotes}
\end{threeparttable}
\end{table}
\end{document}
答案1
此解决方案将调整大小的表格放在虚拟表格内,该虚拟表格用于确定表格注释的宽度。由于它们已经是\scriptsize
,我希望您不会再缩小它们了。
\documentclass[12pt, italian english]{article}
\usepackage{threeparttable}
\usepackage{graphicx}
\usepackage{hyperref}
\newlength{\tempdima}
\begin{document}
\begin{table}[htp]
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\hypertarget{table4}{\caption{Main table results, local level}}
\centering
\begin{threeparttable}[b]
\begin{tabular}{@{}c@{}}
\resizebox{!}{.35\textheight}{\begin{tabular}{l*{2}{c}}
\hline\hline
&\multicolumn{1}{c}{Local level}&\multicolumn{1}{c}{Long table results}\\
&\multicolumn{1}{c}{(1)}&\multicolumn{1}{c}{(2)}\\
\hline
A & 0.0266\sym{**} & 0.0282\sym{**} \\
& (2.01) & (2.12) \\
[1em]
B & 0.0253\sym{***}& 0.0254\sym{***}\\
& (4.55) & (4.55) \\
[1em]
C & -0.0436\sym{*} & -0.0419\sym{*} \\
& (-1.94) & (-1.85) \\
[1em]
D & -0.0362 &
-0.0359 \\
& (-1.31) & (-1.30) \\
[1em]
E\\
[1em]
E1 & -0.0784\sym{*} & . \\
& (-1.82) & . \\
[1em]
E2 & -0.0144 & . \\
& (-0.35) & . \\
[1em]
F\\
[1em]
F1 & . & -0.0766 \\
& . & (-1.47) \\
[1em]
F2 & . & -0.125\sym{**} \\
& . & (-2.34) \\
[1em]
F3 & . & -0.00966 \\
& . & (-0.15) \\
[1em]
F4 & . & -0.158\sym{*} \\
& . & (-1.67) \\
[1em]
F5 & . & -0.117 \\
& . & (-1.24) \\
[1em]
F6 & . & -0.118 \\
& . & (-0.79) \\
[1em]
F7& . & -0.112 \\
& . & (-1.58) \\
[1em]
Constant & 0.334\sym{**} & 0.391\sym{**} \\
& (1.99) & (2.26) \\
[1em]
\textsc{Controls}: & & \\
Population & \textsc{Yes} & \textsc{Yes}\\
Province & \textsc{Yes} & \textsc{Yes}\\
Other controls & \textsc{Yes} &\textsc{Yes}\\
[1em]
\textsc{Ref. Category} & &\\
E:& E3 & .\\
D & D2 & D2\\
F & . & F8\\
\hline
Observations & 388 & 388 \\
\hline\hline
\multicolumn{3}{l}{\footnotesize \textit{t} statistics in parentheses}\\
\multicolumn{3}{l}{\footnotesize \sym{*} \(p<0.1\), \sym{**} \(p<0.05\), \sym{***} \(p<0.01\)}\\
\end{tabular}}
\end{tabular}
\begin{tablenotes}
\scriptsize
\item Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse faucibus nunc vitae vulputate aliquet. Nam bibendum dui at sem dapibus, nec tincidunt turpis malesuada. Sed porta, tellus eu hendrerit eleifend, nisi metus maximus nisi, et posuere neque ligula eu neque. Sed nec erat lobortis, auctor magna sit amet, scelerisque augue. Vestibulum placerat blandit elementum. Pellentesque convallis ante vel tincidunt placerat. Phasellus facilisis consectetur rutrum. Mauris gravida purus magna, in vehicula ipsum cursus nec. Nunc rutrum porta dolor, id congue odio consectetur sit amet. Ut pellentesque odio quis mauris maximus, ut tempus felis posuere. Fusce eleifend iaculis nisl, quis pellentesque mauris fermentum id.
\end{tablenotes}
\end{threeparttable}
\end{table}
\end{document}