Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm having a bit of trouble with the PDF bookmarks. I am trying to

  1. Add "Contents" as an entry to the PDF bookmarking.
  2. Have numbering for my sections and subsections.

I am looking to achieve something like this (image taken from the bookmarks package documentation):

Bookmarks

So far, I have only managed to generate my PDF bookmarks, but not edit them.

I have included a sample of my document with the following note. The code is only an attempt at a MWE, if there are lines of code that are not relevant to this problem then please feel free to edit. Sorry for the length!

\documentclass[10pt]{article}
\usepackage{graphicx}
\usepackage{epstopdf}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{fnpct}

%\usepackage[numbered]{bookmark}

\usepackage[a4paper]{geometry}
\geometry{top=1.0in, bottom=1.15in, left=1.15in, right=1.15in}

\usepackage[usenames,dvipsnames]{color}
\usepackage{natbib}
\usepackage[colorlinks=true]{hyperref}
\hypersetup{colorlinks=true, citecolor=ForestGreen, linkcolor=Red, urlcolor=Blue}

\usepackage{footnotebackref}
\newcounter{intro}
\renewcommand{\theintro}{Int.}


\begin{document}

\begin{titlepage} \Huge{\sc{Title}} \end{titlepage}

\thispagestyle{empty}
\newpage
\clearpage
\thispagestyle{empty}
\phantom{a}
\vfill
\newpage
\vfill
\addtocounter{page}{-4}

\begin{center}
\textbf{\Large{Abstract}} \\
\vspace*{0.43 cm}
\noindent This is the abstract so far. 
\end{center} 

\thispagestyle{empty}
\newpage

\clearpage
\thispagestyle{empty}
\phantom{a}
\vfill
\newpage
\vfill

\thispagestyle{empty}
\tableofcontents
\newpage


\section*{Introduction}
\addcontentsline{toc}{section}{Introduction} 
\refstepcounter{intro}
\label{s:intro}

\section[Title to be added to ToC]{Title to be added to ToC\\ \large{Subtitle only appearing in text}}\label{label1}
\subsection{Subsection name here}
\subsection{Other name here}
\section{Another section}

\bibliographystyle{plain} 
\begin{thebibliography}{99} 
...
\end{thebibliography}
\end{document}

When I tried to use the bookmark package I got the error that there was an "option clash" between bookmark and hyperref.

share|improve this question
1  
You must load package bookmark after package hyperref. –  Kurt Sep 14 '12 at 14:58
    
.....Thank you! –  User 17670 Sep 14 '12 at 15:32

1 Answer 1

up vote 8 down vote accepted

Additional bookmarks can be added via \pdfbookmark, see example below. Also I have disabled page anchors for the first pages to avoid duplicate destination names, because some of the pages have the same page number. (Also I have disabled two packages that I do not have installed).

\documentclass[10pt]{article}
\usepackage{graphicx}
\usepackage{epstopdf}
\usepackage{amsmath}
\usepackage{amssymb} 
% \usepackage{fnpct}

\usepackage[a4paper]{geometry}
\geometry{top=1.0in, bottom=1.15in, left=1.15in, right=1.15in}

\usepackage[usenames,dvipsnames]{color}
\usepackage{natbib}
\usepackage[colorlinks=true]{hyperref}
\hypersetup{colorlinks=true, citecolor=ForestGreen, linkcolor=Red,
urlcolor=Blue}

\usepackage{bookmark}
\bookmarksetup{
  numbered, 
  open,
}

% \usepackage{footnotebackref}
\newcounter{intro}
\renewcommand{\theintro}{Int.}


\begin{document}

\hypersetup{pageanchor=false}

\begin{titlepage} \Huge{\sc{Title}} \end{titlepage}

\thispagestyle{empty}
\newpage
\clearpage
\thispagestyle{empty}  
\phantom{a}
\vfill
\newpage
\vfill
\addtocounter{page}{-4}

\begin{center}
\textbf{\Large{Abstract}} \\
\vspace*{0.43 cm}
\noindent This is the abstract so far.
\end{center}

\thispagestyle{empty}
\newpage

\clearpage
\thispagestyle{empty}
\phantom{a}
\vfill
\newpage

\hypersetup{pageanchor=true}
\thispagestyle{empty}
\pdfbookmark[section]{\contentsname}{toc}
\tableofcontents
\newpage


\section*{Introduction}
\addcontentsline{toc}{section}{Introduction}
\refstepcounter{intro}
\label{s:intro}

\section[Title to be added to ToC]{Title to be added to ToC\\
\large Subtitle only appearing in text}\label{label1}
% \large does not take an argument
\subsection{Subsection name here} 
\subsection{Other name here}
\section{Another section}   

\bibliographystyle{plain}
\begin{thebibliography}{99}
...
\end{thebibliography}
\end{document}
share|improve this answer
    
Thank you! I now have numbering of sections as well as the "Contents" entry and, with your example I can make even more. Oh, and thanks for making the package in the first place! –  User 17670 Sep 14 '12 at 15:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.