是什么原因导致 Beamer 中带字幕和不带字幕的字幕间距不一致threeparttable
?这是什么原因造成的?可以修复吗?
我最近发过关于文章类中同一问题的问题,但有建议的解决方法似乎无法与 Beamer 配合使用。
\documentclass{beamer}
\usepackage{threeparttable,tabularx}
\begin{document}
\begin{frame}{Only \texttt{table}}
\begin{table}
\caption{A table caption}
\begin{tabularx}{\linewidth}{XXXX}
A1 & B1 & C1 & D1 \\
A2 & B2 & C2 & D2 \\
A3 & B3 & C3 & D3 \\
\end{tabularx}
\end{table}
\end{frame}
\begin{frame}{Both \texttt{table} and \texttt{threeparttable}}
\begin{table}
\begin{threeparttable}
\caption{A table caption}
\begin{tabularx}{\linewidth}{XXXX}
A1 & B1 & C1 & D1 \\
A2 & B2 & C2 & D2 \\
A3 & B3 & C3 & D3 \\
\end{tabularx}
\end{threeparttable}
\end{table}
\end{frame}
\end{document}
答案1
解决方法:将标题放在后面\begin{table}
。此方法也适用于文章类。请参阅 https://tex.stackexchange.com/a/603136/161015
\documentclass{beamer}
\usepackage{threeparttable}
\usepackage{tabularx}
\begin{document}
\begin{frame}{Only \texttt{table}}
\begin{table}
\caption{A table caption}
\begin{tabularx}{\linewidth}{XXXX}
A1 & B1 & C1 & D1 \\
A2 & B2 & C2 & D2 \\
A3 & B3 & C3 & D3 \\
\end{tabularx}
\end{table}
\end{frame}
\begin{frame}{Both \texttt{table} and \texttt{threeparttable}}
\begin{table}
\caption{A table caption} % put the caption here
\begin{threeparttable}
\begin{tabularx}{\textwidth}{XXXX}
A1 & B1 & C1 & D1 \\
A2 & B2 & C2 & D2 \\
A3 & B3 & C3 & D3 \\
\end{tabularx}
\end{threeparttable}
\end{table}
\end{frame}
\end{document}