ltablex 캡션 텍스트 형식 문제

ltablex 캡션 텍스트 형식 문제

ltablex여러 페이지에 걸쳐 긴 테이블을 만드는 데 패키지를 사용하고 있습니다 . 다른 작은 테이블의 경우 tabularx패키지를 사용했는데 형식 오류나 버그를 발견했습니까?

생성된 긴 테이블의 테이블 캡션 텍스트가 bottomrule줄과 올바르게 플러시되지 않습니다.

코드를 실행하면 작은 테이블 하단의 캡션이 해당 bottomrule줄과 올바르게 일치하는 것을 볼 수 있습니다. 그러나 긴 테이블에서는 캡션 텍스트가 bottomrule줄과 올바르게 일치하지 않았습니다. 왼쪽에 텍스트가 약간 눈에 띕니다.

\begin{table]및 환경 없이 작은 테이블을 사용 \end{table}하고 캡션을 안에 넣으면 tabularx긴 테이블에서와 동일한 문제가 나타납니다. 그러면 긴 테이블에서 제대로 작동하도록 하려면 어떻게 해야 합니까? 거기에서는 \begin{table]및 환경을 사용할 수 없습니다 . 그러면 및 환경 \end{table}이 포함된 작은 테이블과 같은 형식으로 캡션 텍스트를 얻을 수 있는 다른 방법이 있습니까 ?\begin{table]\end{table}

두 장의 사진을 추가했습니다. 첫 번째는 긴 테이블의 일부를 보여주고 두 번째는 작은 테이블을 보여줍니다.

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

편집 - 전체 코드

\documentclass[%
a4paper,
12pt,                   
oneside,
captions=nooneline,
parskip=half
]
{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
%\usepackage{tabularx}
\usepackage{ltablex}
\usepackage{booktabs}
\usepackage{mathptmx}% Times

\setkomafont{disposition}{\normalfont\bfseries}
\setkomafont{caption}{\fontsize{9pt}{9pt}\selectfont}

\begin{document}

\keepXColumns
\begin{table}[htbp]
\begin{tabularx}{\textwidth}{XX}
\toprule
\textbf{Column 1} & \textbf{Column 2} \\
\midrule
$R$ & 1This is an example sentence \\
$R$ & 2As well as the line before \\
$A$ & 3Also this is an example \\
$R$ & 4This is an example sentence \\
$R$ & 5As well as the line before \\
$A$ & 6Also this is an example \\
$R$ & 7This is an example sentence \\
$R$ & 8As well as the line before \\
$A$ & 9Also this is an example \\
$R$ & 10This is an example sentence \\
$R$ & 11As well as the line before \\
$A$ & 12Also this is an example \\
\bottomrule
\end{tabularx}  
\caption{Example of an table} 
\end{table}

\newpage

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

\end{document}

답변1

사용

\usepackage{booktabs}
\usepackage{ltablex}
\setkomafont{disposition}{\normalfont\bfseries}
\setkomafont{caption}{\small}    
\begin{document}

\keepXColumns
\begin{tabularx}{\textwidth}{Xx}\toprule
        \textbf{Column 1} & \textbf{Column 2} \\\midrule
        $R$ & 1This is an example sentence \\
        $R$ & 2As well as the line before \\
        $A$ & 3Also this is an example \\
        $R$ & 4This is an example sentence \\
        $R$ & 5As well as the line before \\
        $A$ & 6Also this is an example \\
        $R$ & 7This is an example sentence \\
        $R$ & 8As well as the line before \\
        $A$ & 9Also this is an example \\
        $R$ & 10This is an example sentence \\
        $R$ & 11As well as the line before \\
        $A$ & 12Also this is an example \\
        \bottomrule
    \caption{Example of an table} \\
    \end{tabularx}  

\begin{tabularx}{\textwidth}{XX}
    \toprule
    \textbf{Column 1} & \textbf{Column 2} \\
    \midrule
    $R$ & 1This is an example sentence \\
    $R$ & 2As well as the line before \\
    [...]

캡션은 안에 있어야 합니다 tabularx. 그리고~ 아니다table에 대한 환경을 사용합니다 tabularx. 자체 table카운터가 있습니다.

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

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

답변2

내 문제에 대한 해결책은 \captionsetup{margin=1pt}캡션 패키지를 사용하는 것입니다. 2pt를 사용하면 캡션이 올바르게 정렬되었습니다.

덕분에허버트!

또는 나처럼 Komascript를 사용할 때 대안으로 명령도 \setcapmargin{2pt}동일하게 수행됩니다.

답변3

캡션은 테이블 하단에 캡션을 원하는 경우 사양 longtable내부에서 와 마찬가지로 테이블에 통합되어야 합니다. 또는 테이블 위에 캡션을 두는 것이 좋습니다(권장).foothead

또한 를 로드하는 경우 ltablex에 의해 로드되므로 ltablex로드할 필요가 없습니다 tabularx.longtable

    \documentclass[a4paper]{article}%
    \usepackage{ltablex, booktabs}
    \usepackage[showframe]{geometry}
    \usepackage{caption}
    \captionsetup[table]{singlelinecheck=off, position=bottom}
     \usepackage{etoolbox}

    \begin{document}

    \keepXColumns
     \begin{table}[htbp]
    \begin{tabularx}{\linewidth}{XX}
    \toprule
    \textbf{Column 1} & \textbf{Column 2} \\
    \midrule
    $R$ & 1This is an example sentence \\
    $R$ & 2As well as the line before \\
    $A$ & 3Also this is an example \\
    $R$ & 4This is an example sentence \\
    $R$ & 5As well as the line before \\
    $A$ & 6Also this is an example \\
    $R$ & 7This is an example sentence \\
    $R$ & 8As well as the line before \\
    $A$ & 9Also this is an example \\
    $R$ & 10This is an example sentence \\
    $R$ & 11As well as the line before \\
    $A$ & 12Also this is an example \\
    \bottomrule
    \end{tabularx}
    \caption{Example of an table}
    \end{table}

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

    \end{document} 

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

관련 정보