![长文本字幕](https://linux22.com/image/442862/%E9%95%BF%E6%96%87%E6%9C%AC%E5%AD%97%E5%B9%95.png)
我喜欢在第一页和另一页上用长表格显示不同的标题文本。如果可能的话,插入旨在longtblr
显示 LoT 的文本。如何实现?longtblr
entry={short caption text>}
例如,在下面的 MWE 中,我喜欢在第二个标题中添加文本简短版标题(续):
\documentclass{article}
\usepackage{newtxtext}
\usepackage{microtype}
\usepackage{tabularray}
\usepackage{lipsum}
\begin{document}
\listoftables
\begin{longtblr}[
caption = {Longtable captions which span three lines and not appear in LoT. How to prevent that this text will not be shown on the next pages of this table but rather some shorter text, preferable content of \texttt{entry} option?},
entry = {Short version of the caption},
label = {longtable},
]{rowhead=1,
hlines, vlines,
colspec = {X[0.2,j] X[0.3,j] X[0.53,j]},
colsep=4pt,
row{1} = {font=\small\bfseries},
}
% column headers
Left column & Midle column & Long Column \\
% table body
\lipsum[66]
& \lipsum[11]
& \lipsum[1] \\
\lipsum[66]
& \lipsum[11]
& \lipsum[1] \\
\end{longtblr}
\end{document}
答案1
entry
定义一个使用延续标题中的参数的模板( capcont
)和一个主题来指定其用途。
\documentclass{article}
\usepackage{newtxtext}
\usepackage{microtype}
\usepackage{tabularray}
\usepackage{lipsum}
\begin{document}
\listoftables
\DefTblrTemplate {caption-text}{short}{\InsertTblrText{entry}}
\DefTblrTemplate{capcont}{short}{%
\par\centering
\UseTblrTemplate {caption-tag}{default}%
\UseTblrTemplate {caption-sep}{default}%
\UseTblrTemplate {caption-text}{short}
\UseTblrTemplate {conthead-text}{default}
\par
}
\NewTblrTheme{shortcaption}{%
\SetTblrTemplate{capcont}{short}%
}
\begin{longtblr}[theme = shortcaption,
caption = {Longtable captions which span two lines and not appear in LoT. How to prevent that not be shown on the next pages of this table?},
entry = {Short version of the caption},
label = {longtable},
]{rowhead=1,
hlines, vlines,
colspec = {X[0.2,j] X[0.3,j] X[0.53,j]},
colsep=4pt,
row{1} = {font=\small\bfseries},
}
% column headers
Left column & Midle column & Long Column \\
% table body
\lipsum[66]
& \lipsum[11]
& \lipsum[1] \\
\lipsum[66]
& \lipsum[11]
& \lipsum[1] \\
\end{longtblr}
\end{document}