使用 siunitx 增加某些列之间的列间距

使用 siunitx 增加某些列之间的列间距

我想增加两处列之间的间距。DIRINT 和 DISC 列集之间以及 DISC 和 Erbs 列集之间应该留出更多空间,以使表格更具可读性。DIRINT MBE 和 DISC MAE 之间的差异小于 DISC MAE 和 DISC MBE 之间的差异。差异应该更大。

在此处输入图片描述

我的代码是:

\documentclass[11pt, twoside, a4paper]{report}
\usepackage[inner = 30mm, outer = 20mm,  top = 30mm, bottom = 20mm, headheight = 13.6pt]{geometry}
\usepackage[pdfpagelayout=TwoPageRight]{hyperref}
\usepackage{booktabs, siunitx}

\begin{document}

\begin{table}[h]
\centering
\caption{MAE and MBE for 48 irradiance transposition pathways}
\label{tab:MAE MBE results}
\begin{tabular}{l*{6}{S[table-format=2.2]}}
    \toprule
                                           &                     \multicolumn{6}{c}{Transposition models}                     \\
    \cmidrule(l){2-7}                      & \multicolumn{2}{c}{DIRINT} & \multicolumn{2}{c}{DISC} & \multicolumn{2}{c}{Erbs} \\ \cmidrule(l){2-3} \cmidrule(l){4-5} \cmidrule(l){6-7}
    Decomposition models                   & {MAE} & {MBE}              & {MAE} & {MBE}            & {MAE} & {MBE}            \\ \midrule
    Reindl                                 & \color{green!40!black}8.11& 0.22               & 16.79 & 6.10             & 21.79 & 3.16             \\
    Hay \& Davies                          & \color{green!40!black}8.11  & \color{green!40!black}0.12               & 16.75 & 5.99             & 21.75 & 3.06             \\
    Perez: Albuquerque   1988              & 8.33  & 1.47               & 17.39 & 7.30             & 23.34 & 4.10             \\
    Perez: Phoenix 1988                    & 8.34  & 1.54               & 17.39 & 7.37             & 23.22 & 4.29             \\ \addlinespace
    Perez: Sandia composite 1988           & 8.39  & 1.86               & 17.38 & 7.69             & 23.16 & 4.64             \\
    King                                   & 8.41  & \color{green!40!black}0.02               & 16.75 & 5.82             & 20.52 & 2.64             \\
    Perez: Cape Canaveral 1988             & 8.50  & 2.37               & 17.55 & 8.23             & 22.53 & 5.09             \\
    Perez: USA composite 1988              & 8.51  & 2.89               & 17.51 & 8.77             & 22.98 & 5.67             \\\addlinespace
    Perez: Osage 1988                      & 8.55  & 1.28               & 17.87 & 7.12             & \color{red!50!black}24.03 & 4.25             \\
    Perez: All sites composite 1990        & 8.58  & 3.48               & 17.61 & 9.40             & 22.79 & 6.35             \\
    Isotropic sky                          & 8.59  & -2.85              & 16.20 & 2.95             & 20.70 & -0.23            \\
    Perez: Albany 1988                     & 8.65  & 3.62               & 17.54 & 9.50             & 22.72 & 6.38             \\\addlinespace
    Perez: Elmonte 1988                    & 8.65  & 2.48               & 17.61 & 8.29             & 23.26 & 5.18             \\
    Perez: All sites composite 1988        & 8.74  & 3.80               & 17.79 & 9.69             & 23.06 & 6.57             \\
    Perez: France 1988                     & 9.23  & 5.16               & 18.17 & 11.06            & 23.02 & 7.93             \\
    Klucher                                & 10.38 & 8.63               & 20.02 &  \color{red!50!black}14.43            & \color{red!50!black}23.53 &  \color{red!50!black}11.25            \\ \midrule
    \multicolumn{1}{r}{Absolute averages} & 8.63  & 2.61             & 17.52 & 8.11           & 22.65 & 5.05           \\ \bottomrule
