
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}