Replies: 2 comments
-
You can get started with this answer of mine: |
Beta Was this translation helpful? Give feedback.
0 replies
-
thanks! I got it. The MWE is, \UseTblrLibrary{counter}
\UseTblrLibrary{booktabs}
% 参见:https://tex.stackexchange.com/questions/634767/tabularray-how-to-have-different-continued-captions/634814#634814
% 定义参数提取Expl3函数
\ExplSyntaxOn
% 提取参数表中的第1个参数
\NewDocumentCommand\FirstOfTwo{m}{
\exp_last_unbraced:Ne \use_i:nn { #1 }
}
% 提取参数表中的第2个参数
\NewDocumentCommand\SecondOfTwo{m}{
\exp_last_unbraced:Ne \use_ii:nn { #1 }
}
\ExplSyntaxOff
% 定义提取中文标题模板
\DefTblrTemplate{caption-text}{zh}{\FirstOfTwo{\InsertTblrText{caption}}}
% 定义提取英文标题模板
\DefTblrTemplate{caption-text}{en}{\SecondOfTwo{\InsertTblrText{caption}}}
% 定义提取中文标题引号词
\DefTblrTemplate{caption-tag}{zh}{\tablename\hspace{0.25em}\thetable}
% 定义提取英文标题引号词
\DefTblrTemplate{caption-tag}{en}{Table.\hspace{0.25em}\thetable}
% 定义尾注续表文本
\DeclareTblrTemplate{contfoot-text}{default}{接下页(Continued on next page)}
% 定义标题中文续表文本
\DeclareTblrTemplate{conthead-text}{zh}{(续)}
% 定义标题英文续表文本
\DeclareTblrTemplate{conthead-text}{en}{(Continued)}
% 设置首页标题
\DefTblrTemplate{firsthead}{default}{
\centering
\UseTblrTemplate{caption-tag}{zh}
\UseTblrTemplate{caption-sep}{default}
\UseTblrTemplate{caption-text}{zh}
\par
\UseTblrTemplate{caption-tag}{en}
\UseTblrTemplate{caption-sep}{default}
\UseTblrTemplate{caption-text}{en}
\par
}
% 设置中页和尾页标题
\DefTblrTemplate{middlehead,lasthead}{default}{
\centering
\centering
\UseTblrTemplate{caption-tag}{zh}
\UseTblrTemplate{caption-sep}{default}
\UseTblrTemplate{caption-text}{zh}
\UseTblrTemplate{conthead-text}{zh}%
\par
\UseTblrTemplate{caption-tag}{en}
\UseTblrTemplate{caption-sep}{default}
\UseTblrTemplate{caption-text}{en}
\UseTblrTemplate{conthead-text}{en}%
\par
}
% 设置标题样式
\NewTblrTheme{fancy}{%
\SetTblrStyle{firsthead,middlehead,lasthead}{font=\small\sffamily}
\SetTblrStyle{firstfoot,middlefoot,lastfoot}{font=\small}
\SetTblrStyle{firstfoot,middlefoot}{fg=blue2}
\SetTblrStyle{middlefoot}{\itshape}
\SetTblrStyle{caption}{red2}
\SetTblrStyle{capcont}{red2}
} and the longtblr is, \begin{longtblr}[%
caption = {一个长长长长长长长长长的表格}
{blalalalalalallablalalalalalalla},
entry = {短标题},
label = {tblr:test1},
note{a} = {第一个表注。},
note{$\dag$} = {第二个长长长长长长长的表注。},
remark{注意} = {一些常规说明,一些常规说明,一些常规说明。},
remark{来源} = {自力更生,自力更生,自力更生。},
expand=\longtblrbody,
]{%
colspec = {XXX}, width = 0.85\linewidth,
rowhead = 1,
rowfoot = 1,
hline{1,Z} = {0.08em, solid},
hline{2} = {0.05em, solid},
hline{Y} = {0.05em, solid},
}
\longtblrbody
\end{longtblr} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I want a bilingual caption in longtblr with Chinese and English.
How can I create a template for it?
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions