\documentclass[a4paper,12pt]{report}
\usepackage{graphicx,rotating}
\usepackage{multirow}
\usepackage{siunitx,booktabs}%for table decimals number
\sisetup{separate-uncertainty}%
\usepackage[export]{adjustbox}
\usepackage[left=3.5cm,right=3.0cm,top=3.0cm,bottom=4cm,headheight=1cm]{geometry}
\usepackage{wrapfig}
\usepackage{nccmath}
\usepackage{tabularx,ragged2e,booktabs,caption}
\usepackage[section]{placeins}
\usepackage[textfont=normalfont]{subcaption}
\usepackage{url}
\urlstyle{same}
\newcommand\apj{1925ApJ....61...38R} % Journal abbreviations
\addtolength{\topmargin}{.25in} %topmargin control
\begin{document}
\begin{table}
\begin{tabular}{>{}l
*{2}S[table-format=-1.2(2)]
*{2}S[table-format=-5.0] }
\toprule & {$\textbf{Resonance 1}$} &{$\textbf{Resonance 4}$} & {$\textbf{Resonance 1}$} &{$\textbf{Resonance 4}$}\\
\cmidrule(lr){2-2} \cmidrule(lr){3-3} \cmidrule(lr){4-4} \cmidrule(lr){5-5}
{\textbf{Approach}} & $\boldsymbol{\beta}$ & $\boldsymbol{\beta}$ & $\boldsymbol{\chi^{2}}$ &$\boldsymbol{\chi^{2}}$ \\
\midrule
1 & -0.31(9) & 1.99(60) & 475 & 11681\\
2 & -0.30(16) & 2.00(35) & 1453 & 8946\\
3 & 0.94(19) & 2.00(63) & -8289 & 13691\\
4 & -0.93(24) & 2.00(36) & -14394 & 8102\\
\bottomrule
\end{tabular}
\caption[]{}
\end{table}
\end{document}
答案1
此解决方案更侧重于表格中信息的组织方式。如果作者打算使用四种方法显示和情况下的β
和值,那么下面的第一个表格似乎是合适的。另一方面,如果作者打算显示正在研究的两种不同情况并使用不同的方法列出获得的参数(和),那么第二个表格似乎是合适的。 χ²
Resonance 1
4
Resonance
β
χ²
\documentclass[a4paper,12pt]{report}
\usepackage[left=3.5cm,right=3.0cm,top=3.0cm,bottom=4cm,headheight=1cm]{geometry}
\usepackage{nccmath}
\usepackage{tabularx,ragged2e,booktabs,caption}
\usepackage[tight-spacing=true]{siunitx} %<--- added
\sisetup{separate-uncertainty}%
\begin{document}
\begin{table}\centering
\begin{tabularx}{\textwidth}{X
S[table-format=-1.2(2)]
S[table-format= 1.2(2)]
S[table-format=-5.0]
S[table-format= 5.0]}
\toprule & \multicolumn{2}{c}{$\boldsymbol{\beta}$} & \multicolumn{2}{c}{$\boldsymbol{\chi^{2}}$} \\
\cmidrule(lr){2-3} \cmidrule(lr){4-5}
{\textbf{Approach}} & {\textbf{Resonance 1}} &{\textbf{Resonance 4}} & {\textbf{Resonance 1}} & {\textbf{Resonance 4}} \\
\midrule
1 & -0.31(9) & 1.99(60) & 475 & 11681\\
2 & -0.30(16) & 2.00(35) & 1453 & 8946\\
3 & 0.94(19) & 2.00(63) & -8289 & 13691\\
4 & -0.93(24) & 2.00(36) & -14394 & 8102\\
\bottomrule
\end{tabularx}
\caption{Combine $\beta$ and $\chi^2$.}
\end{table}
%
\begin{table}[h]\centering
\begin{tabular}{l
S[table-format=-1.2(2)]
S[table-format=-5.0]
S[table-format= 1.2(2)]
S[table-format= 5.0]}
\toprule & \multicolumn{2}{c}{\textbf{Resonance 1}} & \multicolumn{2}{c}{\textbf{Resonance 4}} \\
\cmidrule(lr){2-3} \cmidrule(lr){4-5}
{\textbf{Approach}} & {$\boldsymbol{\beta}$} &{$\boldsymbol{\chi^{2}}$} & {$\boldsymbol{\beta}$}& {$\boldsymbol{\chi^{2}}$} \\
\midrule
1 & -0.31(9) & 475 & 1.99(60) & 11681 \\
2 & -0.30(16) & 1453 & 2.00(35) & 8946 \\
3 & 0.94(19) & -8289 & 2.00(63) & 13691 \\
4 & -0.93(24) & -14394 & 2.00(36) & 8102 \\
\bottomrule
\end{tabular}
\caption{Combining Resonance 1 and Resonance 4}
\end{table}
\end{document}
答案2
看来主要问题来自默认的表号对齐方式,即center-decimal-marker
。将其设置为center
可解决问题。要精确拟合 mattrgins,最好使用tabularx
,并将第一列说明符更改为X
:
\documentclass[a4paper,12pt]{report}
\usepackage{graphicx,rotating}
\usepackage{multirow}
\usepackage{siunitx,booktabs}%for table decimals number
\sisetup{separate-uncertainty}%
\usepackage[export]{adjustbox}
\usepackage[left=3.5cm,right=3.0cm,top=3.0cm,bottom=4cm,headheight=1cm, showframe]{geometry}
\usepackage{wrapfig}
\usepackage{nccmath}
\usepackage{tabularx,ragged2e,booktabs,caption}
\usepackage[section]{placeins}
\usepackage[textfont=normalfont]{subcaption}
\usepackage{url}
\urlstyle{same}
\newcommand\apj{1925ApJ....61...38R} % Journal abbreviations
\addtolength{\topmargin}{.25in} %topmargin control
\begin{document}
\begin{table}
\sisetup{table-number-alignment=center}
\begin{tabularx}{\linewidth}{X
S[table-format=-1.2(2)]S[table-format=1.2(2)]
*{2}{S[table-format=-5.0]}}
\toprule & {\textbf{Resonance 1}} & {\textbf{Resonance 4}} & {\textbf{Resonance 1}} & {\textbf{Resonance 4}} \\
\cmidrule(lr){2-2} \cmidrule(lr){3-3} \cmidrule(lr){4-4} \cmidrule(lr){5-5}
{\textbf{Approach}} & $\boldsymbol{β}$ & $\boldsymbol{β}$ & $\boldsymbol{\chi^{2}}$ & $\boldsymbol{\chi^{2}}$ \\
\midrule
1 & -3.31(09) & 1.99(60) & 475 & 11681 \\
2 & -0.30(16) & 2.00(35) & 1453 & 8946 \\
3 & 0.94(19) & 2.00(63) & -8289 & 13691 \\
4 & -0.93(24) & 2.00(36) & -14394 & 8102 \\
\bottomrule
\end{tabularx}
\caption[]{}
\end{table}
\end{document}
答案3
我只是稍微改变了列定义并在所有列标题中添加了花括号。MWE 仅加载必要的包:
\documentclass[a4paper,12pt]{report}
\usepackage[left=3.5cm,right=3.0cm,
top=3.0cm,bottom=4cm,headheight=1cm]{geometry}
\usepackage{siunitx}%for table decimals number
\usepackage{nccmath}
\usepackage{booktabs, multirow, tabularx}
\usepackage{caption}
\begin{document}
\begin{table}
\sisetup{separate-uncertainty,
group-four-digits}%
\begin{tabular}{l
S[table-format=-1.2(2)]
S[table-format= 1.2(2)]
S[table-format=-5.0]
S[table-format= 5.0] }
\toprule
& {\textbf{Resonance 1}}
& {\textbf{Resonance 4}}
& {\textbf{Resonance 1}}
& {\textbf{Resonance 4}}\\
\cmidrule(lr){2-2} \cmidrule(lr){3-3}
\cmidrule(lr){4-4} \cmidrule(lr){5-5}
\textbf{Approach}
& {$\boldsymbol{\beta}$}
& {$\boldsymbol{\beta}$}
& {$\boldsymbol{\chi^{2}}$}
& {$\boldsymbol{\chi^{2}}$} \\
\midrule
1 & -0.31(9) & 1.99(60) & 475 & 11681\\
2 & -0.30(16) & 2.00(35) & 1453 & 8946\\
3 & 0.94(19) & 2.00(63) & -8289 & 13691\\
4 & -0.93(24) & 2.00(36) & -14394 & 8102\\
\bottomrule
\end{tabular}
\caption[$\beta$ and $\chi^{2}$ parameters values measured in this work for $Mg^{+}$ 3s in the $hv$ range between 54.50 and 55.52 eV]{The $\beta$ and $\chi^{2}$ parameters values measured in this work for $Mg^{+}$ 3s.}\label{table:betaSCALEFACTOR}
\end{table}
\end{document}
答案4
另一种选择可能是进行以下修改。
您可以使用
tabularx
包来设置表\textwidth
。它还提供X
列类型(填充表空间的其余部分)。选择此选项,
[tight-spacing = true]
您将获得更紧密的间距。参见siunitx
包装文档5.6 打印数字第 28 页。
[紧密间距 = true]:在某些情况下,可能需要“压缩”输出间距。使用紧密间距开关可打开此功能,该开关会尽可能压缩间距。
要减少/增加表格中列之间的间距,请设置为
\tabcolsep
/0.4em
。(默认值用 打印)0.6em
\setlength{\tabcolsep}{0.6em}
\the\tabcolsep
showframe
包:\usepackage{showframe}
使页边距可见。
梅威瑟:
\documentclass[a4paper,12pt]{report}
\usepackage[left=3.5cm,right=3.0cm,top=3.0cm,bottom=4cm,headheight=1cm]{geometry}
\usepackage{nccmath}
\usepackage{tabularx,ragged2e,booktabs,caption}
\usepackage{showframe} %<--- added
\usepackage[tight-spacing=true]{siunitx} %<--- added
\sisetup{separate-uncertainty}%
\setlength{\tabcolsep}{0.6em} %<--- added
\begin{document}
\begin{table}
\begin{tabularx}{\textwidth}{>{}X
S[table-format=-1.2(2)]
S[table-format= 1.2(2)]
S[table-format=-5.0]
S[table-format= 5.0]}
\toprule & {$\textbf{Resonance 1}$} &{$\textbf{Resonance 4}$} & {$\textbf{Resonance 1}$} &{$\textbf{Resonance 4}$}\\
\cmidrule(lr){2-2} \cmidrule(lr){3-3} \cmidrule(lr){4-4} \cmidrule(lr){5-5}
{\textbf{Approach}} & $\boldsymbol{\beta}$ & $\boldsymbol{\beta}$ & $\boldsymbol{\chi^{2}}$ &$\boldsymbol{\chi^{2}}$ \\
\midrule
1 & -0.31(9) & 1.99(60) & 475 & 11681\\
2 & -0.30(16) & 2.00(35) & 1453 & 8946\\
3 & 0.94(19) & 2.00(63) & -8289 & 13691\\
4 & -0.93(24) & 2.00(36) & -14394 & 8102\\
\bottomrule
\end{tabularx}
\caption[]{}
\end{table}
\end{document}