LaTeX는 긴 테이블을 여러 페이지로 분할하고 너비 크기를 조정합니다.

LaTeX는 긴 테이블을 여러 페이지로 분할하고 너비 크기를 조정합니다.

테이블이 매우 길기 때문에 다른 페이지에서 테이블을 계속하면서 테이블의 너비를 세로 페이지(가로가 아닌)의 여백으로 고정하는 방법을 찾으려고 합니다. resizebox를 사용하여 너비를 조정할 수 있습니다(테이블의 캡션과 레이블을 내가 가지고 있는 다른 작은 테이블과 마찬가지로 유지하고 싶었기 때문에 adjustbox보다 이것이 더 낫다는 것을 알았습니다). 그러나 다른 테이블로 계속 이동하는 방법을 모르겠습니다. 페이지. 내 테이블도 길기 때문에 아래 코드만 사용하면 나머지 테이블의 길이가 줄어듭니다. 테이블의 너비를 자동으로 맞추는 동시에 다른 페이지에서도 테이블이 계속되도록 하는 방법을 찾고 있습니다(예: resizebox와 함께 'longtable'을 사용합니까?). 내 질문은 이것과 비슷합니다. 가로 페이지 너비에 맞게 긴 테이블 크기를 조정합니다. 하지만 나는 풍경을 원하지 않는다.

당신의 도움을 주셔서 대단히 감사합니다!

\documentclass[a4paper,12pt]{article}
\usepackage{longtable}
\usepackage{pdflscape}
\usepackage{graphicx}

\begin{document}


\begin{table}[ht]
\small  % Switch from 12pt to 11pt; otherwise, table won't fit
\setlength\LTleft{0pt}            % default: \parindent
\setlength\LTright{0pt}           % default: \fill
\begin{longtable}{llllllllll}
  \hline\hline %inserts double horizontal lines
   category & level & type & num1 & num2 & num3 & \multicolumn{2}{c}{$S1$} & \multicolumn{2}{c}{$S2$} \\ [0.5ex] 
    \hline % inserts single horizontal line
 &  &  &  &  &  & PP3 & PP4 & PP3 & PP4 \\
E1 & 7E-54 & S2 & NA & NA & NA & NA & NA & NA & NA \\
E2 & 4E-8 & S1 & 1 & 25428038:25828097 & 10023824146 & 9 & 91 & 50 & 50 \\
 &  &  & 1 & 25456834:25856893 & 10025905748 & 0.129 & 2.26 & 0.133 & 0.23 \\
&  & S & 1 & 25428038:25828097 & 10023824146 & 8.9 & 91.1 & 49.7 & 50.3 \\
 &  &  & 1 & 25456834:25856893 & 10025905748 & 0.129 & 2.22 & 0.133 & 0.226 \\
E3 & 4E-8 & S2 & 1 & 25488669:25888728 & 10025910500 & 12 & 88 & 57.7 & 42.2 \\
 &  & S & 1 & 25488669:25888728 & 10025910500 & 13.2 & 86.8 & 60.5 & 39.5 \\
E4 & 2E-145 & S1 & 1 & 25626305:26026364 & 10023820955 & 1.04 & 99 & 10.3 & 89.7 \\
 &  &  & 1 & 25624780:26024839 & 10025907287 & 1.92 & 98 & 16.9 & 82.5 \\
 &  &  & 1 & 25625807:26025866 & 10025935784 & 2.45 & 97.5 & 20.7 & 79.3 \\
 &  & S2 & 1 & 25626305:26026364 & 10023820955 & 1.09 & 98.9 & 10.6 & 89.4 \\
 &  &  & 1 & 25624780:26024839 & 10025907287 & 1.92 & 98 & 16.9 & 82.5 \\
 &  &  & 1 & 25625807:26025866 & 10025935784 & 3.29 & 96.7 & 25.9 & 74.1 \\
