以下是最小工作示例,
\documentclass{article}
\usepackage{booktabs}
\usepackage{siunitx}
\begin{document}
\begin{tabular}{
>{\em}l
S[round-mode=places, round-precision=1, table-format= -1.1]
>{{{(}}}
S[round-mode=places, round-precision=1, table-format= -1.1,table-space-text-pre={[}]
@{,\,}
S[round-mode=places, round-precision=1, table-format= -1.1,table-space-text-post={]}]
<{{{)}}}
S[round-mode=places, round-precision=2, table-format=1.2]
S[round-mode=places, round-precision=2, table-format=1.2]
}
\toprule
{} & \multicolumn{5}{c}{dB re. 40/s conv.} \\
\cmidrule(lr){2-6}
{} & & & & \multicolumn{2}{c}{Probability} \\
\cmidrule(lr){5-6}
{{}}&\multicolumn{3}{c}{Mean (95\% CI)}&{$<\pm 2.5dB$}&{$<\pm 5dB$} \\
\midrule
oranges & 0.410188 & -1.791145 & 2.505052 & 0.967500 & 0.999875 \\
bananas & 0.006144 & -2.185644 & 2.184911 & 0.973375 & 0.999875 \\
\bottomrule
\end{tabular}
\end{document}
生产
如何防止>
、@
和<
运算符添加到某些行(例如标题)?
答案1
将单元格括在 中\multicolumn{1}{<lcr>}{Cell content}
。正如您从 MWE 中看到的,我@{}
在第一列中添加了 以删除侧边栏。第 1 列第 4 行中的多列命令覆盖了 -command@{}
和\itshape
-command(\em
适用于 LaTex 2.09)。
如果您问如何摆脱( , )
第二行,答案是相同的:使用multicolumn
跨越受影响列的。请参阅(更新)MWE:
\documentclass{article}
\usepackage{booktabs}
\usepackage{siunitx}
\begin{document}
\begin{tabular}{@{}
>{\itshape}l
S[round-mode=places, round-precision=1, table-format= -1.1]
>{{{(}}}
S[round-mode=places, round-precision=1, table-format= -1.1,table-space-text-pre={[}]
@{,\,}
S[round-mode=places, round-precision=1, table-format= -1.1,table-space-text-post={]}]
<{{{)}}}
S[round-mode=places, round-precision=2, table-format=1.2]
S[round-mode=places, round-precision=2, table-format=1.2]
}
\toprule
{} & \multicolumn{5}{c}{dB re. 40/s conv.} \\
\cmidrule(lr){2-6}
{} & \multicolumn{2}{l}{}& \multicolumn{1}{l}{}& \multicolumn{2}{c}{Probability} \\
\cmidrule(lr){5-6}
{{}}&\multicolumn{3}{c}{Mean (95\% CI)}&{$<\pm 2.5dB$}&{$<\pm 5dB$} \\
\midrule
\multicolumn{1}{l}{oranges} & 0.410188 & -1.791145 & 2.505052 & 0.967500 & 0.999875 \\
bananas & 0.006144 & -2.185644 & 2.184911 & 0.973375 & 0.999875 \\
\bottomrule
\end{tabular}
\end{document}
答案2
目前尚不清楚您的问题是什么,但我猜测您正在寻找以下内容:
\documentclass{article}
\usepackage{booktabs}
\usepackage{siunitx}
\begin{document}
\begin{table}[ht]
\sisetup{input-symbols=<,
round-mode=places,
round-precision=1,
per-mode=symbol
}
\begin{tabular}{
>{\itshape}l
S[table-format=1.1]
>{(}
S[input-open-uncertainty = ,table-format=-1.1,table-space-text-pre={(},]
@{\,,\,}
S[input-close-uncertainty= ,table-format= 1.1,table-space-text-post=)]
<{)}
S[round-precision=2, table-format=1.2]
S[round-precision=2, table-format=1.2]
}
\toprule
& \multicolumn{5}{c}{dB re. \SI{40}{\per\second} conv.} \\
\cmidrule(l){2-6}
& \multicolumn{3}{c}{} & \multicolumn{2}{c}{Probability} \\
\cmidrule(l){5-6}
&\multicolumn{3}{c}{Mean (\SI{95}{\%} CI)}
& {\SI{<\pm 2.5}{dB}}
& {\SI{<\pm 5}{dB}} \\
\midrule
oranges & 0.410188 & -1.791145 & 2.505052 & 0.967500 & 0.999875 \\
bananas & 0.006144 & -2.185644 & 2.184911 & 0.973375 & 0.999875 \\
\bottomrule
\end{tabular}
\end{table}
\end{document}
正如您所看到的,我siunitx
在编写单元时也利用了包。