테이블 환경을 이용하여 여러 페이지에 테이블을 만드는 방법

테이블 환경을 이용하여 여러 페이지에 테이블을 만드는 방법

편집하다아래의 일부 의견과 마찬가지로 table환경에서는 두 페이지 이상의 테이블을 허용하지 않는다는 점을 언급하고 있습니다. 그러나 솔루션은 잘 작동합니다.

한 페이지 이상의 표를 만들어야 합니다. 표준적인 접근 방식은 환경을 활용하는 것 같습니다 ltablex. 그러나 작동하지 않습니다. 또한 table내가 작업하는 논문 템플릿에도 환경이 필요할 수 있다고 가정합니다 (예: 를 가정 capture).

\documentclass[11pt]{article}
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{ltablex} 
\begin{document}

\begin{table}
\caption{Example of an table}
\label{tab:daypack}     
\begin{tabularx}{\linewidth}{@{}cX@{}}  
\toprule
\textbf{Column 1} & \textbf{Column 2} \\[6pt]
\midrule
\endhead
$R$ & 1This is an example sentence \\[6pt]
$R$ & 2As well as the line before \\[6pt]
$A$ & 3Also this is an example \\[6pt]
$R$ & 4This is an example sentence \\[6pt]
$R$ & 5As well as the line before \\[6pt]
$A$ & 6Also this is an example \\[6pt]
$R$ & 7This is an example sentence \\[6pt]
$R$ & 8As well as the line before \\[6pt]
$A$ & 9Also this is an example \\[6pt]
$R$ & 10This is an example sentence \\[6pt]
$R$ & 11As well as the line before \\[6pt]
$A$ & 12Also this is an example \\[6pt]
$R$ & 13This is an example sentence \\[6pt]
$R$ & 14As well as the line before \\[6pt]
$A$ & 15Also this is an example \\[6pt]
$R$ & 16This is an example sentence \\[6pt]
$R$ & 17As well as the line before \\[6pt]
$A$ & 18Also this is an example \\[6pt]
$R$ & 19This is an example sentence \\[6pt]
$R$ & 20As well as the line before \\[6pt]
$A$ & 21Also this is an example \\[6pt]
$R$ & 22This is an example sentence \\[6pt]
$R$ & 23As well as the line before \\[6pt]
$A$ & 24Also this is an example \\[6pt]
$R$ & 25This is an example sentence \\[6pt]
$R$ & 26As well as the line before \\[6pt]
$A$ & 27Also this is an example \\[6pt]
$R$ & 28This is an example sentence \\[6pt]
$R$ & 29As well as the line before \\[6pt]
$A$ & 30Also this is an example \\[6pt]
$R$ & 31This is an example sentence \\[6pt]
$R$ & 32As well as the line before \\[6pt]
$A$ & 33Also this is an example \\[6pt]
$R$ & 34This is an example sentence \\[6pt]
$R$ & 35As well as the line before \\[6pt]
$A$ & 36Also this is an example \\[6pt]
$R$ & 37This is an example sentence \\[6pt]
\bottomrule
\end{tabularx}   
\end{table}    

\end{document}

답변1

tabularx와 longtable을 결합해야 한다면 ltablex보다 ltxtable을 선호합니다.

\documentclass[11pt]{article}
\usepackage{booktabs}
\usepackage{ltxtable} 
\begin{document}



\LTXtable{\textwidth}{t1.tex}


\end{document}

어디에t1.tex

\begin{longtable}{@{}cX@{}}  
\toprule
\textbf{Column 1} & \textbf{Column 2} \\[6pt]
\midrule
\endhead
$R$ & 1This is an example sentence \\[6pt]
$R$ & 2As well as the line before \\[6pt]
$A$ & 3Also this is an example \\[6pt]
$R$ & 4This is an example sentence \\[6pt]
$R$ & 5As well as the line before \\[6pt]
$A$ & 6Also this is an example \\[6pt]
$R$ & 7This is an example sentence \\[6pt]
$R$ & 8As well as the line before \\[6pt]
$A$ & 9Also this is an example \\[6pt]
$R$ & 10This is an example sentence \\[6pt]
$R$ & 11As well as the line before \\[6pt]
$A$ & 12Also this is an example \\[6pt]
$R$ & 13This is an example sentence \\[6pt]
$R$ & 14As well as the line before \\[6pt]
$A$ & 15Also this is an example \\[6pt]
$R$ & 16This is an example sentence \\[6pt]
$R$ & 17As well as the line before \\[6pt]
$A$ & 18Also this is an example \\[6pt]
$R$ & 19This is an example sentence \\[6pt]
$R$ & 20As well as the line before \\[6pt]
$A$ & 21Also this is an example \\[6pt]
$R$ & 22This is an example sentence \\[6pt]
$R$ & 23As well as the line before \\[6pt]
$A$ & 24Also this is an example \\[6pt]
$R$ & 25This is an example sentence \\[6pt]
$R$ & 26As well as the line before \\[6pt]
$A$ & 27Also this is an example \\[6pt]
$R$ & 28This is an example sentence \\[6pt]
$R$ & 29As well as the line before \\[6pt]
$A$ & 30Also this is an example \\[6pt]
$R$ & 31This is an example sentence \\[6pt]
$R$ & 32As well as the line before \\[6pt]
$A$ & 33Also this is an example \\[6pt]
$R$ & 34This is an example sentence \\[6pt]
$R$ & 35As well as the line before \\[6pt]
$A$ & 36Also this is an example \\[6pt]
$R$ & 37This is an example sentence \\[6pt]
\bottomrule
\end{longtable}   

