latex elsivier cas-dc模板的fig.1: 如何改为fig.1.?

latex elsivier cas-dc模板的fig.1: 如何改为fig.1.?

已知\captionsetup[figure]{font=small,labelfont=bf,labelsep=period}%

\renewcommand{\figurename}{Fig.} 均不行

  1. cas-dc 模板不是 fig.1:,而是 Figure 1:;
  2. 模板重定义了
\@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. 
  1. 重定义 __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}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值