\documentclass{article}
\usepackage{multirow}
\usepackage{array}
\usepackage{lmodern}
\usepackage{booktabs}
\usepackage{caption}
\usepackage{siunitx}
\sisetup{
per-mode=symbol,
group-separator={,},
group-four-digits,
% The input with the comma as group separator,
% \num{2,944} (almost three thousand), can be supported by options:
% input-decimal-markers={.},
% input-ignore={,},
}
\DeclareSIUnit{\ugpcm}{\micro\gram\per\cubic\meter}
% u for micro (\ug is an abbreviation in package siunit for micro gram)
% g for gram
% p for per
% c for cubic
% m for meter
\begin{document}
\begin{table}
\centering
% The optional argument with a shorter version (it's still quite long)
% for the list of tables
\caption[Annual average concentrations of the air pollutants
and traffic indicators and corresponding Spearman correlation
coefficients]
{Annual average concentrations of air pollutants and traffic
indicators and corresponding Spearman correlation coefficients
(N = \num{2944}).
Current European air quality standards (1~year average):
\SI{40}{\ugpcm} (PM10);
\SI{25}{\ugpcm} (PM2.5);
\SI{40}{\ugpcm} (NO2).
WHO recommendations (1~year average):
\SI{20}{\ugpcm} (PM10);
\SI{10}{\ugpcm} (PM2.5);
\SI{40}{\ugpcm} (NO2).}
\label{aggiungi}
\begin{tabular}{
l
S[table-format=2.2]
S[table-format=1.2]
*{3}{S[table-format=2.2]}
}
\setlength{\mylength}{30cm}
\toprule
Descriptives & \multicolumn{11}{c} {Spearman correlation coefficients} \\
\cmidrule{2-12}
Exposure (\si{\micro\gram/m^3}) & {Mean} & {SD} & {5th centile} & {Median} & {95th centile} & {PM10}
& {PMCoarse} & {PM25} & {PM25abs} & {NOX} & {NO2} \\
\midrule
PM10 & 20.38 & 2.42 & 16.45 & 20.49 & 24.32 & 1 \\
PMCoarse & 6.24 & 1.08 & 4.84 & 6.07 & 8.44 & 0.76 & 1 \\
PM2.5 & 13.55 & 0.85 & 12.5 & 13.4 & 15.29 & 0.43 & 0.32 & 1 \\
PM2.5abs & 1.69 & 0.17 & 1.46 & 1.67 & 1.99 & 0.67 & 0.84 & 0.48 & 1 \\
NOX & 32.7 & 7.28 & 23.83 & 31.34 & 46.66 & 0.69 & 0.85 & 0.48 & 0.76 & 1 \\
NO2 & 18.77 & 3.83 & 13.76 & 18.28 & 25.62 & 0.67 & 0.79 & 0.45 & 0.66 & 0.92 & 1 \\
\bottomrule
\end{tabular}
\end{table}
\end{document}
答案1
如果满足以下条件,您的表格可以适合纵向页面:
- 更正表格代码中的所有错误
- 使用较小的字体(
\small
) - 减少列之间的空间
- 较长的列标题分成两行
如果这是可以接受的,那么您将获得:
\documentclass{article}
\usepackage[margin=25mm,showframe]{geometry}% <-- added
\usepackage{lmodern}
\usepackage[font=small,labelfont=bf]{caption}
\usepackage{siunitx}
\sisetup{
per-mode=symbol,
group-separator={,},
group-four-digits,
}
\DeclareSIUnit{\ugpcm}{\micro\gram\per\cubic\meter}
\usepackage{array}
\usepackage{makecell}% <-- added
\usepackage{booktabs}
%\usepackage{rotating}% <-- added
\begin{document}
\begin{table}
\centering
% The optional argument with a shorter version (it's still quite long)
% for the list of tables
\caption[Annual average concentrations of the air pollutants
and traffic indicators and corresponding Spearman correlation
coefficients]
{Annual average concentrations of air pollutants and traffic
indicators and corresponding Spearman correlation coefficients
(N = \num{2944}).
Current European air quality standards (1~year average):
\SI{40}{\ugpcm} (PM10);
\SI{25}{\ugpcm} (PM2.5);
\SI{40}{\ugpcm} (NO2).
WHO recommendations (1~year average):
\SI{20}{\ugpcm} (PM10);
\SI{10}{\ugpcm} (PM2.5);
\SI{40}{\ugpcm} (NO2).}
\label{aggiungi}
\small
\begin{tabular}{
l @{\extracolsep{\fill}}
S[table-format=2.2]
S[table-format=1.2]
*{3}{S[table-format=2.2]}
*{5}{S[table-format=1.2]}
S[table-format=1.0]
}
\toprule
Descriptives & \multicolumn{11}{c}{Spearman correlation coefficients} \\
\cmidrule{2-12}
\makecell[l]{Exposure\\ (\si{\ugpcm})}
& {Mean} & {SD} & {\makecell{5th\\ centile}} & {Median}
& {\makecell{95th\\ centile}} & {PM10} & {PMCoarse} & {PM25}
& {PM25abs} & {NOX} & {NO2} \\
\midrule
PM10 & 20.38 & 2.42 & 16.45 & 20.49 & 24.32 & 1 \\
PMCoarse & 6.24 & 1.08 & 4.84 & 6.07 & 8.44 & 0.76 & 1 \\
PM2.5 & 13.55 & 0.85 & 12.5 & 13.4 & 15.29 & 0.43 & 0.32 & 1 \\
PM2.5abs & 1.69 & 0.17 & 1.46 & 1.67 & 1.99 & 0.67 & 0.84 & 0.48 & 1 \\
NOX & 32.7 & 7.28 & 23.83 & 31.34 & 46.66 & 0.69 & 0.85 & 0.48 & 0.76 & 1 \\
NO2 & 18.77 & 3.83 & 13.76 & 18.28 & 25.62 & 0.67 & 0.79 & 0.45 & 0.66 & 0.92 & 1 \\
\bottomrule
\end{tabular}
\end{table}
\end{document}
如果这不是一个选项,您可以使用sidewaystable
:
\documentclass{article}
%\usepackage[margin=25mm,showframe]{geometry}% <-- added
\usepackage{lmodern}
\usepackage[font=small,labelfont=bf]{caption}
\usepackage{siunitx}
\sisetup{
per-mode=symbol,
group-separator={,},
group-four-digits,
% The input with the comma as group separator,
% \num{2,944} (almost three thousand), can be supported by options:
% input-decimal-markers={.},
% input-ignore={,},
}
\DeclareSIUnit{\ugpcm}{\micro\gram\per\cubic\meter}
\usepackage{array}
%\usepackage{makecell}% <-- added
\usepackage{booktabs}
\usepackage{rotating}% <-- added
\begin{document}
\begin{sidewaystable}
\centering
\caption[Annual average concentrations of the air pollutants
and traffic indicators and corresponding Spearman correlation
coefficients]
{Annual average concentrations of air pollutants and traffic
indicators and corresponding Spearman correlation coefficients
(N = \num{2944}).
Current European air quality standards (1~year average):
\SI{40}{\ugpcm} (PM10);
\SI{25}{\ugpcm} (PM2.5);
\SI{40}{\ugpcm} (NO2).
WHO recommendations (1~year average):
\SI{20}{\ugpcm} (PM10);
\SI{10}{\ugpcm} (PM2.5);
\SI{40}{\ugpcm} (NO2).}
\label{aggiungi}
\small
\begin{tabular}{
l %@{\extracolsep{\fill}}
S[table-format=2.2]
S[table-format=1.2]
*{3}{S[table-format=2.2]}
*{5}{S[table-format=1.2]}
S[table-format=1.0]
}
\toprule
Descriptives & \multicolumn{11}{c}{Spearman correlation coefficients} \\
\cmidrule{2-12}
Exposure (\si{\ugpcm})
& {Mean} & {SD} & {5th centile} & {Median}
& {95th centile} & {PM10} & {PMCoarse} & {PM25}
& {PM25abs} & {NOX} & {NO2} \\
\midrule
PM10 & 20.38 & 2.42 & 16.45 & 20.49 & 24.32 & 1 \\
PMCoarse & 6.24 & 1.08 & 4.84 & 6.07 & 8.44 & 0.76 & 1 \\
PM2.5 & 13.55 & 0.85 & 12.5 & 13.4 & 15.29 & 0.43 & 0.32 & 1 \\
PM2.5abs & 1.69 & 0.17 & 1.46 & 1.67 & 1.99 & 0.67 & 0.84 & 0.48 & 1 \\
NOX & 32.7 & 7.28 & 23.83 & 31.34 & 46.66 & 0.69 & 0.85 & 0.48 & 0.76 & 1 \\
NO2 & 18.77 & 3.83 & 13.76 & 18.28 & 25.62 & 0.67 & 0.79 & 0.45 & 0.66 & 0.92 & 1 \\
\bottomrule
\end{tabular}
\end{sidewaystable}
\end{document}