2페이지의 표에 이중 언어 캡션을 추가하세요.

2페이지의 표에 이중 언어 캡션을 추가하세요.

Longtable에 bicaption을 사용하려고 하는데 문제가 있습니다.

2페이지 표에 이중 언어 캡션을 추가하고 싶은데 영어 캡션이나 다른 언어 캡션만 추가할 수 있습니다. 그것을 달성하기 위해 무엇을 할 수 있습니까?

예는 다음과 같습니다.

\documentclass[UTF-8]{ctexbook}
\usepackage{lipsum} % for random text
\usepackage{longtable} % for long table
\usepackage{makecell}
\usepackage{bicaption}
\DeclareCaptionOption{bi-first}[]{
    \def\tablename{表}
    \def\figurename{图}}
\DeclareCaptionOption{bi-second}[]{
    \def\tablename{Table.}
    \def\figurename{Fig.}}
\captionsetup[bi-first]{bi-first}
\captionsetup[bi-second]{bi-second}
\usepackage{booktabs}

\begin{document}
    
\lipsum[1]

{
    \small
    \begin{longtable}{p{4cm}<{\centering} p{4cm}<{\centering} p{4cm}<{\centering}}
        \bicaption{表}{table}
        \label{table:cabin_setup}\\
        \toprule[1.5pt]
        column1 & column2 & column3 \\
        \midrule[0.5pt]
        \endfirsthead
        \multicolumn{3}{c}%
        {\tablename\ \thetable{} table(continued)}\\
        \toprule[1.5pt]
        column1 & column2 & column3\\
        \midrule[0.5pt]
        \endhead
        \bottomrule[1.5pt] \\
        \endfoot
        \bottomrule[1.5pt]
        \endlastfoot
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\ \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
    \end{longtable}
}
\end{document}

답변1

이를 수동으로 추가하는 대신, 이후 페이지마다 동일한 형식의 제목을 원하는 \bicaption경우 \endfirsthead. 각 인수 앞에 대괄호를 넣고 다음과 같이 비워 두었습니다. \bicaption[]{表(续)}[]{table(continued)}캡션에 번호를 매기되 매번 테이블 목록에 추가하지 않기 위해서입니다. 효과를 보여주기 위해 표를 길게 만들고 첫 페이지에 표 목록을 포함시켰습니다. 이것이 당신의 방법보다 나은지 모르겠습니다. 원하는 스타일을 결정할 수 있습니다. 코드는 다음과 같습니다.

\documentclass[UTF-8]{ctexbook}
\usepackage{lipsum} % for random text
\usepackage{longtable} % for long table
\usepackage{makecell}
\usepackage{bicaption}

\DeclareCaptionOption{bi-first}[]{
    \def\tablename{表}
    \def\figurename{图}}
\DeclareCaptionOption{bi-second}[]{
    \def\tablename{Table.}
    \def\figurename{Fig.}}
\captionsetup[bi-first]{bi-first}
\captionsetup[bi-second]{bi-second}
\usepackage{booktabs}

\begin{document}

\listoftables

\clearpage
\lipsum[1]

{
    \small
    \begin{longtable}{p{4cm}<{\centering} p{4cm}<{\centering} p{4cm}<{\centering}}
        \bicaption{表}{table}
        \label{table:cabin_setup}\\
        \toprule[1.5pt]
        column1 & column2 & column3 \\
        \midrule[0.5pt]
        \endfirsthead
        \bicaption[]{表(续)}[]{table(continued)}\\
        \toprule[1.5pt]
        column1 & column2 & column3\\
        \midrule[0.5pt]
        \endhead
        \bottomrule[1.5pt] \\
        \endfoot
        \bottomrule[1.5pt]
        \endlastfoot
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\ \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
        1 & 2 & 3 \\
    \end{longtable}
}
\end{document}

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

답변2

문제가 해결되었습니다. 캡션을 수동으로 추가하고 원하는 것을 얻으려고 노력하지만 완벽하지는 않을 수도 있습니다. 코드는 다음과 같습니다:


\documentclass[UTF-8]{ctexbook}
\usepackage{lipsum} % for random text
\usepackage{longtable} % for long table
\usepackage{makecell}
\usepackage{bicaption}
\DeclareCaptionOption{bi-first}[]{
    \def\tablename{表}
    \def\figurename{图}}
\DeclareCaptionOption{bi-second}[]{
    \def\tablename{Table.}
    \def\figurename{Fig.}}
\captionsetup[bi-first]{bi-first}
\captionsetup[bi-second]{bi-second}
\usepackage{booktabs}

\begin{document}
    
    \lipsum[1]
    
    {
        \small
        \begin{longtable}{p{4cm}<{\centering} p{4cm}<{\centering} p{4cm}<{\centering}}
            \bicaption{表}{table}
            \label{table:cabin_setup}\\
            \toprule[1.5pt]
            column1 & column2 & column3 \\
            \midrule[0.5pt]
            \endfirsthead
            \multicolumn{3}{c}%
            {\tablename\ \thetable{} 表(续)}\\
            \multicolumn{3}{c}%
            {\tablename\ \thetable{} table(continued)}\\
            \toprule[1.5pt]
            column1 & column2 & column3\\
            \midrule[0.5pt]
            \endhead
            \bottomrule[1.5pt] \\
            \endfoot
            \bottomrule[1.5pt]
            \endlastfoot
            1 & 2 & 3 \\
            1 & 2 & 3 \\
            1 & 2 & 3 \\
            1 & 2 & 3 \\
            1 & 2 & 3 \\ \\
            1 & 2 & 3 \\
            1 & 2 & 3 \\
            1 & 2 & 3 \\
            1 & 2 & 3 \\
            1 & 2 & 3 \\
            1 & 2 & 3 \\
            1 & 2 & 3 \\
            1 & 2 & 3 \\
            1 & 2 & 3 \\
            1 & 2 & 3 \\
            1 & 2 & 3 \\
            1 & 2 & 3 \\
            1 & 2 & 3 \\
            1 & 2 & 3 \\
            1 & 2 & 3 \\
            1 & 2 & 3 \\
            1 & 2 & 3 \\
            1 & 2 & 3 \\
            1 & 2 & 3 \\
        \end{longtable}
    }
\end{document}

관련 정보