latex elsivier cas-dc模板的fig.1: 如何改为fig.1.?
已知\captionsetup[figure]{font=small,labelfont=bf,labelsep=period}%
和
\renewcommand{\figurename}{Fig.} 均不行
- cas-dc 模板不是 fig.1:,而是 Figure 1:;
- 模板重定义了
\@makecaption;Either the document class you use is unknown to the caption package, or you have included a package in your document which redefines \@makecaption (which is responsible for typesetting the caption internally) as well. This means the caption package will either change the design of captions in an unwanted way, or it even refuses to work correctly at all.
- 重定义 __make_fig_caption:nn 就好了;
\
documentclass[a4paper,fleqn]{cas-dc}
\usepackage{natbib}
\ExplSyntaxOn
\cs_set:Npn \__make_fig_caption:nn #1#2
{
\l_fig_align_tl
\skip_vertical:N \l_fig_abovecap_skip
% \bool_if:NTF \g_fig_full_bool
% { \skip_horizontal:n { -\FullWidth } } { }
\setbox\cascaptionbox=\hbox{%
\sffamily\small\textbf{\color{scolor}#1:}~#2}
\ifdim\the\wd\cascaptionbox<\dim_use:N \l_fig_width_dim\relax
\parbox{ \l_fig_width_dim }
{\unskip\ignorespaces\hfil\sffamily\small
\textbf{\color{scolor}#1.}~#2\hfil\par }
\else
\parbox{ \l_fig_width_dim }
{\rightskip=0pt\unskip\ignorespaces\sffamily
\small\textbf{\color{scolor}#1.}~#2\par }
\fi
\skip_vertical:N \l_fig_belowcap_skip
}
\ExplSyntaxOff
\begin{document}
\begin{figure}
\caption{}
\end{figure}
\end{document}
作者:总一副不开心样子
链接:https://www.zhihu.com/question/562874827/answer/2735237122
来源:知乎
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
!注意:如果用overleaf的话需要加个包\usepackage{expl3}