\resizebox 내의 \textwidth

\resizebox 내의 \textwidth

을 사용하여 모든 열에 걸쳐 메모를 표시하려면 테이블의 마지막 행에 표시하고 싶습니다 \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} 

관련 정보