下表中的间距很奇怪,并且最后两列重叠。你能告诉我为什么吗?
这是简化的代码:
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\caption{Determinants of PMBs\label{Table 3b}}
\begin{tabular}{l
S[table-format=1.3]
S[input-symbols=(), table-format=1.3]
S[table-format=1.3]
S[input-symbols=(), table-format=1.3]}
\toprule
& {(1)} & & {(2)} \\
\midrule
SMD tier & 0.144\sym{**} & (0.062) & 0.144 & (0.150) \\
PR tier & -0.006 & (0.109) & -0.006 & (0.120) \\
Constant & -0.575 & (0.517) & -0.575 & (0.521) \\
\midrule
alpha & 0.319\sym{***}& (0.044) & 0.319\sym{***} & (0.087) \\
N & {3161} & & {3161} & \\
\bottomrule
\multicolumn{3}{l}{\footnotesize Model 1 uses robust se, model 2 clustered at the party group level}\\
\end{tabular}
\end{table}
文件代码
\documentclass [12pt, a4paper, twoside, openright]{book}
\usepackage{polyglossia}
\usepackage{setspace}
\onehalfspacing
\setmainlanguage{english}
\setmainfont{Simoncini Garamond Std}
\usepackage{microtype}
\microtypesetup{final}
\DeclareFieldFormat{pages}{#1}
\usepackage{fontspec}
\usepackage{lipsum}
\usepackage{xpatch}
\usepackage[autostyle,italian=guillemets]{csquotes}
\usepackage{geometry}
\geometry{bindingoffset=1cm}
% pagine e figure
\renewcommand{\floatpagefraction}{.8}%
% horizontal tables
\usepackage{rotating}
% tables
\usepackage{booktabs}
\usepackage{adjustbox}
\renewcommand{\arraystretch}{1.3}
\usepackage[flushleft]{threeparttable}
\usepackage{multirow}
% tables with numbers
\usepackage{siunitx}
\sisetup{output-decimal-marker={.}}
\usepackage{graphicx}
\begin{document}
\mainmatter
\input{Chapters/1}
\end{document}
答案1
table-format=1.3
只为数字保留空间。由于某些列中也有负数,因此您需要用负数-1.3
代替。此外,没有空间放置星号。您可以通过添加table-space-text-post = {\sym{***}}
相应的列来更改此设置。最后,您的表格\multicolumn
只跨越五列中的三列,如果将其中的文本打印在一行中,则比整个表格更宽。如果您用类似的东西替换它,则\multicolumn{5}{p{8.5cm}}
第 3 列和第 4 列之间的大空间将消失,因为它允许文本跨越所有五列,并且如果文本长度超过 8.5 厘米(表格的近似宽度),则会引入自动换行符:
\begin{table}
\centering
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\caption{Determinants of PMBs\label{Table 3b}}
\begin{tabular}{l
S[table-format=-1.3,table-space-text-post = {\sym{***}}]
S[input-symbols=(), table-format=1.3]
S[table-format=-1.3,table-space-text-post = {\sym{***}}]
S[input-symbols=(), table-format=1.3]}
\toprule
& {(1)} & & {(2)} \\
\midrule
SMD tier & 0.144\sym{**} & (0.062) & 0.144 & (0.150) \\
PR tier & -0.006 & (0.109) & -0.006 & (0.120) \\
Constant & -0.575 & (0.517) & -0.575 & (0.521) \\
\midrule
alpha & 0.319\sym{***}& (0.044) & 0.319\sym{***} & (0.087) \\
N & {3161} & & {3161} & \\
\bottomrule
\multicolumn{5}{p{8.5cm}}{\footnotesize Model 1 uses robust se, model 2 clustered at the party group level}\\
\end{tabular}
\end{table}