I would like to have the possibility to have a hyperlink inside a chapter / section title.
MWE:
\documentclass[twoside]{book}
\usepackage[pdftex,pagebackref=true]{hyperref}
\begin{document}
\chapter{documentation for link to Section 1}
%%\chapter{documentation for link to \hyperlink{sec1}{Section 1}}
\hypertarget{sec1}{}\section{Section 1 Reference}
\hypertarget{sec2}{}\section{Section 2 Reference}
documentation for \hyperlink{sec1}{Section 1}
\end{document}
This results in the following output:

We see in section 1.2 the hyperlink to section 1.1, but I want to have the link also in the chapter title. When adding a second chapter with a hyperlink (remove %% ) I get the error message:
Chapter 1.
Package hyperref Warning: Token not allowed in a PDF string (PDFDocEncoding):
(hyperref) removing `<let>-command' on input line 6.
Package hyperref Warning: Token not allowed in a PDF string (PDFDocEncoding):
(hyperref) removing `\Hy@reserved@a' on input line 6.
Package hyperref Warning: Token not allowed in a PDF string (PDFDocEncoding):
(hyperref) removing `@ifnextchar' on input line 6.
! Undefined control sequence.
\hyper@@link ->\let \Hy@reserved@a
\relax @ifnextchar [{\hyper@link@ }{\hyp...
l.6 ...on for link to \hyperlink{sec1}{Section 1}}
?
! Emergency stop.
\hyper@@link ->\let \Hy@reserved@a
\relax @ifnextchar [{\hyper@link@ }{\hyp...
l.6 ...on for link to \hyperlink{sec1}{Section 1}}
! ==> Fatal error occurred, no output PDF file produced!
Question: How to get the hyperlink in the chapter (/section) title.
\chapter{documentation for link to \protect\hyperlink{sec1}{Section 1}}? – moewe May 31 '18 at 11:49\section{Section 1 Reference}\label{sec1}instead of\hypertarget{sec1}{}\section{Section 1 Reference}. Then one could write\chapter{documentation for link to \hyperref[sec1]{Section 1}}(i.e. no\protect) because\hyperrefis robust. – moewe May 31 '18 at 11:53\protectis, probably, easiest. Maybe you can make an answer of your suggestions. – albert May 31 '18 at 12:06