我该如何修复以下问题?标题与图表或表格重叠。
\begin{table}[]
\caption{\label{tab:compareResult1}
Results of Ablation Studies: Accuracy of different input settings on KenyanFood13.}
\vspace*{-.3cm}
\begin{tabular}{|c|r|r|}
\hline
\multirow{2}{*}{\textbf{Method}} & \multicolumn{2}{c|}{\textbf{Test Accuracy}} \\ \cline{2-3}
&\textbf{Top-1} & \textbf{Top-3} \\ \hline\hline
Image only & 73.18\%$\pm$ 0.79\% & 92.04\%$\pm$ 0.44\% \\ \hline
Caption only & 65.30\%$\pm$ 1.70\% & 83.68\%$\pm$ 1.55\% \\ \hline\hline
{\bf Ours:} Image + Caption & 81.04\%$\pm$ 0.86\% & 95.95\%$\pm$ 0.44\% \\ \hline
\end{tabular}
\vspace*{-0.2cm}
\end{table}
答案1
插入负片很可能是导致和\vspace
重叠的原因。\caption
tabular
下面删除了这个,并使用booktabs
表示:
\documentclass{article}
\usepackage{booktabs}
\begin{document}
\begin{table}
\centering
\caption{Results of Ablation Studies: Accuracy of different input settings on KenyanFood13.}
\begin{tabular}{ l c c }
\toprule
& \multicolumn{2}{c}{\bfseries Test accuracy} \\
\cmidrule{2-3}
\textbf{Method} & \textbf{Top-1} & \textbf{Top-3} \\
\midrule
Image only & $73.18\% \pm 0.79\%$ & $92.04\% \pm 0.44\%$ \\
Caption only & $65.30\% \pm 1.70\%$ & $83.68\% \pm 1.55\%$ \\
\textbf{Ours:} Image + Caption & $81.04\% \pm 0.86\%$ & $95.95\% \pm 0.44\%$ \\
\bottomrule
\end{tabular}
\end{table}
\end{document}
答案2
这可能会为你指明正确的方向
\documentclass[a4paper,12pt]{article}
\usepackage{float}
\usepackage{lscape}
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{multirow}
\usepackage{array}
\usepackage{enumitem}
\begin{document}
\begin{table}
\caption{\label{tab:compareResult1}
Results of Ablation Studies: Accuracy of different input settings on KenyanFood13.}
% \vspace*{-.3cm}
\begin{tabular}{|c|c|c|}
\hline
\multirow{2}{*}{\textbf{Method}} & \multicolumn{2}{c|}{\textbf{Test Accuracy}} \\ \cline{2-3}
&\textbf{Top-1} & \textbf{Top-3} \\ \hline\hline
Image only & 73.18\%$\pm$ 0.79\% & 92.04\%$\pm$ 0.44\% \\ \hline
Caption only & 65.30\%$\pm$ 1.70\% & 83.68\%$\pm$ 1.55\% \\ \hline\hline
{\bf Ours:} Image + Caption & 81.04\%$\pm$ 0.86\% & 95.95\%$\pm$ 0.44\% \\ \hline
\end{tabular}
% \vspace*{-0.2cm}
\caption{\label{tab:compareResult1}
Results of Ablation Studies: Accuracy of different input settings on KenyanFood13.}
\end{table}
\end{document}