![重新缩放表格](https://linux22.com/image/442745/%E9%87%8D%E6%96%B0%E7%BC%A9%E6%94%BE%E8%A1%A8%E6%A0%BC.png)
我想重新调整此表的大小,因为我希望它适合一页,但出于某种原因,它无法适应,并且会给出错误。我尝试使用\scalebox{0.5}
我用于另一张表的方法,但它不起作用。
\begin{table}[h]
\centering
\caption{Panel A}
\begin{tabular}{l*{2}{c}}
\hline\hline
&\multicolumn{1}{c}{(1)}&\multicolumn{1}{c}{(2)}\\
\hline
Highest schooling attained& -0.00577 & -0.00835 \\
& (0.0109) & (0.0108) \\
Husband's highest schooling attained (reported by wife)& 0.0151 & 0.0167 \\
& (0.0145) & (0.0145) \\
Ideal number of children& 0.00757 & 0.00803 \\
& (0.0292) & (0.0292) \\
Age & 0.00192 & 0.00132 \\
& (0.0110) & (0.0110) \\
Husband's age (reported by wife)& 0.00393 & 0.00467 \\
& (0.0120) & (0.0120) \\
Husband's ideal number of children (reported by wife)& -0.0225 & -0.0220 \\
& (0.0203) & (0.0203) \\
Has ever used a modern contraceptive method& -0.0181 & 0.00141 \\
& (0.102) & (0.101) \\
Wife has monthly income& -0.0735 & -0.0748 \\
& (0.129) & (0.129) \\
Wife knows when she is most fertile& 0.0917 & 0.0965 \\
& (0.0817) & (0.0816) \\
Wife wants to become pregnant in following 2 years& 0.00457 & -0.00293 \\
& (0.0664) & (0.0657) \\
Age wife married& 0.00758 & 0.00787 \\
& (0.00948) & (0.00947) \\
Catholic & -0.00748 & -0.00580 \\
& (0.0658) & (0.0657) \\
Comparison of happiness with other women in region\\(1=very unhappy, 5=very happy)& 0.00915 & 0.0119 \\
& (0.0353) & (0.0352) \\
Comparison of health with other women in region\\(1=very poor, 5=excellent)& 0.00229 & -0.00611 \\
& (0.0406) & (0.0403) \\
Number of years respondent lived in Lusaka& 0.000733 & 0.000546 \\
& (0.00256) & (0.00255) \\
Couple has electricity& 0.00826 & 0.00748 \\
& (0.0574) & (0.0569) \\
Formally married& 0.0388 & 0.0233 \\
& (0.0930) & (0.0916) \\
Number of days in past 7 days couple has sex& 0.0194 & 0.0174 \\
& (0.0256) & (0.0256) \\
Number of days in past month couple has sex& -0.00292 & -0.00287 \\
& (0.00786) & (0.00785) \\
Number of children husband has with other women& -0.00612 & -0.000674 \\
& (0.0676) & (0.0674) \\
Frequency at which couple has talked about contraception in last year& 0.0137 & 0.0112 \\
& (0.0267) & (0.0266) \\
Couple has ever disagreed on number of children& 0.0559 & 0.0559 \\
& (0.0824) & (0.0824) \\
Couple has ever disagreed on contraception use& -0.0699 & -0.0682 \\
& (0.0909) & (0.0908) \\
Have used contraceptive method without husband's knowledge& 0.00117 & -0.00202 \\
& (0.0875) & (0.0874) \\
Husband drinks at least 2 to 3 times a week& -0.00806 & -0.00576 \\
& (0.0553) & (0.0552) \\
f29 & -0.0802 & -0.0819 \\
& (0.0580) & (0.0579) \\
Wife ever pressured to have sex& 0.0549 & 0.0560 \\
& (0.0623) & (0.0621) \\
Husband does budgeting& 0.0193 & 0.0141 \\
& (0.0818) & (0.0817) \\
Husband decides major purchases& 0.0404 & 0.0421 \\
& (0.0632) & (0.0631) \\
cons & 0.286 & 0.303 \\
& (0.321) & (0.321) \\
\hline
\(N\) & 423 & 426 \\
\hline\hline
\multicolumn{2}{l}{\footnotesize Standard errors in parentheses}\\
\multicolumn{2}{l}{\footnotesize * \(p<0.05\), ** \(p<0.01\), *** \(p<0.001\)}\\
\end{tabular}
\end{table}
这是我在其他方面使用的
\begin{table}[htbp]
\centering
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\caption{Summary Statistics for Final Sample \label{tab:tab2}} \scalebox{0.5}{\begin{tabular}{l c*{6}{c}} \hline
&\multicolumn{3}{c}{Individual Treatment} &\multicolumn{2}{c}\\\cmidrule(lr){2-4}
&\multicolumn{1}{c}{(1)}&\multicolumn{1}{c}{(2)}\\
\toprule \multicolumn{6}{l}{\textbf{Panel B}} \\ \midrule
Using any method at baseline& -0.0613 & -0.0444 \\
& (0.0820) & (0.0810) \\
Number of living children& 0.0143 & 0.0133 \\
& (0.0276) & (0.0276) \\
Using injectable at baseline& -0.151 & -0.153 \\
& (0.384) & (0.384) \\
\hline\hline
\multicolumn{11}{l}{\footnotesize Standard errors in parentheses}\\
\multicolumn{11}{l}{\footnotesize \sym{*} \(p<0.05\), \sym{**} \(p<0.01\), \sym{***} \(p<0.001\)}\\
\end{tabular}}
\end{table}
答案1
您的表格太长,无法在一页上显示。如果您减小表格中使用的字体大小,那么读者阅读表格就会变得越来越困难。
基本上,您的表格中有太多条目。将其重新设计为两个(或更多)表格,每个表格都适合一页。我还没有详细研究过您的表格,但它似乎连接了几个主题;您能把它们分开吗?也许分成“面板 A”和“面板 A(续)” --- GOM
答案2
半年后(我之前没有注意到这个问题)......
当前格式的第一个表格太长,无法放在一页上。如果您愿意将标准误差写在单独的列中,并将小数位数四舍五入为(合理的)三位,那么使用正常字体大小就可以将其放在一页上。
通过使用tabularray
带有库的包booktabs
和siunitx
(加载同名的包),您的表的 MWE 可以如下所示:
\documentclass{article}
\usepackage[margin=25mm]{geometry}
\usepackage{tabularray}
\UseTblrLibrary{siunitx,booktabs}
\ExplSyntaxOn
\NewChildSelector {eachfour}
{
\int_step_inline:nnnn {2} {4} { \l_tblr_childs_total_tl }
{ \clist_put_right:Nn \l_tblr_childs_clist {##1} }
}
\ExplSyntaxOff
\usepackage{lipsum}
\begin{document}
%\lipsum[55]
\begin{table}
\sisetup{
input-open-uncertainty={},
input-close-uncertainty={},
table-align-text-before=false,
table-align-text-after=false,
round-mode=places,
round-precision=3,
table-format={(}-1.3{)}
}
\begin{talltblr}[
caption = {Panel A},
label = {tab:???},
note{} = {Standard errors in parentheses:\newline
*: \(p<0.10\),\quad
**: \(p<0.05\),\quad
***: \(p<0.01\).
}
]{
colsep = 3pt,
colspec = { X[2.8,l,m, font=\linespread{0.84}\selectfont]
*{4}{X[0.8, c, si]}
},
row{1} = {font=\small\bfseries},
hline{eachfour} = {1-5}{0.2pt,dashed},
}
\toprule
&\SetCell[c=2]{c} {{{(1)}}}
& &\SetCell[c=2]{c} {{{(2)}}}
& \\
\cmidrule[r]{1-1}
\cmidrule[l]{2-3}
\cmidrule[l]{4-5}
Highest schooling attained
& -0.00577 & (0.0109) & -0.00835 & (0.0108) \\
Husband's highest schooling attained (reported by wife)
& 0.0151 & (0.0145) & 0.0167 & (0.0145) \\
Ideal number of children
& 0.00757 & (0.0292) & 0.00803 & (0.0292) \\
Age & 0.00192 & (0.0110) & 0.00132 & (0.0110) \\
Husband's age (reported by wife)
& 0.00393 & (0.0120) & 0.00467 & (0.0120) \\
Husband's ideal number of children (reported by wife)
& -0.0225 & (0.0203) & -0.0220 & (0.0203) \\
Has ever used a modern contraceptive method
& -0.0181 & (0.102) & 0.00141 & (0.101) \\
Wife has monthly income
& -0.0735 & (0.129) & -0.0748 & (0.129) \\
Wife knows when she is most fertile
& 0.0917 & (0.0817) & 0.0965 & (0.0816) \\
Wife wants to become pregnant in following 2 years
& 0.00457 & (0.0664) & -0.00293 & (0.0657) \\
Age wife married
& 0.00758 & (0.00948) & 0.00787 & (0.00947) \\
Catholic
& -0.00748 & (0.0658) & -0.00580 & (0.0657) \\
Comparison of happiness with other women in region (1=very unhappy, 5=very happy)
& 0.00915 & (0.0353) & 0.0119 & (0.0352) \\
Comparison of health with other women in region (1=very poor, 5=excellent)
& 0.00229 & (0.0406) & -0.00611 & (0.0403) \\
Number of years respondent lived in Lusaka
& 0.000733 & (0.00256) & 0.000546 & (0.00255) \\
Couple has electricity
& 0.00826 & (0.0574) & 0.00748 & (0.0569) \\
Formally married
& 0.0388 & (0.0930) & 0.0233 & (0.0916) \\
Number of days in past 7 days couple has sex
& 0.0194 & (0.0256) & 0.0174 & (0.0256) \\
Number of days in past month couple has sex
& -0.00292 & (0.00786) & -0.00287 & (0.00785) \\
Number of children husband has with other women
& -0.00612 & (0.0676) & -0.000674 & (0.0674) \\
Frequency at which couple has talked about contraception in last year
& 0.0137 & (0.0267) & 0.0112 & (0.0266) \\
Couple has ever disagreed on number of children
& 0.0559 & (0.0824) & 0.0559 & (0.0824) \\
Couple has ever disagreed on contraception use
& -0.0699 & (0.0909) & -0.0682 & (0.0908) \\
Have used contraceptive method without husband's knowledge
& 0.00117 & (0.0875) & -0.00202 & (0.0874) \\
Husband drinks at least 2 to 3 times a week
& -0.00806 & (0.0553) & -0.00576 & (0.0552) \\
f29 & -0.0802 & (0.0580) & -0.0819 & (0.0579) \\
Wife ever pressured to have sex
& 0.0549 & (0.0623) & 0.0560 & (0.0621) \\
Husband does budgeting
& 0.0193 & (0.0818) & 0.0141 & (0.0817) \\
Husband decides major purchases
& 0.0404 & (0.0632) & 0.0421 & (0.0631) \\
cons
& 0.286 & (0.321) & 0.303 & (0.321) \\
\midrule
\(N\)
& {423} & & {426} & \\
\bottomrule
\end{talltblr}
\end{table}
\end{document}
同时,第一个表格的结构及其内容清晰,第二个表格则完全不清楚。因此,对它的建议是基于猜测的(可能完全错误)。无论如何,给出的是框架,可以(希望)轻松插入正确的内容:
\documentclass{article}
\usepackage[margin=25mm]{geometry}
\usepackage{tabularray}
\UseTblrLibrary{siunitx,booktabs}
\begin{document}
\begin{table}[htbp]
\sisetup{
input-open-uncertainty={},
input-close-uncertainty={},
table-align-text-before=false,
table-align-text-after=false,
round-mode=places,
round-precision=3,
table-format={(}-1.3{)}
}
\begin{talltblr}[
caption = {Panel B},
label = {tab:?},
note{} = {Standard errors in parentheses:\newline
*: \(p<0.10\),\quad
**: \(p<0.05\),\quad
***: \(p<0.01\).
}
]{
colsep = 3pt,
colspec = { X[2.8,l,m, font=\linespread{0.84}\selectfont]
*{6}{X[0.8, c, si]}
},
row{1} = {font=\small\bfseries},
}
\toprule
&\SetCell[c=4]{c} {{{Individual Treatment}}}
& & & &\SetCell[c=2]{c} {{{missing}}}
& \\
\cmidrule[r]{2-5}
\cmidrule[l]{6-7}
&\SetCell[c=2]{c} {{{(1)}}}
& &\SetCell[c=2]{c} {{{(2)}}}
& & {{{?}}}
& {{{?}}} \\
\cmidrule[r]{1-1}
\cmidrule[l]{2-3}
\cmidrule[l]{4-5}
\cmidrule[l]{6-7}
Using any method at baseline
& -0.0613 & (0.0820) & -0.0444 & (0.0810) & & \\
Number of living children
& 0.0143 & (0.0276) & 0.0133 & (0.0276) & & \\
Using injectable at baseline
& -0.151 & (0.384) & -0.153 & (0.384) & & \\
\bottomrule
\end{talltblr}
\end{table}
\end{document}
笔记:这两个 MWE 都已使用 2022A tabularray 版本进行了测试。几天后,2022B 的新版本将推出,它具有新功能,其中包括允许您为列标题编写更简单的代码。
不幸的是,软件包版本 2022A 在 Overleaf 上仍然不可用。
答案3
我没有问题来扩展您的第一个例子:
\begin{table}[h]
\centering
\caption{Panel A}
\scalebox{0.5}{\begin{tabular}{l*{2}{c}}
\hline\hline
&\multicolumn{1}{c}{(1)}&\multicolumn{1}{c}{(2)}\\
\hline
Highest schooling attained& -0.00577 & -0.00835 \\
& (0.0109) & (0.0108) \\
Husband's highest schooling attained (reported by wife)& 0.0151 & 0.0167 \\
& (0.0145) & (0.0145) \\
Ideal number of children& 0.00757 & 0.00803 \\
& (0.0292) & (0.0292) \\
Age & 0.00192 & 0.00132 \\
& (0.0110) & (0.0110) \\
Husband's age (reported by wife)& 0.00393 & 0.00467 \\
& (0.0120) & (0.0120) \\
Husband's ideal number of children (reported by wife)& -0.0225 & -0.0220 \\
& (0.0203) & (0.0203) \\
Has ever used a modern contraceptive method& -0.0181 & 0.00141 \\
& (0.102) & (0.101) \\
Wife has monthly income& -0.0735 & -0.0748 \\
& (0.129) & (0.129) \\
Wife knows when she is most fertile& 0.0917 & 0.0965 \\
& (0.0817) & (0.0816) \\
Wife wants to become pregnant in following 2 years& 0.00457 & -0.00293 \\
& (0.0664) & (0.0657) \\
Age wife married& 0.00758 & 0.00787 \\
& (0.00948) & (0.00947) \\
Catholic & -0.00748 & -0.00580 \\
& (0.0658) & (0.0657) \\
Comparison of happiness with other women in region\\(1=very unhappy, 5=very happy)& 0.00915 & 0.0119 \\
& (0.0353) & (0.0352) \\
Comparison of health with other women in region\\(1=very poor, 5=excellent)& 0.00229 & -0.00611 \\
& (0.0406) & (0.0403) \\
Number of years respondent lived in Lusaka& 0.000733 & 0.000546 \\
& (0.00256) & (0.00255) \\
Couple has electricity& 0.00826 & 0.00748 \\
& (0.0574) & (0.0569) \\
Formally married& 0.0388 & 0.0233 \\
& (0.0930) & (0.0916) \\
Number of days in past 7 days couple has sex& 0.0194 & 0.0174 \\
& (0.0256) & (0.0256) \\
Number of days in past month couple has sex& -0.00292 & -0.00287 \\
& (0.00786) & (0.00785) \\
Number of children husband has with other women& -0.00612 & -0.000674 \\
& (0.0676) & (0.0674) \\
Frequency at which couple has talked about contraception in last year& 0.0137 & 0.0112 \\
& (0.0267) & (0.0266) \\
Couple has ever disagreed on number of children& 0.0559 & 0.0559 \\
& (0.0824) & (0.0824) \\
Couple has ever disagreed on contraception use& -0.0699 & -0.0682 \\
& (0.0909) & (0.0908) \\
Have used contraceptive method without husband's knowledge& 0.00117 & -0.00202 \\
& (0.0875) & (0.0874) \\
Husband drinks at least 2 to 3 times a week& -0.00806 & -0.00576 \\
& (0.0553) & (0.0552) \\
f29 & -0.0802 & -0.0819 \\
& (0.0580) & (0.0579) \\
Wife ever pressured to have sex& 0.0549 & 0.0560 \\
& (0.0623) & (0.0621) \\
Husband does budgeting& 0.0193 & 0.0141 \\
& (0.0818) & (0.0817) \\
Husband decides major purchases& 0.0404 & 0.0421 \\
& (0.0632) & (0.0631) \\
cons & 0.286 & 0.303 \\
& (0.321) & (0.321) \\
\hline
\(N\) & 423 & 426 \\
\hline\hline
\multicolumn{2}{l}{\footnotesize Standard errors in parentheses}\\
\multicolumn{2}{l}{\footnotesize * \(p<0.05\), ** \(p<0.01\), *** \(p<0.001\)}\\
\end{tabular}
}
\end{table}
第二张表中有3个错误:
在第二个 \multicolumn 命令中缺少第三个参数。
和 3. 在最后两个 \multicolumn 命令中您写入 11,但您只定义了 8 列。
这对我行得通:
\begin{table}[htbp]
\centering
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\caption{Summary Statistics for Final Sample \label{tab:tab2}} \scalebox{0.5}{\begin{tabular}{l c*{6}{c}} \hline
&\multicolumn{3}{c}{Individual Treatment} &\multicolumn{2}{c}{missing}\\\cmidrule(lr){2-4}
&\multicolumn{1}{c}{(1)}&\multicolumn{1}{c}{(2)}\\
\toprule \multicolumn{6}{l}{\textbf{Panel B}} \\ \midrule
Using any method at baseline& -0.0613 & -0.0444 \\
& (0.0820) & (0.0810) \\
Number of living children& 0.0143 & 0.0133 \\
& (0.0276) & (0.0276) \\
Using injectable at baseline& -0.151 & -0.153 \\
& (0.384) & (0.384) \\
\hline\hline
\multicolumn{8}{l}{\footnotesize Standard errors in parentheses}\\ % changed to 8 columns
\multicolumn{8}{l}{\footnotesize \sym{*} \(p<0.05\), \sym{**} \(p<0.01\), \sym{***} \(p<0.001\)}\\ % changed to 8 columns
\end{tabular}}
\end{table}
答案4
您想在表格中塞入太多内容。无论如何,如果字体大小减小,则此内容可以适合标准文本高度。
一些描述被分成两行,第二行缩进以表明它是上面一行的延续。
我用来siunitx
对齐图形并booktabs
获得更好看的规则。
\documentclass{article}
\usepackage{siunitx,booktabs}
\usepackage{caption}
\begin{document}
\begin{table}[htp]
\centering
\scriptsize
\sisetup{
input-open-uncertainty={},
input-close-uncertainty={},
table-align-text-before=false,
table-align-text-after=false,
group-digits=none,
}
\newcommand{\splitcell}[1]{%
\smash{\begin{tabular}[t]{@{\qquad}l@{}}\hspace*{-2em}#1\end{tabular}}%
}
\caption{Panel A}
\begin{tabular}{
@{}
l
S[table-format={(}-1.6{)}]
S[table-format={(}-1.6{)}]
@{}
}
\toprule
& {(1)} & {(2)} \\
\midrule
Highest schooling attained
& -0.00577 & -0.00835 \\
& (0.0109) & (0.0108) \\
\splitcell{Husband's highest schooling attained \\ (reported by wife)}
& 0.0151 & 0.0167 \\
& (0.0145) & (0.0145) \\
Ideal number of children
& 0.00757 & 0.00803 \\
& (0.0292) & (0.0292) \\
Age
& 0.00192 & 0.00132 \\
& (0.0110) & (0.0110) \\
\splitcell{Husband's age \\ (reported by wife)}
& 0.00393 & 0.00467 \\
& (0.0120) & (0.0120) \\
\splitcell{Husband's ideal number of children \\ (reported by wife)}
& -0.0225 & -0.0220 \\
& (0.0203) & (0.0203) \\
\splitcell{Has ever used a modern \\ contraceptive method}
& -0.0181 & 0.00141 \\
& (0.102) & (0.101) \\
Wife has monthly income
& -0.0735 & -0.0748 \\
& (0.129) & (0.129) \\
Wife knows when she is most fertile
& 0.0917 & 0.0965 \\
& (0.0817) & (0.0816) \\
\splitcell{Wife wants to become pregnant \\ in following 2 years}
& 0.00457 & -0.00293 \\
& (0.0664) & (0.0657) \\
Age wife married
& 0.00758 & 0.00787 \\
& (0.00948) & (0.00947) \\
Catholic
& -0.00748 & -0.00580 \\
& (0.0658) & (0.0657) \\
\splitcell{Comparison of happiness with other women \\ in region (1=very unhappy, 5=very happy)}
& 0.00915 & 0.0119 \\
& (0.0353) & (0.0352) \\
\splitcell{Comparison of health with other women \\ in region (1=very poor, 5=excellent)}
& 0.00229 & -0.00611 \\
& (0.0406) & (0.0403) \\
Number of years respondent lived in Lusaka
& 0.000733 & 0.000546 \\
& (0.00256) & (0.00255) \\
Couple has electricity
& 0.00826 & 0.00748 \\
& (0.0574) & (0.0569) \\
Formally married
& 0.0388 & 0.0233 \\
& (0.0930) & (0.0916) \\
Number of days in past 7 days couple has sex
& 0.0194 & 0.0174 \\
& (0.0256) & (0.0256) \\
Number of days in past month couple has sex
& -0.00292 & -0.00287 \\
& (0.00786) & (0.00785) \\
\splitcell{Number of children husband \\ has with other women}
& -0.00612 & -0.000674 \\
& (0.0676) & (0.0674) \\
\splitcell{Frequency at which couple has talked \\ about contraception in last year}
& 0.0137 & 0.0112 \\
& (0.0267) & (0.0266) \\
\splitcell{Couple has ever disagreed \\ on number of children}
& 0.0559 & 0.0559 \\
& (0.0824) & (0.0824) \\
\splitcell{Couple has ever disagreed \\ on contraception use}
& -0.0699 & -0.0682 \\
& (0.0909) & (0.0908) \\
\splitcell{Have used contraceptive method \\ without husband's knowledge}
& 0.00117 & -0.00202 \\
& (0.0875) & (0.0874) \\
Husband drinks at least 2 to 3 times a week
& -0.00806 & -0.00576 \\
& (0.0553) & (0.0552) \\
f29
& -0.0802 & -0.0819 \\
& (0.0580) & (0.0579) \\
Wife ever pressured to have sex
& 0.0549 & 0.0560 \\
& (0.0623) & (0.0621) \\
Husband does budgeting
& 0.0193 & 0.0141 \\
& (0.0818) & (0.0817) \\
Husband decides major purchases
& 0.0404 & 0.0421 \\
& (0.0632) & (0.0631) \\
cons
& 0.286 & 0.303 \\
& (0.321) & (0.321) \\
\midrule
\(N\) & {423} & {426} \\
\midrule[\heavyrulewidth]
\multicolumn{3}{@{}l@{}}{Standard errors in parentheses}
% * \(p<0.05\), ** \(p<0.01\), *** \(p<0.001\)}\\
\end{tabular}
\end{table}
\end{document}
我省略了最后一行页值,因为表中没有出现星号。
也许将表格分成两半并将它们打印在对页的顶部会更好。