2

I'm using biblatex together with titlesec (yes, I know that they don't work well together ...). When I include the titlesec-package the hyperref bookmarks link to the wrong page.

Consider the following MWE:

\documentclass{article}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@book {A,
    author = {Doe, John},
    title = {A title},
    date = {2014},
    location = {A},
}
\end{filecontents}

\usepackage[
    style=authortitle,
    backend=biber,
]{biblatex}

\usepackage[
    bookmarks,
    bookmarksopen,
]{hyperref}

\addbibresource{\jobname.bib}

%\usepackage{titlesec} % uncomment to see the undesired behaviour

\begin{document}

\pagenumbering{Roman}

\tableofcontents
\newpage

\printbibliography[
    heading=bibintoc,
]

\newpage
\pagenumbering{arabic}

\section{My Section}
\cite{A}

\end{document}

Any help is greatly appreciated.

5

You should definitely load titlesec before hyperref.

Adding \phantomsection before \printbibliography solves the problem. You can avoid specifying it with a patch:

\documentclass{article}

\begin{filecontents}{\jobname.bib}
@book {A,
    author = {Doe, John},
    title = {A title},
    date = {2014},
    location = {A},
}
\end{filecontents}

\usepackage[
    style=authortitle,
    backend=biber,
]{biblatex}
\makeatletter
\pretocmd{\blx@head@bibintoc}{\phantomsection}{}{\ddt}
\makeatother

\usepackage{titlesec} % uncomment to see the undesired behaviour

\usepackage[
    bookmarks,
    bookmarksopen,
]{hyperref}

\addbibresource{\jobname.bib}

\begin{document}

\pagenumbering{Roman}

\tableofcontents
\newpage

\printbibliography[
    heading=bibintoc,
]

\newpage
\pagenumbering{arabic}

\section{My Section}
\cite{A}

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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