![PdfLaTex:使用 Elsevier 模板时出现作者列表问题](https://linux22.com/image/444467/PdfLaTex%EF%BC%9A%E4%BD%BF%E7%94%A8%20Elsevier%20%E6%A8%A1%E6%9D%BF%E6%97%B6%E5%87%BA%E7%8E%B0%E4%BD%9C%E8%80%85%E5%88%97%E8%A1%A8%E9%97%AE%E9%A2%98.png)
我正在尝试使用来自https://www.ctan.org/tex-archive/macros/latex/contrib/els-cas-templates,但当我尝试包含两个以上的作者时,我遇到了一个问题,结果变成了作者 1、作者 2 和作者 3,但我希望如此作者 1、作者 2、作者 3那么,有什么办法可以实现吗?提前谢谢大家了。
最小示例如下所示:
\documentclass[a4paper,fleqn]{cas-dc}
% If the frontmatter runs over more than one page
% use the longmktitle option.
%\documentclass[a4paper,fleqn,longmktitle]{cas-dc}
% \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}
\def\tabularxcolumn#1{m{#1}}
%%%Author macros
\def\tsc#1{\csdef{#1}{\textsc{\lowercase{#1}}\xspace}}
\tsc{WGM}
\tsc{QE}
%%%
% Uncomment and use as if needed
%\newtheorem{theorem}{Theorem}
%\newtheorem{lemma}[theorem]{Lemma}
%\newdefinition{rmk}{Remark}
%\newproof{pf}{Proof}
%\newproof{pot}{Proof of Theorem \ref{thm}}
\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}
% Short title
\shorttitle{A}
% Short author
\shortauthors{A et al}
% Main title of the paper
\title [mode = title]{A}
% Title footnote mark
% eg: \tnotemark[1]
% \tnotemark[1]
% Title footnote 1.
% eg: \tnotetext[1]{Title footnote text}
% \tnotetext[1]{Test}
% -------------------------------- Authors -------------------------------- %
\author[a]{AAA}[style=Chinese]
% Corresponding author indication
% \cormark[<corr mark no>]
% Footnote of the first author
% \fnmark[<footnote mark no>]
% URL of the first author
% \ead[url]{<URL>}
% Address/affiliation
\affiliation[a]{organization={A},
% city={},
% citysep={}, % Uncomment if no comma needed between city and postcode
postcode={A},
% state={},
country={A}}
\author[a]{BBB}[style=Chinese]
% Footnote of the second author
\fnmark[*]
% URL of the first author
% \ead[url]{<URL>}
% Corresponding author text
\cortext[1]{Corresponding author}
% Footnote text
% \fntext[1]{}
% For a title note without a number/mark
% \nonumnote{}
\author[b]{CCC}
% Footnote of the third author
% \fnmark[*]
% Address/affiliation
\affiliation[b]{organization={A},
addressline={A},
% city={},
% citysep={}, % Uncomment if no comma needed between city and postcode
postcode={A},
% state={},
country={A}}
% -------------------------------- Abstract -------------------------------- %
\begin{abstract}
A
\end{abstract}
% -------------------------------- Introduction -------------------------------- %
\maketitle
\section{Introduction}\label{1}
A
% -------------------------------- Bibliography -------------------------------- %
%% Loading bibliography style file
%\bibliographystyle{model1-num-names}
\bibliographystyle{cas-model2-names}
% Loading bibliography database
\bibliography{refs}
% -------------------------------- End -------------------------------- %
\end{document}
使用上面的代码替换cas-dc-template.tex
,然后编译应该不会出现错误。
答案1
在您的示例中添加了一些代码。
\documentclass[a4paper,fleqn]{cas-dc}
%%********************************** added <<<<<<<<<<<<<<<<
\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
%%**********************************
% If the frontmatter runs over more than one page
% use the longmktitle option.
%\documentclass[a4paper,fleqn,longmktitle]{cas-dc}
% \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}
%\newcommand\theead { \int_use:N \g_ead_int }
\def\tabularxcolumn#1{m{#1}}
%%%Author macros
\def\tsc#1{\csdef{#1}{\textsc{\lowercase{#1}}\xspace}}
\tsc{WGM}
\tsc{QE}
%%%
% Uncomment and use as if needed
%\newtheorem{theorem}{Theorem}
%\newtheorem{lemma}[theorem]{Lemma}
%\newdefinition{rmk}{Remark}
%\newproof{pf}{Proof}
%\newproof{pot}{Proof of Theorem \ref{thm}}
\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}
% Short title
\shorttitle{ Short title}
% Short author
\shortauthors{A et al}
% Main title of the paper
\title [mode = title]{ Main title of the paper}
% Title footnote mark
% eg: \tnotemark[1]
% \tnotemark[1]
% Title footnote 1.
% eg: \tnotetext[1]{Title footnote text}
% \tnotetext[1]{Test}
% -------------------------------- Authors -------------------------------- %
\author[a]{ Author1}[style=Chinese]
% Corresponding author indication
% \cormark[<corr mark no>]
% Footnote of the first author
% \fnmark[<footnote mark no>]
% URL of the first author
% \ead[url]{<URL>}
% Address/affiliation
\affiliation[a]{organization={AAA},
% city={},
% citysep={}, % Uncomment if no comma needed between city and postcode
postcode={A1},
% state={},
country={A2}}
\author[a]{ Author2}[style=Chinese]
% Footnote of the second author
\fnmark[*]
% URL of the first author
% \ead[url]{<URL>}
% Corresponding author text
\cortext[1]{Corresponding author}
% Footnote text
% \fntext[1]{}
% For a title note without a number/mark
% \nonumnote{}
\author[b]{ Author3}
% Footnote of the third author
% \fnmark[*]
% Address/affiliation
\affiliation[b]{organization={BBB},
addressline={B1},
% city={},
% citysep={}, % Uncomment if no comma needed between city and postcode
postcode={B2},
% state={},
country={B3}}
% -------------------------------- Abstract -------------------------------- %
\begin{abstract}
Abstract
\end{abstract}
% -------------------------------- Introduction -------------------------------- %
\maketitle
\section{Introduction}\label{1}
Introduction
% -------------------------------- Bibliography -------------------------------- %
%% Loading bibliography style file
% %\bibliographystyle{model1-num-names}
% \bibliographystyle{cas-model2-names}
%
% % Loading bibliography database
% \bibliography{refs}
%
% -------------------------------- End -------------------------------- %
\end{document}