\end{tabular}
\end{table}

我无法分割,{l*{6}{S[table-format=2.2]}}以便可以添加一些间距。

答案1

这是你想要的吗?我添加了caption包,以便在标题和表格之间留出合适的垂直间距。

\documentclass[11pt, twoside, a4paper]{report}
\usepackage[inner = 30mm, outer = 20mm, top = 30mm, bottom = 20mm, headheight = 13.6pt, showframe]{geometry}
\usepackage{booktabs, caption, siunitx}
\usepackage[pdfpagelayout=TwoPageRight]{hyperref}

\begin{document}

\begin{table}[h]
\centering
\sisetup{table-format=2.2}
\caption{MAE and MBE for 48 irradiance transposition pathways}
\label{tab:MAE MBE results}
\begin{tabular}{lSS!{\qquad}SS!{\qquad}SS}
    \toprule
                                           & \multicolumn{6}{c}{Transposition models} \\
    \cmidrule(l){2-7} & \multicolumn{2}{c}{DIRINT\hspace*{1.75em}} & \multicolumn{2}{c}{DISC\hspace*{1.75em}} & \multicolumn{2}{c}{Erbs} \\
     \cmidrule(lr{2.4em}){2-3} \cmidrule(lr{2.4em}){4-5} \cmidrule(l){6-7}
    Decomposition models & {MAE} & {MBE} & {MAE} & {MBE} & {MAE} & {MBE} \\ \midrule
    Reindl & \color{green!40!black}8.11& 0.22 & 16.79 & 6.10 & 21.79 & 3.16 \\
    Hay \& Davies & \color{green!40!black}8.11 & \color{green!40!black}0.12 & 16.75 & 5.99 & 21.75 & 3.06 \\
    Perez: Albuquerque 1988 & 8.33 & 1.47 & 17.39 & 7.30 & 23.34 & 4.10 \\
    Perez: Phoenix 1988 & 8.34 & 1.54 & 17.39 & 7.37 & 23.22 & 4.29 \\ \addlinespace
    Perez: Sandia composite 1988 & 8.39 & 1.86 & 17.38 & 7.69 & 23.16 & 4.64 \\
    King & 8.41 & \color{green!40!black}0.02 & 16.75 & 5.82 & 20.52 & 2.64 \\
    Perez: Cape Canaveral 1988 & 8.50 & 2.37 & 17.55 & 8.23 & 22.53 & 5.09 \\
    Perez: USA composite 1988 & 8.51 & 2.89 & 17.51 & 8.77 & 22.98 & 5.67 \\\addlinespace
    Perez: Osage 1988 & 8.55 & 1.28 & 17.87 & 7.12 & \color{red!50!black}24.03 & 4.25 \\
    Perez: All sites composite 1990 & 8.58 & 3.48 & 17.61 & 9.40 & 22.79 & 6.35 \\
    Isotropic sky & 8.59 & -2.85 & 16.20 & 2.95 & 20.70 & -0.23 \\
    Perez: Albany 1988 & 8.65 & 3.62 & 17.54 & 9.50 & 22.72 & 6.38 \\\addlinespace
    Perez: Elmonte 1988 & 8.65 & 2.48 & 17.61 & 8.29 & 23.26 & 5.18 \\
    Perez: All sites composite 1988 & 8.74 & 3.80 & 17.79 & 9.69 & 23.06 & 6.57 \\
    Perez: France 1988 & 9.23 & 5.16 & 18.17 & 11.06 & 23.02 & 7.93 \\
    Klucher & 10.38 & 8.63 & 20.02 & \color{red!50!black}14.43 & \color{red!50!black}23.53 & \color{red!50!black}11.25 \\ \midrule
    \multicolumn{1}{r}{Absolute averages} & 8.63 & 2.61 & 17.52 & 8.11 & 22.65 & 5.05 \\ \bottomrule
\end{tabular}
\end{table}

\end{document} 

在此处输入图片描述

相关内容