Hi Ladies and Gents,
I have been having issues because I am trying to use the hyperref package, but I don't want numbered sections. Hence I have used the following to get a section into the contents page:
\addcontentsline{toc}{subsection}{"section name"}
But, I want the text that appears from the \addcontentsline command to act as a hyperref. Currently all that is happening is that all of the lines in the ToC are hyper-referenced to the the table of contents page, rather than to the pages on which their content appears. Any ideas?
Thanks,
Simon
Document Classes ⇒ Hyperref and Table of Contents issues
NEW: TikZ book now 40% off at Amazon.com for a short time.
- Stefan Kottwitz
- Site Admin
- Posts: 10322
- Joined: Mon Mar 10, 2008 9:44 pm
Hyperref and Table of Contents issues
Hi Simon,
that should work, I think. Try this minimal example:
Do you get correct links to the pages?
Perhaps consider to use \phantomsection.
Stefan
that should work, I think. Try this minimal example:
Code: Select all
\documentclass[a4paper,10pt]{article}
\usepackage{hyperref}
\begin{document}
\tableofcontents
\newpage
\section*{One}
\addcontentsline{toc}{subsection}{One}
Text
\newpage
\section*{Two}
\addcontentsline{toc}{subsection}{Two}
Text
\end{document}
Perhaps consider to use \phantomsection.
Stefan
LaTeX.org admin
Hyperref and Table of Contents issues
We will need a minimal working example showing this behaviour.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
-
- Posts: 5
- Joined: Mon Jun 02, 2008 6:52 pm
Re: Hyperref and Table of Contents issues
Problem solved. Thanks Stefan.