0

I'm trying to use the Elsevier template from https://www.ctan.org/tex-archive/macros/latex/contrib/els-cas-templates, but I meet a problem when I try to change the font to Arial, I searched on the TEX and find a resolution, which is to use:

\usepackage{helvet} % Arial
\renewcommand{\familydefault}{\sfdefault}

It works for nearly all contents except the section, or specifically CRediT authorship contribution statement and Introduction in the below minimal example. May I know is there any way to change the font of them? Btw, how can I check the font in math mode, I don't know whether the equation has the right font or not, and if not, how can I change it? All the solutions I find do not work on PdfLaTeX, thanks for all and hoping everyone has a nice day!

% -------------------------------- Class -------------------------------- %

\documentclass[a4paper,fleqn]{cas-dc}

% If the frontmatter runs over more than one page
% use the longmktitle option.

% \documentclass[a4paper,fleqn,longmktitle]{cas-dc}

% -------------------------------- And -------------------------------- %

\usepackage{xparse}
\ExplSyntaxOn
\RenewDocumentCommand \stmauthors { } 
{
    \group_begin:
    \stmAuthorSetup { type = authors }
    \l_stm_au_setup_tl
    \par \vskip\l_stm_augroup_before_dim
    \l_stm_augroup_align_tl
    \l_stm_augroup_size_tl
    \l_stm_augroup_shape_tl
    \l_stm_augroup_weight_tl
    \color{ \l_stm_augroup_color_tl }
    \bool_if:NTF \g_stm_augr_bool
    { \seq_use:Nn \g_stm_augr_seq { \par } }
    {
        \seq_use:cnnn { g_stm_au\int_use:N\g_stm_augr_int _seq }
        { ,~ } { ,~ } { ,~ }
    }
    \par\vskip\l_stm_augroup_after_dim
    \group_end:
}   
\ExplSyntaxOff

% -------------------------------- Packages -------------------------------- %

% \usepackage[numbers]{natbib}
\usepackage[authoryear]{natbib}
% \usepackage[authoryear,longnamesfirst]{natbib}
\usepackage{amssymb} % Add
\usepackage{bbding} % Add
\usepackage{color} % Add
\usepackage{caption,setspace} % Add
\usepackage[nameinlink]{cleveref} % Add
\usepackage[export]{adjustbox}
\usepackage{array}
\usepackage{tabularx}
\usepackage{booktabs}
\usepackage{graphicx}
\usepackage{cellspace}
\usepackage{longtable}

% \usepackage{times} % Times

\usepackage{helvet} % Arial
\renewcommand{\familydefault}{\sfdefault}

\def\tabularxcolumn#1{m{#1}}

%%%Author macros
\def\tsc#1{\csdef{#1}{\textsc{\lowercase{#1}}\xspace}}
\tsc{WGM}
\tsc{QE}
%%%

\begin{document}
\captionsetup[figure]{labelfont={bf},name={Fig.},labelsep=period} % Add

\Crefname{figure}{Fig.}{Figs.} % For Fig.
\Crefname{equation}{Eq.}{Eqs.}

\let\WriteBookmarks\relax
\def\floatpagepagefraction{1}
\def\textpagefraction{.001}

\shorttitle{Short Title}
\shortauthors{A et al}
\title [mode = title]{Title}

% -------------------------------- Authors -------------------------------- %

\author[a]{Author}
\credit{Conceptualization} % Credit authorship

% -------------------------------- Abstract -------------------------------- %

\begin{abstract}
B
\end{abstract}

% -------------------------------- Introduction -------------------------------- %
\maketitle

\section{Introduction}\label{1}

This is an introduction.

\begin{table*}[htbp]
    \caption{Text.}
    \begin{tabularx}{\textwidth}{ l Sl X }
    \toprule
        Iterations & Samples & Comments \\
    \midrule
        0     & \includegraphics[width=.15\textwidth, height=20mm, valign=M]{example-image} & Text is always being here\\
        32    & \includegraphics[width=.15\textwidth, height=20mm, valign=M]{example-image} & Text \\ 
        64    & \includegraphics[width=.15\textwidth, height=20mm, valign=M]{example-image} & Text \\
        128   & \includegraphics[width=.15\textwidth, height=20mm, valign=M]{example-image} & Text \\
        192   & \includegraphics[width=.15\textwidth, height=20mm, valign=M]{example-image} & Text \\
        \multicolumn{1}{c}{\vdots} & \multicolumn{1}{c}{\vdots} & \multicolumn{1}{c}{\vdots} \\
        3200  & \includegraphics[width=.15\textwidth, height=20mm, valign=M]{example-image} & Text \\
    \bottomrule
    \end{tabularx}
\end{table*}

\begin{figure*}
    \centering
      \includegraphics[width=\textwidth]{example-image}
    \caption{This is a caption.}
\end{figure*}

\begin{equation}
Equation=\left\|\mu_{r}-\mu_{s}\right\|^{2}+T_{r}\left(\mathrm{C}_{r}+\mathrm{C}_{s}-2\left(\mathrm{C}_{r} \mathrm{C}_{s}\right)^{\frac{1}{2}}\right),
\end{equation}

\printcredits

\end{document}

To use the minimum example, download the example and use the codes the replace cas-dc-template.tex.

1
  • Oh seems the math mode also has the wrong font...
    – Tim
    Jan 14 at 15:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.