考虑以下最小工作示例(MWE):
\documentclass{article}
\usepackage{tabularx,parnotes}
\begin{document}
\begin{table}
\begin{tabularx}{0.5\textwidth}{lcc}
\parnoteclear
c & c & c\parnote{This is a veeeeeeeery looooooooooooooooooong parnote and too wide}\\\hline
\end{tabularx}
\parnotes
\end{table}
\end{document}
结果截图:
问题说明:
如您所见,parnote
比表格本身宽得多。如何将 的宽度调整parnote
为与 的宽度相同table
?
答案1
您可以改用该threeparttable
包:
\documentclass{article}
\usepackage{tabularx}
\usepackage{threeparttable}
\begin{document}
\begin{table}
\begin{threeparttable}
\begin{tabularx}{0.5\textwidth}{lcc}
c & c & c\tnote{1} \\\hline
\end{tabularx}
\begin{tablenotes}
\item[1] {This is a very very very long table note and automatically as wide as the table}
\end{tablenotes}
\end{threeparttable}
\end{table}
\end{document}
如果您希望继续使用parnotes
,则可以使用parbox
如下方式:
\documentclass{article}
\usepackage{tabularx,parnotes}
\begin{document}
\begin{table}
\begin{tabularx}{0.5\textwidth}{lcc}
\parnoteclear
c & c & c\parnote{This is a very very very very very very very very long parnote and too wide}\\\hline
\end{tabularx}
\parbox{0.5\textwidth}{\parnotes}
\end{table}
\end{document}
对于您的实际表,您可能需要记住在环境X
中至少使用一个类型列tabularx
。