E5 & 1E-13 & S2 & 1 & 62870388:63270447 & 10023831002 & 9.39 & 90.6 & 51.1 & 48.9 \\
 &  & S3 & 1 & 62870388:63270447 & 10023831002 & 9.47 & 90.5 & 51.3 & 48.7 \\
 &  & S4 & 1 & 62870388:63270447 & 10023831002 & 7.64 & 92.4 & 45.5 & 54.5 \\
E6 & 1E-22 & S2 & 1 & 62849818:63249877 & 10023825945 & 5.44 & 94.6 & 36.9 & 63.1 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.56 & 13.5 & 1.79 & 1.54 \\
 &  & S3 & 1 & 62849818:63249877 & 10023825945 & 4.63 & 95.4 & 33.1 & 66.9 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.56 & 13.8 & 1.79 & 1.58 \\
 &  & S2 & 1 & 62849818:63249877 & 10023825945 & 5.54 & 94.5 & 37.3 & 62.7 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.55 & 14.3 & 1.79 & 1.64 \\
E7 & 5E-94 & S1 & 1 & 109618271:110018330 & 10025913212 & 0.159 & 99.8 & 2.43 & 97.6 \\
 &  & S2 & 1 & 109618271:110018330 & 10025913212 & 0.189 & 99.8 & 2.72 & 97.3 \\
E8 & 9.00E-17 & S1 & 1 & 109744528:110144587 & 10025910902 & 0.702 & 99.3 & 7.38 & 92.6 \\
E8 & 1E-22 & S2 & 1 & 62849818:63249877 & 10023825945 & 5.44 & 94.6 & 36.9 & 63.1 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.56 & 13.5 & 1.79 & 1.54 \\
 &  & S3 & 1 & 62849818:63249877 & 10023825945 & 4.63 & 95.4 & 33.1 & 66.9 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.56 & 13.8 & 1.79 & 1.58 \\
 &  & S2 & 1 & 62849818:63249877 & 10023825945 & 5.54 & 94.5 & 37.3 & 62.7 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.55 & 14.3 & 1.79 & 1.64 \\
E9 & 1E-22 & S2 & 1 & 62849818:63249877 & 10023825945 & 5.44 & 94.6 & 36.9 & 63.1 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.56 & 13.5 & 1.79 & 1.54 \\
 &  & S3 & 1 & 62849818:63249877 & 10023825945 & 4.63 & 95.4 & 33.1 & 66.9 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.56 & 13.8 & 1.79 & 1.58 \\
 &  & S2 & 1 & 62849818:63249877 & 10023825945 & 5.54 & 94.5 & 37.3 & 62.7 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.55 & 14.3 & 1.79 & 1.64 \\
E10 & 1E-22 & S2 & 1 & 62849818:63249877 & 10023825945 & 5.44 & 94.6 & 36.9 & 63.1 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.56 & 13.5 & 1.79 & 1.54 \\
 &  & S3 & 1 & 62849818:63249877 & 10023825945 & 4.63 & 95.4 & 33.1 & 66.9 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.56 & 13.8 & 1.79 & 1.58 \\
 &  & S2 & 1 & 62849818:63249877 & 10023825945 & 5.54 & 94.5 & 37.3 & 62.7 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.55 & 14.3 & 1.79 & 1.64 \\
E11 & 1E-22 & S2 & 1 & 62849818:63249877 & 10023825945 & 5.44 & 94.6 & 36.9 & 63.1 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.56 & 13.5 & 1.79 & 1.54 \\
 &  & S3 & 1 & 62849818:63249877 & 10023825945 & 4.63 & 95.4 & 33.1 & 66.9 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.56 & 13.8 & 1.79 & 1.58 \\
 &  & S2 & 1 & 62849818:63249877 & 10023825945 & 5.54 & 94.5 & 37.3 & 62.7 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.55 & 14.3 & 1.79 & 1.64 \\
