Elsevier 的 cas 系列模板使用 longtable 后如何恢复模板给定的 caption 和字体样式

发布于 2021-07-04 11:04:56

原始模板下载链接

在 Elsevier 的 cas 系列模板使用 longtable 得到的 caption 样式和表内字体样式与模板提供的使用样例不一致,请问应如何正确在该模板内使用长表格才能沿用原有样式。MWE 如下。

\documentclass[a4paper,fleqn]{cas-sc}
\usepackage[authoryear,longnamesfirst]{natbib}
\usepackage{longtable}
\begin{document}

% 模板提供的使用样例
\begin{table}[width=.9\linewidth,cols=4,pos=h]
\caption{caption style is true}
\begin{tabular*}{\tblwidth}{@{} LLLL@{} }
\toprule
Col 1 & Col 2 & Col 3 & Col4\\
\midrule
font & style & is & true \\
font & style & is & true \\
12345 & 12345 & 123 & 12345 \\
12345 & 12345 & 123 & 12345 \\
12345 & 12345 & 123 & 12345 \\
\bottomrule
\end{tabular*}
\end{table}

% 长表格使用样例
\begin{longtable}{L}
\caption{caption style is false}\\
\toprule
this is a long long table \\
\midrule
font style is false too \\
font style is false too \\
this is a long long table \\
this is a long long table \\
this is a long long table \\
\bottomrule
\end{longtable}
\end{document}

image.png

查看更多

关注者
0
被浏览
1.6k
1 个回答
啸行
啸行 2021-07-04
这家伙很懒,什么也没写!

查了一下,在 cas-comman.sty 中,有这样的代码

\cs_new:Npn \__make_tbl_caption:nn #1#2
{
  \l_tbl_align_tl
  \skip_vertical:N \l_tbl_abovecap_skip 
  {\parbox{ \dimexpr(\l_tbl_width_dim)}
    {\rightskip=0pt\sffamily\small\textbf{\color{scolor}#1}\par#2\par\vskip4pt }}
  \skip_vertical:N \l_tbl_belowcap_skip
}

这大约就是对表格 caption 的设置。你如果有这样的需求,可以用 caption 包把 longtable 的 caption 样式改成类似的

撰写答案

请登录后再发布答案,点击登录

发布
问题

分享
好友

手机
浏览

扫码手机浏览