[Tex/LaTex] Change headings to another language when using elsarticle

babelelsarticle

After downloading the article template of Elsevier (elsarticle) and using it, I discovered that babel is not working.

\documentclass[preprint,a4paper,12pt]{elsarticle}
    \usepackage[dutch]{babel}
    \usepackage[utf8]{inputenc}
    \journal{test}
    \begin{document}
    \begin{frontmatter}
    \title{ Complicated }

    \begin{abstract}
    \end{abstract}
    \begin{keyword}
    \end{keyword}

    \end{frontmatter}


    \end{document}

Q: is there a quick way to change the words “keyword”, “abstract” and “preprint submitted to” in to another language(e.g.,dutch/french)?

Best Answer

Copy the relevant parts of the class file into your preamble and edit as necessary. Note that you need \makeatletter to enable the use of the @ character.

\documentclass{elsarticle}

\makeatletter

\renewenvironment{abstract}{\global\setbox\absbox=\vbox\bgroup
  \hsize=\textwidth\def\baselinestretch{1}%
  \noindent\unskip\textbf{Whatever}  % <--- Edit as necessary
 \par\medskip\noindent\unskip\ignorespaces}
 {\egroup}

\def\keyword{%
  \def\sep{\unskip, }%
 \def\MSC{\@ifnextchar[{\@MSC}{\@MSC[2000]}}
  \def\@MSC[##1]{\par\leavevmode\hbox {\it ##1~MSC:\space}}%
  \def\PACS{\par\leavevmode\hbox {\it PACS:\space}}%
  \def\JEL{\par\leavevmode\hbox {\it JEL:\space}}%
  \global\setbox\keybox=\vbox\bgroup\hsize=\textwidth
  \normalsize\normalfont\def\baselinestretch{1}
  \parskip\z@
  \noindent\textit{Some important words: }  % <--- Edit as necessary
  \raggedright                         % Keywords are not justified.
  \ignorespaces}

\def\ps@pprintTitle{%
     \let\@oddhead\@empty
     \let\@evenhead\@empty
     \def\@oddfoot{\footnotesize\itshape
       Whatever \ifx\@journal\@empty Elsevier  % <--- Edit as necessary
       \else\@journal\fi\hfill\today}%
     \let\@evenfoot\@oddfoot}

\makeatother

\begin{document}
\begin{abstract}
This is the abstract.
\end{abstract}
\begin{keyword}
Hacking
\end{keyword}
\maketitle
\end{document}
Related Question