3

I found a weird bug in the Elsevier (Automatica) template when I'm building it with pdflatex. If one of the authors has an accent (ó, or something). The building of the document yields an error. If the accent is removed, error is gone, and all is good. The problem is not occurring in the 2020 version, the 2022 and 2023 version both have this error...

pdfTeX Version 3.141592653-2.6-1.40.25 (TeX Live 2023) (preloaded format=pdflatex 2023.6.15) 16 JUN 2023 09:24

template source: http://www.elsevier.com/__data/promis_misc/automatica_latex.zip

M(W)E:

\documentclass[twocolumn]{elsart}

\usepackage{tikz}
\usepackage{color,cite}
\usepackage{url}
\usepackage{graphicx}
\usepackage{amssymb,amsmath,amsfonts,accents}

\begin{document}

\begin{frontmatter}

\title{Some title
\thanksref{footnoteinfo}}

\thanks[footnoteinfo]{This paper was not presented at any meeting.}

\author[bla]{someone}
\ead{[email protected]},\,
\author[bla]{someone}
\ead{[email protected]},\,
\author[bla,blo]{Some\'one}\ead{[email protected]} % remove the accent to get it working...

\address[bla]{Bla uni, blacity}
\address[blo]{Blo uni, blocity}

\begin{keyword}
Science
\end{keyword}

\begin{abstract}
In this paper, 
\end{abstract}

\end{frontmatter}

\section{bla}
Lorem Ipsum

\end{document}

2
  • 1
    Wehenever you are using accented letters or non-ascii letters with pdflatex, use \usepackage[T1]{fontenc} or similar, otherwise TeX tries to combine them. The problem here is probably that the class tries to collect the authors in a way that is not good with modern LaTeX kernels. It is not a bug. Note for example that the cls you point to haven't been updated in 20 years!
    – daleif
    Commented Jun 16, 2023 at 7:49
  • Thanks you this quick fix!
    – seaver
    Commented Jun 16, 2023 at 16:11

1 Answer 1

4

The class does nasty things. But you can fix the wrongdoings.

It's curious that the macro that causes the main damages is called \no@harm

The class uses \edef and \xdef where it shouldn't, and it should prefer \protected@edef and \protected@xdef.

\documentclass[twocolumn]{elsart}

\usepackage{tikz}
\usepackage{color,cite}
\usepackage{url}
\usepackage{graphicx}
\usepackage{amssymb,amsmath,amsfonts,accents}

\usepackage{xpatch}
\makeatletter % fix the wrong code in elsart.cls
\xpatchcmd{\runningauthor@fmt}{\global\edef}{\protected@xdef}{}{}
\xpatchcmd{\runningauthor@fmt}{\global\edef}{\protected@xdef}{}{}
\xpatchcmd{\author@fmt}{\edef}{\protected@edef}{}{}
\def\@xnamedef#1{\expandafter\protected@xdef\csname #1\endcsname}
\def\ead@au#1{\protected@edef\@ead@au{#1}}
\def\add@xtok#1#2{\begingroup
  \protected@xdef\@act{\global\noexpand#1{\the#1#2}}\@act
\endgroup}
\def\no@harm{}
\makeatother

\begin{document}

\begin{frontmatter}

\title{Some title
\thanksref{footnoteinfo}}

\thanks[footnoteinfo]{This paper was not presented at any meeting.}

\author[bla]{someone}
\ead{[email protected]},
\author[bla]{someone}
\ead{[email protected]},
\author[bla,blo]{Sóme\'one}\ead{[email protected]} % remove the accent to get it working...
\address[bla]{Bla uni, blacity}
\address[blo]{Blo uni, blocity}

\begin{keyword}
Science
\end{keyword}

\begin{abstract}
In this paper, 
\end{abstract}

\end{frontmatter}

\section{bla}
Lorem Ipsum

\end{document}

Note that you can use either ó or \'o, with no problem.

enter image description here

1
  • Amazing fix! Thank you! If you don't mind I will forward this post to the editor, maybe the template can be modified based on your repairs.
    – seaver
    Commented Jun 16, 2023 at 16:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .