# Citations and Hyperref

If I introduce a citation in a subsection title I get the following warning:

Package hyperref Warning: Token not allowed in a PDF string (PDFDocEncoding): (hyperref) removing \@ifnextchar' on input line 18.

This is my minimal example:

\documentclass{article}
\usepackage[english]{babel}

\begin{filecontents}{jobname.bib}
@article{myref,
author = {author},
title = {Title},
journal = {Journal},
year = {9999},
volume = {1},
number = {1},
pages = {10--20}
}
\end{filecontents}

\begin{document}
\subsection{Subsection Title \cite{myref} }

\bibliographystyle{apalike}
\bibliography{jobname}

\end{document}

• Off-topic: It is prtetty strange to cite something in a structural title. – Johannes_B Aug 4 '17 at 9:05
• That was in fact my second question. If I add introduce method name in a title. Should I only add a reference in the content? – Juan Leni Aug 4 '17 at 9:07
• Yes, I think so. But this is a style question not a TeX question. – Schweinebacke Aug 4 '17 at 9:09
• I agree. Sorry and thank you for the feedback. By the way, I sometimes have some "style" questions. What would be an appropriate stackexchange group for that? – Juan Leni Aug 4 '17 at 9:10
• Off-topic: Since you're using the apalike bibliography style, you should use the field name journal, not journaltitle. – Mico Aug 4 '17 at 9:29

\cite is not expandable and will therefore not work, when the subsection title is expanded to a bookmark string. \texorpdfstring can be used to provide an alternative or omit it:
\subsection{Subsection Title\texorpdfstring{ \cite{myref}}{}}

\subsection[Subsection Title]{Subsection Title \cite{myref}}

• @purpleTentacle Use the optional argument of \subsection and don't use \cite` in that optional argument. – Schweinebacke Aug 4 '17 at 9:10