While writing my thesis I use the hyperref and appendix packages like in the little example below.
test.tex
\documentclass{book}
\usepackage{hyperref}
\usepackage[titletoc]{appendix}
\begin{document}
\tableofcontents
\chapter{First chapter}
\section{Chapter section}
\chapter{Second chapter}
\begin{appendices}
\input{extra}
\end{appendices}
\end{document}
extra.tex
\chapter{First appendix}
\section{Appendix section}
This example produces no errors. The end result is a content table with clickable links to all the chapters (including those in the appendices) and formatted the way I want it.
While compiling (pdfLaTeX) the following file is produced:
test.out
\BOOKMARK [0][-]{chapter.1}{First chapter}{}% 1
\BOOKMARK [1][-]{section.1.1}{Chapter section}{chapter.1}% 2
\BOOKMARK [0][-]{chapter.2}{Second chapter}{}% 3
\BOOKMARK [0][-]{Appendix.1.A}{Appendix First appendix}{}% 4
\BOOKMARK [1][-]{section.1.A.1}{Appendix section}{Appendix.1.A}% 5
My thesis is, of course, much larger (more chapters and more appendices). Although the structure is similar, compiling my thesis results in numerous cryptic errors (meaning I don't understand them). I've listed a few below. Commenting the hyperref package allows me to compile, but also disables the links and the bookmarks in the PDF document.
! Missing \endcsname inserted.
<to be read again>
\penalty
l.46 ...@skip {}lage.1.D}{B\377lage Afkortingen}{}
% 46
The control sequence marked <to be read again> should
not appear between \csname and \endcsname.
! Missing number, treated as zero.
<to be read again>
{
l.46 ...@skip {}lage.1.D}{B\377lage Afkortingen}{}
% 46
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
! Extra \endcsname.
\check@bm@number ...0\else \csname B_#1\endcsname
\fi
l.46 ...@skip {}lage.1.D}{B\377lage Afkortingen}{}
% 46
I'm ignoring this, since I wasn't doing a \csname.
)
! Missing $ inserted.
<inserted text>
$
l.154 \begin{document}
The .out file of my thesis looks fine until you arrive at the appendix bookmarks.
...
\BOOKMARK [1][-]{section.5.4}{Optimalisatie}{chapter.5}% 32
\BOOKMARK [0][-]{chapter.6}{Conclusie}{}% 33
\BOOKMARK [0][-]{chapter*.28}{Bibliografie}{}% 34
\BOOKMARK [0][-]{B\penalty \@M \hskip \z@skip i\kern -0.02em j\penalty \@M \hskip \z@skip {}lage.1.A}{B\377lage Stopwoordlijsten}{}% 35
\BOOKMARK [1][-]{section.1.A.1}{Nederlandse stopwoorden}{B\penalty \@M \hskip \z@skip i\kern -0.02em j\penalty \@M \hskip \z@skip {}lage.1.A}% 36
\BOOKMARK [1][-]{section.1.A.2}{Engelse stopwoorden}{B\penalty \@M \hskip \z@skip i\kern -0.02em j\penalty \@M \hskip \z@skip {}lage.1.A}% 37
...
I believe this post is related to my problem, but I can't make head or tails of it (I'm still relatively new to LaTeX). Can anyone help me enable the links and bookmarks in my thesis?
Greetings,
Sander
EDIT
Adding the babel package to the example reproduces the problem.
\usepackage[dutch]{babel}
hyperrefafterappendixhelps. It is generally a good practice to loadhyperrefas the very last package. – yo' Aug 17 '12 at 21:03hyperreflast makes no difference – Sander Aug 17 '12 at 21:08floatandalgorithmpackages as well but they're in the proper order – Sander Aug 17 '12 at 21:11\377on the lines marked "l.46"); this is getting expanded to use explicit tex kerns and spacing, with a penalty to outlaw a line break. so i think it's an input encoding issue, not really a package issue except thathyperrefisn't handling it properly. – barbara beeton Aug 17 '12 at 21:25bookmarkafterhyperrefseems to overcome the problem. However, you should try and show an example that produces the problem (yours doesn't). – egreg Aug 17 '12 at 21:43\usepackage{bookmark}solves the compiling issues. But I still end up with the incorrect 'Bÿlage' bookmarks (but that's a minor issue to me). – Sander Aug 17 '12 at 21:51babelis loaded with language optionmagyartoo. – DanielTuzes Nov 21 '18 at 12:32