2

I am preparing a manuscript using Elsevier cas-dc double column class and facing difficulty to change the label separator for figures. The default is a colon so that a figure label is formatted as Fig. 1: However, I would like to change this to Fig. 1. instead. I have tried using

\usepackage[font=small,labelfont=bf,labelsep=period]{caption}

without success. The figure label is still Fig. 1: With so many fixes to apply to this cas-dc, I am quite frustrated. In the following, I am giving the MWE that I am using and would appreciate any help on this.

\documentclass[a4paper,fleqn]{cas-dc}
\usepackage[numbers]{natbib}
\usepackage[none]{hyphenat}
\usepackage[caption=false, font=footnotesize]{subfig}
\usepackage{multirow}

% Without the following, cas-dc does not center captions
\makeatletter
\def\redefparbox{\def\@parboxrestore{\@arrayparboxrestore\let\\\@normalcr
  \if@minipage\expandafter\@gobbletwo\fi
  \@firstofone{\centering\casscparboxtest}}}
\def\casscparboxtest#1{%
  \ifx\rightskip#1\relax\expandafter\dimen@\else
    \expandafter\@secondoftwo
  \fi\@gobble{#1}}
\makeatother

\usepackage[font=small,labelfont=bf,labelsep=period]{caption}
\captionsetup{labelsep=period}

% Rename figure label to Fig. instead of Figure:
\makeatletter
\renewcommand{\fnum@figure}{Fig. \thefigure}
\makeatother

% Remove ORCID footnote
\let\printorcid\relax 

% Fix cas-dc textwidth so that captions for two-column floats are placed correctly
\AtBeginDocument{\setlength{\FullWidth}{\textwidth}}
\begin{document}
\begin{figure}[align=\redefparbox]
    \centering
        \includegraphics[scale=0.95]{Figure1.pdf}

    \caption{Caption for figure.}
    \label{Figlabel}
\end{figure}
\end{document}

1 Answer 1

4

els-cas has the : hardcoded in the definition of \__make_fig_caption:nn (you can change that if you want). A sneakier way is:

% Rename figure label to Fig <num>. instead of Figure <num>:
\makeatletter
\renewcommand{\fnum@figure}{Fig. \thefigure.\@gobble}
\makeatother

The definition of \fnum@figure writes Fig. <num>. and then ends with \@gobble, which consumes the next token, which is, in this case, the :.

1
  • 1
    This really helped.
    – Adnan Ali
    Commented May 2, 2021 at 19:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .