Elsevier 课程提供两种语言的两篇摘要

Elsevier 课程提供两种语言的两篇摘要

我在爱思唯尔课堂上的文章标题下放置两个摘要时遇到了问题。

我正在使用这个代码:

\documentclass[preprint,10pt,3p]{elsarticle}


%% \documentclass[preprint,review,12pt]{elsarticle}

%% Use the options 1p,twocolumn; 3p; 3p,twocolumn; 5p; or 5p,twocolumn
%% for a journal layout:
%% \documentclass[final,1p,times]{elsarticle}
%% \documentclass[final,1p,times,twocolumn]{elsarticle}
%% \documentclass[final,3p,times]{elsarticle}
%% \documentclass[final,3p,times,twocolumn]{elsarticle}
%% \documentclass[final,5p,times]{elsarticle}
%% \documentclass[final,5p,times,twocolumn]{elsarticle}

\usepackage[english,french]{babel}

\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{amsfonts}
\usepackage{textcomp}
%% The amsthm package provides extended theorem environments

%% \biboptions{comma,round}

% \biboptions{}
\newtheorem{theorem}{Theorem}[section]

\newtheorem{solution}[theorem]{Solution}
\newtheorem{summary}[theorem]{Summary}
\newenvironment{proof}[1][Proof]{\textbf{#1.} }{\ \rule{0.5em}{0.5em}}
\makeatletter
\if@titlepage
  \renewenvironment{abstract}{
      \null\vfil
      \@beginparpenalty\@lowpenalty
      \begin{center}
        \bfseries \abstractname
        \@endparpenalty\@M
      \end{center}}
     {\par\vfil\null}
\else
  \renewenvironment{abstract}{
      \if@twocolumn
        \section*{\abstractname}
      \else
        \small
        \begin{center}
          {\bfseries \abstractname\vspace{-.5em}\vspace{\z@}}
        \end{center}
        \quotation
      \fi}
      {\if@twocolumn\else\endquotation\fi}
\fi
\makeatother

\journal{}

\begin{document}

\begin{frontmatter}

\title{Title of my paper \tnoteref{label1}}
\tnotetext[label1]{}
\author{name and surname}
\address{univeristy address}
\ead{[email protected]}
\selectlanguage{english}
\begin{abstract}
  abstract in english 
\end{abstract}
\selectlanguage{french}
\begin{abstract}
 abstract in french
\end{abstract}
\selectlanguage{english}
\textbf{Primary Class : }00
\textbf{Secondary Class} : 000
\begin{keyword}
%% keywords here, in the form: keyword \sep keyword
keyword1, keyword2
%% MSC codes here, in the form: \MSC code \sep code
%% or \MSC[2008] code \sep code (2000 is the default)
\end{keyword}

\end{frontmatter}

%%
%% Start line numbering here if you want
%%
% \linenumbers

%% main text
\section{Introduction }
\end{document}

如何将摘要放在第一页的标题和作者姓名下方?

答案1

这是环境的定义abstracts,其中还重新定义了abstract。这实际上并不是太具侵入性:如果编辑最终告诉您主语言中只需要一个摘要,只需删除添加的代码(带有环境的定义)和您不想要的摘要。

\documentclass[preprint,10pt,3p]{elsarticle}

%% \documentclass[preprint,review,12pt]{elsarticle}

%% Use the options 1p,twocolumn; 3p; 3p,twocolumn; 5p; or 5p,twocolumn
%% for a journal layout:
%% \documentclass[final,1p,times]{elsarticle}
%% \documentclass[final,1p,times,twocolumn]{elsarticle}
%% \documentclass[final,3p,times]{elsarticle}
%% \documentclass[final,3p,times,twocolumn]{elsarticle}
%% \documentclass[final,5p,times]{elsarticle}
%% \documentclass[final,5p,times,twocolumn]{elsarticle}

\usepackage[T1]{fontenc}
\usepackage[french,english]{babel}

\journal{}

\newenvironment{abstracts}
 {\global\setbox\absbox=\vbox\bgroup
    \hsize=\textwidth
    \linespread{1}\selectfont}
 {\vspace{-\bigskipamount}\egroup}
\renewenvironment{abstract}[1][]
 {\if\relax\detokenize{#1}\relax\else\selectlanguage{#1}\fi
  \noindent\textbf{\abstractname}\par\medskip\noindent\ignorespaces}
 {\par\bigskip}

\begin{document}

\begin{frontmatter}

\title{Title of my paper \tnoteref{label1}}
\tnotetext[label1]{A note to the title}

\author{name and surname}
\address{university address}
\ead{[email protected]}

\begin{abstracts}
\begin{abstract}
  Abstract in English 
\end{abstract}
\begin{abstract}[french]
  Resum\'e en fran\c{c}ais
\end{abstract}
\end{abstracts}

\begin{keyword}
%% keywords here, in the form: keyword \sep keyword
keyword1, keyword2
%% MSC codes here, in the form: \MSC code \sep code
%% or \MSC[2008] code \sep code (2000 is the default)
\end{keyword}

\end{frontmatter}

%%
%% Start line numbering here if you want
%%
% \linenumbers

%% main text
\section{Introduction}
\end{document}

在我看来,这应该被视为对 的一个补充elsarticle

在此处输入图片描述

答案2

这里有一个替代方案,可能比@egreg的优秀答案更具侵入性。这会修改环境abstract以构建现有的环境\absbox,从而消除对额外环境的需求abstracts。此外,如果只需要一个抽象,则只需删除不需要的\begin{abstract}... (可以保留\end{abstract}对环境的修改)。abstract

编辑:根据评论中@egreg 的建议,盒子构建被简化为一行。

\documentclass[preprint,10pt,3p]{elsarticle}

\usepackage[T1]{fontenc}
\usepackage[french,english]{babel}

\journal{}

%%Addition...patch the abstract environment to allow multiple calls to build onto the existing \absbox
\usepackage{etoolbox}
\newbox\inabsbox
\makeatletter
    \patchcmd{\abstract}{\absbox}{\inabsbox}{}{\@latex@error{Failed to patch abstract}}%save contents to inabsbox
    \patchcmd{\abstract}{\hsize}{\ifdim\wd\absbox>0pt\bigskip\fi\hsize}{}{\@latex@error{Failed to patch \string\abstract for pre-spacing}}%add spacing before this abstract if this is not the first
    \patchcmd{\abstract}{Abstract}{\abstractname}{}{\@latex@error{Failed to patch \string\abstract for \string\abstractname}}
    \apptocmd{\endabstract}{%
        \global\setbox\absbox=\vbox{\unvbox\absbox\unvbox\inabsbox}%combine boxes
        }{}{\@latex@error{Failed to patch \string\endabstract}}
\makeatother


\begin{document}

\begin{frontmatter}
\title{Title of my paper \tnoteref{label1}}
\tnotetext[label1]{A note to the title}

\author{name and surname}
\address{university address}
\ead{[email protected]}

\begin{abstract}
  Abstract in English 
\end{abstract}
%
\selectlanguage{french}
\begin{abstract}
  R\'esum\'e en fran\c{c}ais
\end{abstract}
\selectlanguage{english}

\begin{keyword}
keyword1, keyword2
\end{keyword}
\end{frontmatter}

\section{Introduction}
\end{document}

结果

相关内容