E12 & 1E-22 & S2 & 1 & 62849818:63249877 & 10023825945 & 5.44 & 94.6 & 36.9 & 63.1 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.56 & 13.5 & 1.79 & 1.54 \\
 &  & S3 & 1 & 62849818:63249877 & 10023825945 & 4.63 & 95.4 & 33.1 & 66.9 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.56 & 13.8 & 1.79 & 1.58 \\
 &  & S2 & 1 & 62849818:63249877 & 10023825945 & 5.54 & 94.5 & 37.3 & 62.7 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.55 & 14.3 & 1.79 & 1.64 \\
E13 & 1E-22 & S2 & 1 & 62849818:63249877 & 10023825945 & 5.44 & 94.6 & 36.9 & 63.1 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.56 & 13.5 & 1.79 & 1.54 \\
 &  & S3 & 1 & 62849818:63249877 & 10023825945 & 4.63 & 95.4 & 33.1 & 66.9 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.56 & 13.8 & 1.79 & 1.58 \\
 &  & S2 & 1 & 62849818:63249877 & 10023825945 & 5.54 & 94.5 & 37.3 & 62.7 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.55 & 14.3 & 1.79 & 1.64 \\
E14 & 1E-22 & S2 & 1 & 62849818:63249877 & 10023825945 & 5.44 & 94.6 & 36.9 & 63.1 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.56 & 13.5 & 1.79 & 1.54 \\
 &  & S3 & 1 & 62849818:63249877 & 10023825945 & 4.63 & 95.4 & 33.1 & 66.9 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.56 & 13.8 & 1.79 & 1.58 \\
 &  & S2 & 1 & 62849818:63249877 & 10023825945 & 5.54 & 94.5 & 37.3 & 62.7 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.55 & 14.3 & 1.79 & 1.64 \\
E15 & 1E-22 & S2 & 1 & 62849818:63249877 & 10023825945 & 5.44 & 94.6 & 36.9 & 63.1 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.56 & 13.5 & 1.79 & 1.54 \\
 &  & S3 & 1 & 62849818:63249877 & 10023825945 & 4.63 & 95.4 & 33.1 & 66.9 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.56 & 13.8 & 1.79 & 1.58 \\
 &  & S2 & 1 & 62849818:63249877 & 10023825945 & 5.54 & 94.5 & 37.3 & 62.7 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.55 & 14.3 & 1.79 & 1.64 \\
\hline
\end{longtable}
      \begin{flushleft}This is the captio of my table
     \end{flushleft}
      \label{tab:label}
  \end{table}

\end{document}

답변1

문서에 나와 있듯이 a table는 상자이므로 페이지를 깰 수 없으므로 longtable함께 사용하면 안 됩니다. 이를 제거하면 대부분의 문제가 해결됩니다. 그런 다음 크기를 변경하고 열을 약간 누르면 모두 맞습니다.

\documentclass[a4paper,12pt]{article}
\usepackage{longtable}
\usepackage{pdflscape}
\usepackage{graphicx}

\begin{document}



\footnotesize  % Switch from 12pt to 11pt; otherwise, table won't fit
\setlength\LTleft{-30pt}            % default: \fill
\setlength\LTright{-30pt}           % default: \fill
\begin{longtable}{@{\extracolsep{\fill}}llllllllll@{}}
  \hline\hline %inserts double horizontal lines
   cat. & level & type & num1 & num2 & num3 & \multicolumn{2}{c}{$S1$} & \multicolumn{2}{c}{$S2$} \\ [0.5ex] 
    \hline % inserts single horizontal line
 &  &  &  &  &  & PP3 & PP4 & PP3 & PP4 \\
E1 & 7E-54 & S2 & NA & NA & NA & NA & NA & NA & NA \\
E2 & 4E-8 & S1 & 1 & 25428038:25828097 & 10023824146 & 9 & 91 & 50 & 50 \\
 &  &  & 1 & 25456834:25856893 & 10025905748 & 0.129 & 2.26 & 0.133 & 0.23 \\