답변2

올바른 코드를 사용하면 제대로 작동합니다. 환경 없음 table- 긴 테이블은 부동 소수점이 될 수 없으며 캡션은 바로 뒤에 있습니다 begin{tabularx}.

    \documentclass[11pt]{article}
    \usepackage[utf8]{inputenc}
    \usepackage{booktabs}
    \usepackage{ltablex}

    \begin{document}

    \label{tab:daypack}
    \begin{tabularx}{\linewidth}{@{}cX@{}}
    \caption{Example of an table}\\
    \toprule
    \textbf{Column 1} & \textbf{Column 2} \\[6pt]
    \midrule
    \endhead

    $R$ & 1This is an example sentence \\[6pt]
    $R$ & 2As well as the line before \\[6pt]
    $A$ & 3Also this is an example \\[6pt]
    $R$ & 4This is an example sentence \\[6pt]
    $R$ & 5As well as the line before \\[6pt]
    $A$ & 6Also this is an example \\[6pt]
    $R$ & 7This is an example sentence \\[6pt]
    $R$ & 8As well as the line before \\[6pt]
    $A$ & 9Also this is an example \\[6pt]
    $R$ & 10This is an example sentence \\[6pt]
    $R$ & 11As well as the line before \\[6pt]
    $A$ & 12Also this is an example \\[6pt]
    $R$ & 13This is an example sentence \\[6pt]
    $R$ & 14As well as the line before \\[6pt]
    $A$ & 15Also this is an example \\[6pt]
    $R$ & 16This is an example sentence \\[6pt]
    $R$ & 17As well as the line before \\[6pt]
    $A$ & 18Also this is an example \\[6pt]
    $R$ & 19This is an example sentence \\[6pt]
    $R$ & 20As well as the line before \\[6pt]
    $A$ & 21Also this is an example \\[6pt]
    $R$ & 22This is an example sentence \\[6pt]
    $R$ & 23As well as the line before \\[6pt]
    $A$ & 24Also this is an example \\[6pt]
    $R$ & 25This is an example sentence \\[6pt]
    $R$ & 26As well as the line before \\[6pt]
    $A$ & 27Also this is an example \\[6pt]
    $R$ & 28This is an example sentence \\[6pt]
    $R$ & 29As well as the line before \\[6pt]
    $A$ & 30Also this is an example \\[6pt]
    $R$ & 31This is an example sentence \\[6pt]
    $R$ & 32As well as the line before \\[6pt]
    $A$ & 33Also this is an example \\[6pt]
    $R$ & 34This is an example sentence \\[6pt]
    $R$ & 35As well as the line before \\[6pt]
    $A$ & 36Also this is an example \\[6pt]
    $R$ & 37This is an example sentence \\[6pt]
    \bottomrule
    \end{tabularx}

    \end{document} 

여기에 이미지 설명을 입력하세요

답변3

longtable패키지의 사용longtable

\documentclass[11pt]{article}
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{ltablex} 
\usepackage{longtable}
\begin{document}

\begin{longtable}{cc}  
\caption{Example of an table} \\
\textbf{Column 1} & \textbf{Column 2} \\[6pt]
$R$ & 1This is an example sentence \\[6pt]
$R$ & 2As well as the line before \\[6pt]
$A$ & 3Also this is an example \\[6pt]
$R$ & 4This is an example sentence \\[6pt]
$R$ & 5As well as the line before \\[6pt]
$A$ & 6Also this is an example \\[6pt]
$R$ & 7This is an example sentence \\[6pt]
$R$ & 8As well as the line before \\[6pt]
$A$ & 9Also this is an example \\[6pt]
$R$ & 10This is an example sentence \\[6pt]
$R$ & 11As well as the line before \\[6pt]
$A$ & 12Also this is an example \\[6pt]
$R$ & 13This is an example sentence \\[6pt]
$R$ & 14As well as the line before \\[6pt]
$A$ & 15Also this is an example \\[6pt]
$R$ & 16This is an example sentence \\[6pt]
$R$ & 17As well as the line before \\[6pt]
$A$ & 18Also this is an example \\[6pt]
$R$ & 19This is an example sentence \\[6pt]
$R$ & 20As well as the line before \\[6pt]
$A$ & 21Also this is an example \\[6pt]
$R$ & 22This is an example sentence \\[6pt]
$R$ & 23As well as the line before \\[6pt]
$A$ & 24Also this is an example \\[6pt]
$R$ & 25This is an example sentence \\[6pt]
$R$ & 26As well as the line before \\[6pt]
$A$ & 27Also this is an example \\[6pt]
$R$ & 28This is an example sentence \\[6pt]
$R$ & 29As well as the line before \\[6pt]
$A$ & 30Also this is an example \\[6pt]
$R$ & 31This is an example sentence \\[6pt]
$R$ & 32As well as the line before \\[6pt]
$A$ & 33Also this is an example \\[6pt]
$R$ & 34This is an example sentence \\[6pt]
$R$ & 35As well as the line before \\[6pt]
$A$ & 36Also this is an example \\[6pt]
$R$ & 37This is an example sentence \\[6pt]
\end{longtable}    

\end{document}

관련 정보