-\usepackage{ifpdf} % part of the hyperref bundle
-\ifpdf % if pdflatex is used
-
- % set fonts for nicer pdf view
- \IfFileExists{lmodern.sty}{\usepackage{lmodern}}{}
-
-\fi % end if pdflatex is used
-
- % the pages of the TOC are numbered roman
- % and a pdf-bookmark for the TOC is added
- \pagenumbering{Roman}
- \let\myTOC\tableofcontents
- \renewcommand\tableofcontents{%
- \pdfbookmark[1]{Índice general}{}
- \myTOC
- \cleardoublepage
- \pagenumbering{arabic} }
-
-% redefine the \LyX macro for PDF bookmarks
-\def\LyX{\texorpdfstring{%
- L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\@}
- {LyX }}
+% Work around a bug in Babel-Spanish with \lim if non-TeX fonts are used:
+\@ifpackageloaded{fontspec}{\unaccentedoperators}{}
+
+% the pages of the TOC is numbered roman
+% and a pdf-bookmark for the TOC is added
+\let\myTOC\tableofcontents
+\renewcommand\tableofcontents{%
+ \frontmatter
+ \pdfbookmark[1]{\contentsname}{}
+ \myTOC
+ \mainmatter }