latex-packages/mkessler-hypersetup.sty
2021-09-10 11:41:06 +02:00

26 lines
928 B
TeX

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{mkessler-hypersetup}[2021-09-06 - Package for setting up hyperref, cleveref and some default hyperref colors]
%%%%%%%%%%%%%%%%%%
\newif\ifmkessler@hypersetup@cleveref\mkessler@hypersetup@clevereffalse
\DeclareOption{cleveref}{\mkessler@hypersetup@clevereftrue}
\DeclareOption*{\PackageWarning{mkessler-hypersetup}{Unknown '\CurrentOption'}}
\ProcessOptions\relax
%%%Hyperref and setup
\RequirePackage{xcolor} % To compute the colors below
\RequirePackage{etoolbox} % Checking for defined commands
\def\mkessler@hypersetup@exec{
\RequirePackage{hyperref} % Hyperlinks
\ifmkessler@hypersetup@cleveref
\RequirePackage{cleveref} % Better referencing
\fi
\hypersetup{colorlinks, citecolor=violet, urlcolor=blue!80!black, linkcolor=red!50!black, pdfauthor=\@author, pdftitle=\ifdef{\@course}{\@course}{\@title}}
}
\AtEndPreamble{
\mkessler@hypersetup@exec
}