rework hypersetup package to load cleveref last, and add switch for \@course or \@title macro

This commit is contained in:
Maximilian Keßler 2021-09-10 10:04:27 +02:00
parent b77f9a3299
commit 9fe85de0f9

View file

@ -9,9 +9,15 @@
\ProcessOptions\relax
%%%Hyperref and setup
\RequirePackage{hyperref} % Hyperlinks
\RequirePackage{xcolor} % To compute the colors below
\RequirePackage{amsmath} % Cleveref needs this
\RequirePackage{cleveref} % Better referencing
\hypersetup{colorlinks, citecolor=violet, urlcolor=blue!80!black, linkcolor=red!50!black, pdfauthor=\@author, pdftitle=\@title}
\RequirePackage{etoolbox} % Checking for defined commands
\def\mkessler@hypersetup@exec{
\RequirePackage{hyperref} % Hyperlinks
\RequirePackage{cleveref} % Better referencing
\hypersetup{colorlinks, citecolor=violet, urlcolor=blue!80!black, linkcolor=red!50!black, pdfauthor=\@author, pdftitle=\ifdef{\@course}{\@course}{\@title}}
}
\AtEndPreamble{
\mkessler@hypersetup@exec
}