Document Classes ⇒ Hyperref and Table of Contents issues
-
Simon Halliday
- Posts: 5
- Joined: Mon Jun 02, 2008 6:52 pm
Hyperref and Table of Contents issues
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
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- Stefan Kottwitz
- Site Admin
- Posts: 10397
- Joined: Mon Mar 10, 2008 9:44 pm
Hyperref and Table of Contents issues
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
Hyperref and Table of Contents issues
-
Simon Halliday
- Posts: 5
- Joined: Mon Jun 02, 2008 6:52 pm