Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question
    
Welcome to TeX.SX. Usually, we don't put a greeting or a "thank you" in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Upvoting is the preferred way here to say "thank you" to users who helped you. –  Claudio Fiandrino Dec 18 '12 at 17:34

1 Answer 1

up vote 3 down vote accepted

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.

share|improve this answer
    
Yes It was solved. Thank you. And is there a way to remove the pdfusetitle option in directly Lyx? e.g. Writing something in the preamble? –  terencezl Dec 18 '12 at 20:36
1  
@Terence Sure, look into Document / Settings / PDF propertiers, Hyperref support / Hyperlinks. –  Stefan Kottwitz Dec 18 '12 at 21:13
    
Worked like magic. –  terencezl Dec 18 '12 at 21:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.