&  & S & 1 & 25428038:25828097 & 10023824146 & 8.9 & 91.1 & 49.7 & 50.3 \\
 &  &  & 1 & 25456834:25856893 & 10025905748 & 0.129 & 2.22 & 0.133 & 0.226 \\
E3 & 4E-8 & S2 & 1 & 25488669:25888728 & 10025910500 & 12 & 88 & 57.7 & 42.2 \\
 &  & S & 1 & 25488669:25888728 & 10025910500 & 13.2 & 86.8 & 60.5 & 39.5 \\
E4 & 2E-145 & S1 & 1 & 25626305:26026364 & 10023820955 & 1.04 & 99 & 10.3 & 89.7 \\
 &  &  & 1 & 25624780:26024839 & 10025907287 & 1.92 & 98 & 16.9 & 82.5 \\
 &  &  & 1 & 25625807:26025866 & 10025935784 & 2.45 & 97.5 & 20.7 & 79.3 \\
 &  & S2 & 1 & 25626305:26026364 & 10023820955 & 1.09 & 98.9 & 10.6 & 89.4 \\
 &  &  & 1 & 25624780:26024839 & 10025907287 & 1.92 & 98 & 16.9 & 82.5 \\
 &  &  & 1 & 25625807:26025866 & 10025935784 & 3.29 & 96.7 & 25.9 & 74.1 \\
E5 & 1E-13 & S2 & 1 & 62870388:63270447 & 10023831002 & 9.39 & 90.6 & 51.1 & 48.9 \\
 &  & S3 & 1 & 62870388:63270447 & 10023831002 & 9.47 & 90.5 & 51.3 & 48.7 \\
 &  & S4 & 1 & 62870388:63270447 & 10023831002 & 7.64 & 92.4 & 45.5 & 54.5 \\
E6 & 1E-22 & S2 & 1 & 62849818:63249877 & 10023825945 & 5.44 & 94.6 & 36.9 & 63.1 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.56 & 13.5 & 1.79 & 1.54 \\
 &  & S3 & 1 & 62849818:63249877 & 10023825945 & 4.63 & 95.4 & 33.1 & 66.9 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.56 & 13.8 & 1.79 & 1.58 \\
 &  & S2 & 1 & 62849818:63249877 & 10023825945 & 5.54 & 94.5 & 37.3 & 62.7 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.55 & 14.3 & 1.79 & 1.64 \\
E7 & 5E-94 & S1 & 1 & 109618271:110018330 & 10025913212 & 0.159 & 99.8 & 2.43 & 97.6 \\
 &  & S2 & 1 & 109618271:110018330 & 10025913212 & 0.189 & 99.8 & 2.72 & 97.3 \\
E8 & 9.00E-17 & S1 & 1 & 109744528:110144587 & 10025910902 & 0.702 & 99.3 & 7.38 & 92.6 \\
E8 & 1E-22 & S2 & 1 & 62849818:63249877 & 10023825945 & 5.44 & 94.6 & 36.9 & 63.1 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.56 & 13.5 & 1.79 & 1.54 \\
 &  & S3 & 1 & 62849818:63249877 & 10023825945 & 4.63 & 95.4 & 33.1 & 66.9 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.56 & 13.8 & 1.79 & 1.58 \\
 &  & S2 & 1 & 62849818:63249877 & 10023825945 & 5.54 & 94.5 & 37.3 & 62.7 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.55 & 14.3 & 1.79 & 1.64 \\
E9 & 1E-22 & S2 & 1 & 62849818:63249877 & 10023825945 & 5.44 & 94.6 & 36.9 & 63.1 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.56 & 13.5 & 1.79 & 1.54 \\
 &  & S3 & 1 & 62849818:63249877 & 10023825945 & 4.63 & 95.4 & 33.1 & 66.9 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.56 & 13.8 & 1.79 & 1.58 \\
 &  & S2 & 1 & 62849818:63249877 & 10023825945 & 5.54 & 94.5 & 37.3 & 62.7 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.55 & 14.3 & 1.79 & 1.64 \\
