\begin{table}
\begin{center}
\caption{Types of Aggregation}
\label{table:my_label1}
\begin{tabular}{|c |c| c| c|}
\multicolumn{4}{c}{}{$\overbrace{\rule{12.5em}{0pt}}^{Spatial Aggregation}$}\\
\hline
Meters & $time_1$ & $time_2$ & $time_3$ \\ [0.5ex]
\hline
$SM_{1}$ & $R_{1,1}$ & $R_{1,2}$ & $R_{1,3}$\\
\hline
$SM_2$ & $R_{2,1}$ & $R_{2,2}$ & $R_{2,3}$\\
\hline
$SM_3$ & $R_{3,1}$ & $R_{3,2}$ & $R_{3,3}$\\
\hline
\end{tabular}
\end{center}
\end{table}
我想使用 来命名第 2、3 和 4 列\overbrace
。我该怎么做?
答案1
欢迎使用 TeX-SE!假设你想要一些类似于你的代码的东西,你可以使用
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{table}
\centering
\caption{Types of Aggregation}
\label{table:my_label1}
\begin{tabular}{|c |c| c| c|}
\multicolumn{1}{c}{}&
\multicolumn{3}{c}{$\overbrace{\rule{9.5em}{0pt}}^{\text{Spatial
Aggregation}}$}\\
\hline
Meters & $\text{time}_1$ & $\text{time}_2$ & $\text{time}_3$ \\ [0.5ex]
\hline
$SM_{1}$ & $R_{1,1}$ & $R_{1,2}$ & $R_{1,3}$\\
\hline
$SM_2$ & $R_{2,1}$ & $R_{2,2}$ & $R_{2,3}$\\
\hline
$SM_3$ & $R_{3,1}$ & $R_{3,2}$ & $R_{3,3}$\\
\hline
\end{tabular}
\end{table}
\end{document}
答案2
您可以使用\downbracefill
,类似于\underbrace
与表列一起使用:
\documentclass{article}
\begin{document}
\begin{tabular}{| *{4}{c |} }
\multicolumn{1}{c}{} & \multicolumn{3}{c}{\small Spatial aggregation} \\[-.3\normalbaselineskip]
\multicolumn{1}{c}{} & \multicolumn{3}{c}{\downbracefill} \\
\hline
Meters & $time_1$ & $time_2$ & $time_3$ \\
\hline
$SM_1$ & $R_{1,1}$ & $R_{1,2}$ & $R_{1,3}$ \\
\hline
$SM_2$ & $R_{2,1}$ & $R_{2,2}$ & $R_{2,3}$ \\
\hline
$SM_3$ & $R_{3,1}$ & $R_{3,2}$ & $R_{3,3}$ \\
\hline
\end{tabular}
\end{document}