I'm doing my report for my last internship and I've been trying to add hyperref
to my LaTeX pdf. I would like to have a link in my toc for my introduction.
Without hyperref
, it works fine :
\chapter*{Introduction}
\addtocontents{toc}{\contentsline{chapter}{\numberline{}Introduction}{}}
But, when I use hyperref
, I have this :
! Argument of \contentsline has an extra }.
<inserted text>
\par
l.3 ...line{chapter}{\numberline{}Introduction}{}}
I've run across a `}' that doesn't seem to match anything.
For example, `\def\a#1{...}' and `\a}' would produce
this error. If you simply proceed now, the `\par' that
I've just inserted will cause me to report a runaway
argument that might be the root of the problem. But if
your `}' was spurious, just type `2' and it will go away.
Runaway argument?
! Paragraph ended before \contentsline was complete.
<to be read again>
\par
l.3 ...line{chapter}{\numberline{}Introduction}{}}
I suspect you've forgotten a `}', causing me to apply this
control sequence to too much text. How can we recover?
My plan is to forget the whole thing and hope for the best.
)
What went wrong here ?
Thanks
\addcontentsline{toc}{chapter}{Introduction}
\addtocontents
is mostly a source of errors ;-)