[Tex/LaTex] elsevier class error

elsarticlelyx

I've been trying LateX and Lyx out for a few days. Lyx is really a help for a new-comer and I had few troubles so far, except for some unknown errors when I was configuring elsarticle documentclass.

I have installed Lyx, MacTex 2012, and already put the elsarticle bundle into /usr/local/texlive/2012/texmf-local and reconfigured Lyx. Then I tried selecting elsarticle in Lyx and the exported TeX code in Texmaker. They both gave error information.

Here is a picture of the error info:

link

The file in first line is hyperref.sty under texmf-dist/tex/latex/hyperref.

%% LyX 2.0.5 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass{elsarticle}
\usepackage{lmodern}
\renewcommand{\sfdefault}{lmss}
\renewcommand{\ttdefault}{lmtt}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\setlength{\parskip}{\smallskipamount}
\setlength{\parindent}{0pt}
\usepackage{amsmath}
\usepackage[unicode=true,pdfusetitle,
 bookmarks=true,bookmarksnumbered=false,bookmarksopen=false,
 breaklinks=false,pdfborder={0 0 1},backref=false,colorlinks=false]
 {hyperref}
\usepackage{breakurl}

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\numberwithin{equation}{section}
\numberwithin{figure}{section}

\makeatother

\begin{document}
sds
\end{document}

Best Answer

On LaTeX-Community.org we had the very same error message in elsarticle | Problem with 'hyperref' Package. There, the OP solved it by using another TeX distribution. Which means, it can possibly fixed by updating.

However, here I can clearly see that the error goes away if you remove the pdfusetitle option. If this is set then hyperref tries to derive the values for pdftitle and pdfauthor from \title and \author. You did not set them, and it seems that it's not compatible to elsarticle, while there's no error with article.

Anyway, you can fix it by removing/replacing pdfusetitle.