\documentclass[a4paper,12pt]{memoir}
\usepackage[margin=1in]{geometry}
\usepackage{tikz}
\usepackage{booktabs,siunitx,adjustbox,array}
\begin{document}
\section{memoir Advanced Tables}
\begin{table}[ht]
\centering
\begin{tabular}
{
*{2}{S[table-format=2.2]}
*{3}{S[table-format=2.2]}
}
\toprule
& & \multicolumn{1}{c}{Circles} & \multicolumn{1}{c}{Geometric Orientation} & \multicolumn{1}{c}{Shape Orientation}\\
\cmidrule(lr){3-3} \cmidrule(lr){4-4} \cmidrule(lr){5-5}
{\textbf{Circle location}} & {$R_y$} & {$P_a/Z$} & {$G_{tn}/V$} & {$a_{bn}^*$ (OR) $d_{gd}^*$} \\
\midrule
& 5.64 & 2.12 & 0.5234 to 0.3154 & 1.354 to 5.159\\
\textbf{Full Circle} & 1.34 & 2.58 & 0.1827 to 0.5861 & 1.335 to 1.4564\\
& 7.55 & 3.15 & 0.3068 to 0.7521 & 1.809 to 2.811\\
\midrule
& 3.24 & 2.64 & -0.1052 to 0.2100 & 0.8358 to 1.556\\
\textbf{Half Circle} & 5.64 & 3.78 & -0.06201 to 0.1827 & 0.9876 to 1.1055\\
& 4.56 & 7.78 & -0.8456 to 0.3261 & 1.7231 to 2.854 \\
\bottomrule
\end{tabular}
\label{table:My_caption}
\caption{Table for Circles and Geometries}
\end{table}
\end{document}
输出如下
欢迎提出任何好的解决方案或建议?
答案1
数字列中不能有两个数字用“to”分隔。请使用表格规范中定义的分隔符来分隔两个列。
\documentclass[a4paper,12pt]{memoir}
\usepackage[margin=1in]{geometry}
\usepackage{tikz}
\usepackage{booktabs,siunitx,adjustbox,array}
\begin{document}
\section{memoir Advanced Tables}
\begin{table}[ht]
\centering
\sisetup{group-digits=integer}
\begin{tabular}
{
l
S[table-format=1.2]
S[table-format=1.2]
S[table-format=-1.5]
@{ to }
S[table-format=1.4]
S[table-format=1.4]
@{ to }
S[table-format=1.4]
}
\toprule
&&&\multicolumn{4}{c}{Orientation}\\
\cmidrule{4-7}
&&
\multicolumn{1}{c}{Circles} &
\multicolumn{2}{c}{Geometric} &
\multicolumn{2}{c}{Shape} \\
\cmidrule(lr){3-3} \cmidrule(lr){4-5} \cmidrule(lr){6-7}
\textbf{Circle location} & {$R_y$} & {$P_a/Z$} &
\multicolumn{2}{c}{$G_{tn}/V$} &
\multicolumn{2}{c}{$a_{bn}^*$ (OR) $d_{gd}^*$} \\
\midrule
& 5.64 & 2.12 & 0.5234 & 0.3154 & 1.354 & 5.159\\
\textbf{Full Circle} & 1.34 & 2.58 & 0.1827 & 0.5861 & 1.335 & 1.4564\\
& 7.55 & 3.15 & 0.3068 & 0.7521 & 1.809 & 2.811\\
\midrule
& 3.24 & 2.64 & -0.1052 & 0.2100 & 0.8358 & 1.556\\
\textbf{Half Circle} & 5.64 & 3.78 & -0.06201 & 0.1827 & 0.9876 & 1.1055\\
& 4.56 & 7.78 & -0.8456 & 0.3261 & 1.7231 & 2.854 \\
\bottomrule
\end{tabular}
\caption{Table for Circles and Geometries}
\label{table:My_caption}
\end{table}
\end{document}
请记住,标签应该后標題。