When I load hyperref
inside my own class definition wrapped in AtEndDocument
from the etoolbox
package, my cites aren't colored. But all used section references get colored.
I could figure out that all cite will be colored when hyperref is loaded directly.
\begin{filecontents}{testclass.cls}
\ProvidesClass{testclass}[2018-02-27 v0.1 Test class]
\RequirePackage{etoolbox}
\LoadClass{scrartcl}
\RequirePackage[%
backend = biber
]{biblatex}
\addbibresource{biblatex-examples.bib}
% Working for ref
% But not for cite
\AtEndPreamble{%
\RequirePackage{hyperref}
\hypersetup{colorlinks}
}
\AtEndDocument{%
\printbibliography[heading=bibintoc]
}%
\endinput
\end{filecontents}
\documentclass{testclass}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
% Working both for ref and cite
%\usepackage{hyperref}
%\hypersetup{colorlinks}
\begin{document}
\section{Hello world}\label{sec:hello}
Hello world \cite{doody}
\section{What ever}
If've no idea~\ref{sec:hello}
\end{document}
My question is now how can I color cite when hyperref
is loaded inside my custom class? Thanks for any advice.