0

I want to add a link to the appendix in a prenote of a citep reference. However, using \hyperref[label_name]{Text with link} (as stated here) instead of \ref{label_name} fails.

Here is a MWE illustrating the issue:

\begin{filecontents}{ref.bib}
@article{paper1,
title = {{Title here}},
journal = {Journal of Articles},
year = {2019},
author = {Author, A.},
pages = {1-2},
number = {1},
}
\end{filecontents}

\documentclass[a4paper,12pt]{book}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{hyperref}
\usepackage{cleveref}
\usepackage[noibid,authordate-trad,backend=biber,natbib,maxcitenames=2,maxbibnames=99,uniquelist=false]{biblatex-chicago}
\bibliography{ref}
\hypersetup{colorlinks=true, linkcolor=blue, urlcolor=blue, citecolor=red}

\begin{document}

    \chapter{Chapter Title}
    Combine: (see \hyperref[app1]{appendix \ref*{app1}}) \citep{paper1}\\
    Not working: \citep[see \hyperref[app1]{appendix \ref*{app1}},][]{paper1}\\
    Working but \textit{appendix} not included in link: \citep[see appendix \ref{app1},][]{paper1}
    \appendix
    \chapter{Appendix Title}\label{app1}

\end{document}

Which results in enter image description here

Is there a simple way to add custom text to a hyperlink within a prenote of citep?

  • You need curly braces to protect the [...] within another [...]: \citep[see {\hyperref[app1]{appendix \ref*{app1}}},][]{paper1}. See for example https://tex.stackexchange.com/q/84595/35864, https://tex.stackexchange.com/q/99495/35864 – moewe Feb 01 '19 at 12:08
  • That was indeed surprisingly simple. Thank you very much :) – CaptainNabla Feb 01 '19 at 12:17

0 Answers0