如何在 elsarticle 的 frontmatter 中添加普通文本

如何在 elsarticle 的 frontmatter 中添加普通文本

我正在为我的论文使用 elsarticle 文档类。标题页上要求在标题和作者下方填写图片、表格等的数量。我如何在前言区域写额外的文字?例如:

“页数:;图表数:;表格数:摘要字数:;引言:;讨论:正文总字数:利益冲突:”

\documentclass[preprint, authoryear]{elsarticle}

\bibliographystyle{annesstyle}

\begin{document}

\begin{frontmatter}

\title{title}
\author[firstaddress]{Aaddress}
\author[secondaddress]{address}
\author[thirdaddress]{Haddress}
\author[thirdaddress]{address}
\author[thirdaddress]{address}
\author[thirdaddress,firstaddress]{address}

\address{Address for correspondance:}

\address[firstaddress]{address}
\address[secondaddress]{address}

\begin{abstract}abstract\end{abstract}

\begin{keyword}keywords\end{keyword}

\end{frontmatter}

\section{References}
\bibliography{mybib}
\end{document}

答案1

如果您使用该preprint样式,这里有一个补丁:

\documentclass[preprint, authoryear]{elsarticle}

\usepackage{etoolbox}
% patch `\maketitle` to accommodate the new information, printed after the keywords
\patchcmd{\pprintMaketitle}
  {\fi\hrule}% the second rule
  {\fi\ifvoid\extrainfobox\else\unvbox\extrainfobox\par\vskip10pt\fi\hrule}
  {}{}

% an environment for the new information
\newenvironment{extrainfo}
  {\global\setbox\extrainfobox=\vbox\bgroup\parindent=0pt }
  {\egroup}
\newsavebox\extrainfobox

\bibliographystyle{annesstyle}

\begin{document}

\begin{frontmatter}

\title{title}
\author[firstaddress]{Aaddress}
\author[secondaddress]{address}
\author[thirdaddress]{Haddress}
\author[thirdaddress]{address}
\author[thirdaddress]{address}
\author[thirdaddress,firstaddress]{address}

\address{Address for correspondance:}

\address[firstaddress]{address}
\address[secondaddress]{address}

\begin{abstract}abstract\end{abstract}

\begin{keyword}keywords\end{keyword}

\begin{extrainfo}
Number of pages: ;\\
Number of figures: ;\\
Number of tables: ;\\
Number of words in the abstract: ;\\
Introduction: ;\\
discussion: ;\\
Total number of words in the text: ;\\
Conflict of interest:
\end{extrainfo}

\end{frontmatter}

\section{References}
\bibliography{mybib}
\end{document}

在此处输入图片描述

以下是在摘要前添加额外信息的方法:

\documentclass[preprint, authoryear]{elsarticle}

\usepackage{etoolbox}
\patchcmd{\pprintMaketitle}
  {\hrule\vskip12pt}% the second rule
  {\hrule\vskip12pt\ifvoid\extrainfobox\else\unvbox\extrainfobox\par\vskip12pt\fi}
  {}{}

\newenvironment{extrainfo}
  {\global\setbox\extrainfobox=\vbox\bgroup\parindent=0pt }
  {\egroup}
\newsavebox\extrainfobox

\bibliographystyle{annesstyle}

\begin{document}

\begin{frontmatter}

\title{title}
\author[firstaddress]{Aaddress}
\author[secondaddress]{address}
\author[thirdaddress]{Haddress}
\author[thirdaddress]{address}
\author[thirdaddress]{address}
\author[thirdaddress,firstaddress]{address}

\address{Address for correspondance:}

\address[firstaddress]{address}
\address[secondaddress]{address}

\begin{abstract}abstract\end{abstract}

\begin{keyword}keywords\end{keyword}

\begin{extrainfo}
Number of pages: ;\\
Number of figures: ;\\
Number of tables: ;\\
Number of words in the abstract: ;\\
Introduction: ;\\
discussion: ;\\
Total number of words in the text: ;\\
Conflict of interest:
\end{extrainfo}

\end{frontmatter}

\section{References}
\bibliography{mybib}
\end{document}

在此处输入图片描述

的第二个参数中的文本\patchcmd是我们想要用\pprintMaketitle第三个参数中的代码替换的定义中的代码。这比复制整个定义并进行修改要简单得多。

相关内容