我想将表格的脚注放在表格的右侧,因此我使用了 minipage 环境。出于某种原因,脚注占据了表格的一半空间,而不是完全位于表格的右侧。我该如何避免这种重叠?
\begin{table}[ht!]
\caption{Descriptive Statistics}
\begin{minipage}{0.2\textwidth}
\resizebox{8cm}{!} {\begin{tabular}{cccc}
\hline \hline
Variables & Mean & Std. dev. & Range \\
\hline \\
\textit{variable1} & 0.50 & 0.42 & 0-1 \vspace{1mm} \\
\textit{variable2} & 0.11 & 0.76 & 0-1 \vspace{1mm} \\
\textit{variable3} & 34.95 & 9.99 & 25-65 \vspace{1mm} \\
\textit{variable4} & 34.95 & 9.99 & 25-65 \vspace{4mm} \\
\hline Observations & & & 256
\end{tabular}}
\end{minipage}
\begin{minipage}{0.5\textwidth}
\footnotesize \textit{Notes}: Description of variable1, variable2, variable3, variable4
\end{minipage}
\end{table}
答案1
关键点是使用:\resizebox{\textwidth}{!}
。最好是定义新的长度并将其设置为8cm
。
\documentclass{article}
\usepackage{graphicx}
\begin{document}
\begin{table}[ht!]
\caption{Descriptive Statistics}
\begin{minipage}{0.49\linewidth}
\resizebox{\textwidth}{!} {\begin{tabular}{cccc}
\hline \hline
Variables & Mean & Std. dev. & Range \\
\hline \\
\textit{variable1} & 0.50 & 0.42 & 0-1 \vspace{1mm} \\
\textit{variable2} & 0.11 & 0.76 & 0-1 \vspace{1mm} \\
\textit{variable3} & 34.95 & 9.99 & 25-65 \vspace{1mm} \\
\textit{variable4} & 34.95 & 9.99 & 25-65 \vspace{4mm} \\
\hline Observations & & & 256
\end{tabular}}
\end{minipage}% %<----- no space
\begin{minipage}{0.5\linewidth}
\footnotesize \textit{Notes}: Description of variable1, variable2, variable3, variable4
\end{minipage}
\end{table}
\newlength{\mytabularwidth}
\setlength{\mytabularwidth}{8cm}
\begin{table}[ht!]
\caption{Descriptive Statistics}
\begin{minipage}{\mytabularwidth}
\resizebox{\textwidth}{!} {\begin{tabular}{cccc}
\hline \hline
Variables & Mean & Std. dev. & Range \\
\hline \\
\textit{variable1} & 0.50 & 0.42 & 0-1 \vspace{1mm} \\
\textit{variable2} & 0.11 & 0.76 & 0-1 \vspace{1mm} \\
\textit{variable3} & 34.95 & 9.99 & 25-65 \vspace{1mm} \\
\textit{variable4} & 34.95 & 9.99 & 25-65 \vspace{4mm} \\
\hline Observations & & & 256
\end{tabular}}
\end{minipage}% %<----- no space
\begin{minipage}{\dimexpr\linewidth-\mytabularwidth\relax}
\footnotesize \textit{Notes}: Description of variable1, variable2, variable3, variable4
\end{minipage}
\end{table}
\end{document}