\documentclass{article}
\usepackage{booktabs,threeparttable}
\hyphenpenalty=2000
\exhyphenpenalty=2000
\begin{document}
\begin{minipage}{\marginparwidth}
\centering
\begin{tabular}{r r r}
& {\small \textbf{sample 1}}
& {\small \textbf{sample 2} \\
Acquired \tnote{a} & 22 & 44 \\
Optimal \tnote {b} & 22 & 16 \\
\end{tabular}
\begin{tablenotes}\tiny
\item[a] This is sample 1.
\end{tablenotes}\begin{tablenotes}\tiny
\item[b] This is sample two.
\end{tablenotes}
\end{minipage}
\end{document}
考虑到上面的 TeX 代码,注释a
和b
只出现在没有符号的下方,并且表格内部minipage
没有a
和来表示哪个注释属于哪个实体。此外,这应该在边距中,但它超出了边界。我该如何解决这些问题?b
minipage
答案1
您的表格和表格注释必须包含在环境中threeparttable
,并且您不需要 minipage。对于溢出,您可以将字体大小设置为 footnotesize,并旋转列标题,或者放大\marginparwidth
。这是第一个解决方案的示例。正如@Zarko 在他的评论中指出的那样,showframe
加载只是为了演示表格适合分配给边注的宽度:
\documentclass{article}
\usepackage[flushleft]{threeparttable}
\usepackage{booktabs}
\usepackage{showframe, rotating}
\hyphenpenalty=2000
\exhyphenpenalty=2000
\usepackage{lipsum}
\begin{document}
\lipsum[2]
\marginpar{ \centering\scriptsize\setlength{\tabcolsep}{3.5pt}
\begin{threeparttable}[flushleft]
\begin{tabular}{@{}l r r@{}}
& \turnbox{90}{\textbf{sample 1}}
& \turnbox{90}{\textbf{sample 2} }\\
Acquired\tnote{a} & 22 & 44 \\
Optimal\tnote{b} & 22 & 16 \\
\end{tabular}
\begin{tablenotes}\tiny\smallskip\raggedright
\item[a] This is sample 1.
\item[b] This is sample two.
\end{tablenotes}
\end{threeparttable}}
\lipsum[3]
\end{document}