を使用して、表の最終行にすべての列にまたがるメモを表示したいと思います。 は同じ値を保持しますが、測定値は下方に縮小される\multicolumn{#}{p{\textwidth}}{}
ため、サイズ変更と連動して正しく機能しません。textwidth
これが私のコードです:
\documentclass{article}%
\usepackage{graphicx}
\begin{document}
\resizebox{\textwidth}{!}{%
\begin{tabular}{rrrrrrrrr} \hline
aaaaaaaa & aaaaaaaa & aaaaaaaa & aaaaaaaa & aaaaaaaa & aaaaaaaa & aaaaaaaa & aaaaaaaa & aaaaaaaa\\ \hline
\multicolumn{9}{p{\textwidth}}{Notes: Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et.}
\end{tabular}%
}
\end{document}
出力:
答え1
完璧ではないが、を使用する方が良いthreeparttablex
(右側が少し広すぎる)
\documentclass{article}%
\usepackage{graphicx}
\usepackage[referable]{threeparttablex}
\begin{document}
\noindent
\rule{\textwidth}{1mm}
\noindent
\resizebox{\textwidth}{!}{%
\begin{threeparttable}
\begin{tabular}{rrrrrrrrr} \hline aaaaaaaa & aaaaaaaa & aaaaaaaa &
aaaaaaaa & aaaaaaaa & aaaaaaaa & aaaaaaaa & aaaaaaaa &
aaaaaaaa\\ \hline
\end{tabular}%
\begin{tablenotes}
\note Lorem ipsum dolor sit amet, consetetur sadipscing elitr,
sed diam nonumy eirmod tempor invidunt ut labore et.
\end{tablenotes}
\end{threeparttable}
}
\end{document}
答え2
まず、保存/計算する必要があります本物テーブルの幅
\newsavebox\tableBox
\sbox\tableBox{\begin{tabular}{rrrr...}...\end{tabular}} % without the \multicolumn line
それから
\resizebox{\textwidth}{!}{%
\begin{tabular}{rrrr...}
...
\multicolumn{9}{p{\wd\tableBox}}{...}
\end{tabular}%
}
完全な例:
\documentclass{article}%
\usepackage{graphicx}
\begin{document}
\newsavebox\tableBox
\sbox\tableBox{%
\begin{tabular}{rrrrrrrrr} \hline
aaaaaaaa & aaaaaaaa & aaaaaaaa & aaaaaaaa & aaaaaaaa & aaaaaaaa & aaaaaaaa & aaaaaaaa & aaaaaaaa\\ \hline
\end{tabular}%
}
\resizebox{\textwidth}{!}{%
\begin{tabular}{rrrrrrrrr} \hline
aaaaaaaa & aaaaaaaa & aaaaaaaa & aaaaaaaa & aaaaaaaa & aaaaaaaa & aaaaaaaa & aaaaaaaa & aaaaaaaa\\ \hline
\multicolumn{9}{p{\wd\tableBox}}{Notes: Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et.}
\end{tabular}%
}
\end{document}