adicione uma legenda bilíngue para a tabela na página dois

adicione uma legenda bilíngue para a tabela na página dois

Estou tentando usar bicaption para longtable, mas estou com um problema:

Quero adicionar uma legenda bilíngue para a tabela da página dois, mas só posso adicionar uma legenda em inglês ou em outro idioma. O que posso fazer para alcançá-lo?

Aqui está um exemplo:

\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}

Responder1

Em vez de adicionar isso corajosamente, se você quiser um mesmo formato de título em cada página posterior, basta colocar outro \bicaptioncomando após o \endfirsthead. Coloco os colchetes antes de cada argumento e os deixo vazios assim: \bicaption[]{表(续)}[]{table(continued)}para numerar a legenda, mas não adicioná-la sempre à lista de tabelas. Aumentei a tabela para mostrar o efeito e incluí uma lista de tabelas na primeira página. Não sei se isso é melhor que o seu método. Você pode decidir qual estilo deseja. Aqui está o código:

\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}

insira a descrição da imagem aqui insira a descrição da imagem aqui

Responder2

O problema está resolvido. Tento adicionar a legenda manualmente e consigo o que quero, embora talvez não seja perfeito. O código é o seguinte:


\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}

informação relacionada