I have a document that looks exactly like I want but the bookmarks link to the wrong spot. This MWE is long because if I hacked it down too much I couldn't replicate the issue. Unfortunately, I couldn't isolate the issue either. In the following code, when I run PDFTexify, in the PDF, it links the Acknowledgement
bookmark to the table of contents and the Abstract
bookmark to the title page.
I had read (click here) that \cleardoublepage
and \phantomsection
could set things right (this works for the List of Figures/Tables pages), calling hyperref
first (before bookmark
), or ordering package calls correctly could help. These suggestions, as I understood and tried them, do not seem to fix the problem.
How can I...
- Link Acknowledgement bookmark to the correct page (not toc)
- Link Abstract bookmark to the correct page (not title page)
While keeping the layout/look of the actual document the same?
My Bib File (Seems that addbibresource{biblatex-examples.bib}
no longer works)
@INCOLLECTION{Adams2002,
author = {Peter Adams},
title = {Technology in Publishing: {A} Century of Progress},
booktitle = {Scholarly Publishing: {B}ooks, Journals, Publishers, and Libraries
in the Twentieth Century},
publisher = {Wiley},
year = {2002},
editor = {Abel, R. and Newlin, L. W.},
address = {New York}
}
MWE
\documentclass[12pt]{report}
\usepackage[american]{babel}
\usepackage[T1]{fontenc}
\usepackage[style=apa, backend=biber]{biblatex}
\addbibresource{mybib.bib}
\DeclareLanguageMapping{american}{american-apa}
\usepackage{outlines}
\usepackage{enumitem}
\usepackage[autostyle]{csquotes}
\usepackage{url}
\usepackage{hyperref}
\hypersetup{
colorlinks=true,
linkcolor=blue,
filecolor=magenta,
urlcolor=blue,
citecolor=blue,
}
\usepackage{booktabs}
\newcommand{\ra}[1]{\renewcommand{\arraystretch}{#1}}
\newcommand{\specialcell}[2][c]{%
\begin{tabular}[#1]{@{}c@{}}#2\end{tabular}}
\urlstyle{same}
\usepackage{filecontents}
%% figures and table numbered continuosly
\usepackage{chngcntr}
\counterwithout{figure}{chapter}
\counterwithout{table}{chapter}
%% increase space between bib entries
\setlength\bibitemsep{2\itemsep}
%% change Bibliography name to REFERENCES
\renewcommand{\bibname}{REFERENCES}
\usepackage{setspace}
\usepackage{graphicx}
\usepackage{color,soul}
\addto\captionsamerican{
\renewcommand{\contentsname}%
{\large Table of Contents}%
}
\usepackage{etoolbox}
\makeatletter
\patchcmd{\l@section}
{\hfil}
{\leaders\hbox{\normalfont$\m@th\mkern \@dotsep mu\hbox{.}\mkern \@dotsep mu$}\hfill}
{}{}
\makeatother
\usepackage{titlesec}
\makeatletter
\def\@makechapterhead#1{%
\vspace*{10\p@}%
{\parindent \z@ \centering \reset@font
\par\nobreak
\vspace*{2\p@}%
{\large \bfseries \thechapter\quad #1\par\nobreak}
\par\nobreak
\vspace*{2\p@}%
%\vskip 40\p@
\vskip 100\p@
}}
\def\@makeschapterhead#1{%
\vspace*{10\p@}%
{\parindent \z@ \centering \reset@font
\par\nobreak
\vspace*{2\p@}%
{\large \bfseries #1\par\nobreak}
\par\nobreak
\vspace*{2\p@}%
\vskip 100\p@
}}
\makeatother
%% possessive citation
\newcommand\posscite[1]{\citeauthor{#1}'s (\citeyear{#1})}
\newcommand\poscite[1]{\citeauthor{#1}' (\citeyear{#1})}
\usepackage{bookmark}
%% All headers 12pt
\usepackage{sectsty,textcase}
\allsectionsfont{\large\MakeUppercase}
\chapterfont{\large\MakeUppercase}
%% refs to toc
%\usepackage[nottoc,numbib]{tocbibind}
\usepackage{titlesec}
\titleformat{\chapter}[display]
{\normalfont\large\bfseries}{\chaptertitlename\ \thechapter}{12pt}{\large\MakeUppercase}
\titlespacing*{\chapter}{0pt}{-50pt}{40pt}
%% appendices
\usepackage[title,titletoc]{appendix}
%% dot fill chapters
\usepackage{tocloft}
\renewcommand\cftchapdotsep{\cftdotsep}
\renewcommand\cftchapleader{\large\cftdotfill{\cftchapdotsep}}
\renewcommand\cftloftitlefont{\large\textbf}
\renewcommand\cftlottitlefont{\large\textbf}
%% Set margins to 1 inch
\usepackage[margin=1in]{geometry}
\setlength\cftbeforetoctitleskip{-1cm} %toc
\setlength\cftbeforeloftitleskip{-1cm} % list of figs
\setlength\cftbeforelottitleskip{-1cm} % lsit of tables
\singlespace
\author{\vspace{0cm} \large by Me}
\title{\vspace{-5cm} \large The Title}
\setcounter{secnumdepth}{0}
\begin{document}
\maketitle
\pagenumbering{roman}
\thispagestyle{empty}
\newpage
\section*{}
\doublespacing
\vspace{14cm}
\begin{center}
Copyright by \\
2014 \\
\end{center}
\newpage
\cleardoublepage
\phantomsection
\addcontentsline{toc}{section}{Acknowledgement}
%\section{Acknowledgment}
\newpage
\pdfbookmark[section]{\contentsname}{toc}
\tableofcontents
\newpage
\cleardoublepage
\phantomsection
\addcontentsline{toc}{section}{List of Tables}
\listoftables
\newpage
\cleardoublepage
\phantomsection
\addcontentsline{toc}{section}{List of Figures}
\listoffigures
\newpage
%https://tex.stackexchange.com/questions/30122/generate-table-of-contents-when-section-sections-without-numbering-has-been
\section{Abstract}
Some Info
\newpage
\pagenumbering{arabic}
\setcounter{secnumdepth}{2}
\part{Fox and Cat}
\chapter{Dog}
\section{Food}
\chapter{Run}
\part{Chicken and Hen}
\chapter{Introduction}
\part{Discussion}
\chapter{Discussion}
\clearpage
\section*{Tables}
\addtocounter{section}{3}
\begin{table}[!ht]
\parbox{7.5cm}{\caption{Yepper}}
\centering
\begin{singlespace}
\begin{tabular}{lrrrr}
\hline \\
%\multicolumn{5}{c}{\textbf{Average Student Engagement Level}} \\
\multicolumn{5}{c}{} \\
\multicolumn{1}{c}{} & \multicolumn{2}{c}{Special Ed.} & \multicolumn{2}{c}{Reg. Ed.} \\
\cmidrule(lr){2-3}
\cmidrule(l ){4-5}
Gender & Charter & Public & Charter & Public \\
\midrule
Male & 643 & 793 & 590 & 724 \\
Female & 735 & 928 & 863 & 662 \\
\end{tabular}
\end{singlespace}
\end{table}
\clearpage
\section*{Visuals}
hello
\begin{appendices}
\renewcommand{\appendixname}{APPENDIX}
\bookmarksetup{startatroot}
\chapter{Foo}
some text
\bookmarksetup{startatroot}
\chapter{Bar}
some more text
\end{appendices}
\addcontentsline{toc}{chapter}{REFERENCES}
\nocite{*}
\renewcommand{\bibname}{\vspace{1cm} REFERENCES}
\newpage
\singlespacing
\bookmarksetup{startatroot}
\cleardoublepage
\phantomsection
\addcontentsline{toc}{chapter}{REFERENCES}
\printbibliography
\end{document}