E10 & 1E-22 & S2 & 1 & 62849818:63249877 & 10023825945 & 5.44 & 94.6 & 36.9 & 63.1 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.56 & 13.5 & 1.79 & 1.54 \\
 &  & S3 & 1 & 62849818:63249877 & 10023825945 & 4.63 & 95.4 & 33.1 & 66.9 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.56 & 13.8 & 1.79 & 1.58 \\
 &  & S2 & 1 & 62849818:63249877 & 10023825945 & 5.54 & 94.5 & 37.3 & 62.7 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.55 & 14.3 & 1.79 & 1.64 \\
E11 & 1E-22 & S2 & 1 & 62849818:63249877 & 10023825945 & 5.44 & 94.6 & 36.9 & 63.1 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.56 & 13.5 & 1.79 & 1.54 \\
 &  & S3 & 1 & 62849818:63249877 & 10023825945 & 4.63 & 95.4 & 33.1 & 66.9 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.56 & 13.8 & 1.79 & 1.58 \\
 &  & S2 & 1 & 62849818:63249877 & 10023825945 & 5.54 & 94.5 & 37.3 & 62.7 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.55 & 14.3 & 1.79 & 1.64 \\
E12 & 1E-22 & S2 & 1 & 62849818:63249877 & 10023825945 & 5.44 & 94.6 & 36.9 & 63.1 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.56 & 13.5 & 1.79 & 1.54 \\
 &  & S3 & 1 & 62849818:63249877 & 10023825945 & 4.63 & 95.4 & 33.1 & 66.9 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.56 & 13.8 & 1.79 & 1.58 \\
 &  & S2 & 1 & 62849818:63249877 & 10023825945 & 5.54 & 94.5 & 37.3 & 62.7 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.55 & 14.3 & 1.79 & 1.64 \\
E13 & 1E-22 & S2 & 1 & 62849818:63249877 & 10023825945 & 5.44 & 94.6 & 36.9 & 63.1 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.56 & 13.5 & 1.79 & 1.54 \\
 &  & S3 & 1 & 62849818:63249877 & 10023825945 & 4.63 & 95.4 & 33.1 & 66.9 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.56 & 13.8 & 1.79 & 1.58 \\
 &  & S2 & 1 & 62849818:63249877 & 10023825945 & 5.54 & 94.5 & 37.3 & 62.7 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.55 & 14.3 & 1.79 & 1.64 \\
E14 & 1E-22 & S2 & 1 & 62849818:63249877 & 10023825945 & 5.44 & 94.6 & 36.9 & 63.1 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.56 & 13.5 & 1.79 & 1.54 \\
 &  & S3 & 1 & 62849818:63249877 & 10023825945 & 4.63 & 95.4 & 33.1 & 66.9 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.56 & 13.8 & 1.79 & 1.58 \\
 &  & S2 & 1 & 62849818:63249877 & 10023825945 & 5.54 & 94.5 & 37.3 & 62.7 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.55 & 14.3 & 1.79 & 1.64 \\
E15 & 1E-22 & S2 & 1 & 62849818:63249877 & 10023825945 & 5.44 & 94.6 & 36.9 & 63.1 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.56 & 13.5 & 1.79 & 1.54 \\
 &  & S3 & 1 & 62849818:63249877 & 10023825945 & 4.63 & 95.4 & 33.1 & 66.9 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.56 & 13.8 & 1.79 & 1.58 \\
 &  & S2 & 1 & 62849818:63249877 & 10023825945 & 5.54 & 94.5 & 37.3 & 62.7 \\
 &  &  & 1 & 62720869:63120928 & 10023851197 & 1.55 & 14.3 & 1.79 & 1.64 \\
\hline
\end{longtable}


\end{document}

관련 정보