0

I'm creating a LaTeX document with custom-defined sectional headers:

\newcommand{\headpart}[1]{\stepcounter{pt}\begin{center}\rule{1.75in}{1pt}\\\vspace{0.5\onelineskip}\Large{Part \thept}\\\vspace{0.25\onelineskip}\large{\textit{#1}}\\\vspace{0.5\onelineskip}\rule{1.75in}{1pt}\\\vspace{2\onelineskip}\end{center}\addcontentsline{toc}{section}{Part \thept---#1} \renewcommand{\partheadmark}{#1} \label{Part #1} \bookmark[level=1,page=\thepage]{Part \thept---#1}}
\newcommand{\headchap}[1]{\stepcounter{chap}\begin{center}\large{\textbf{\uppercase{Chapter \thechap---#1}}}\end{center}\addcontentsline{toc}{subsection}{Chapter \thechap---#1} \renewcommand{\chapterheadmark}{#1} \label{Chap #1} \bookmark[level=2,page=\thepage]{Chapter \thechap---#1}}
\newcommand{\headsec}[1]{\stepcounter{sec}\vspace{\quarterlineskip}\hangpara{0.5in}{1}\underline{\S \thesec. #1}\vspace{\halflineskip}\addcontentsline{toc}{subsubsection}{\ifnum \thesec=1 \S \ \else \phantom{\S} \fi \thesec. #1} \renewcommand{\sectionheadmark}{#1} \label{Sec #1} \bookmark[level=3,page=\thepage]{\S \thesec. #1}}

I'm using the hyperref and bookmark packages (in that order) on the memoir class. The problem is, the package automatically creates .pdf bookmarks for an entry from \addcontentsline. These are never properly set, and I'd like to have the bookmarks defined separately in the headers (As seen above). How can I prevent the package(s) from automatically setting the \addcontentsline entries as bookmarks, so it doesn't make duplicates?

Adam
  • 1
  • 1

0 Answers0