-
Notifications
You must be signed in to change notification settings - Fork 0
/
link.tex
26 lines (25 loc) · 1.17 KB
/
link.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
\makeatletter
\usepackage[outline]{contour}
\PassOptionsToPackage{normalem}{ulem}
\usepackage{ulem}
% we do it manually to "fix" it, we do not need breaking
\DeclareRobustCommand*\fancyul[2][\fancyulbackground]{%
\def\fancyul@background{#1}%
\def\ULdepth{1pt}%
\def\ULthickness{.1ex}%
\contourlength{.35pt}%
{\color{\fancyulcolor}\uline{\phantom{#2}}}\llap{\contour\fancyul@background{#2}}%
}
\makeatletter
\def\fancyulbackground{btdm@background}%
\colorlet{cv@ul@line@color}{btdm@primary!50!btdm@background}
\hypersetup{colorlinks=false,pdfborder=0 0 0}% just make sure :D
\def\fancyulcolor{cv@ul@line@color}%
% we make the auto detection of the depth bigger
\def\update@ul{\setbox\z@\hbox{{(j}}\let\ULdepth\p@\edef\ULthickness{\the\dimexpr.235\dp\z@}}
% define a link macro that can be used with href and fancyul
\DeclareRobustCommand*\link{\hyper@normalise\link@do}
\def\link@do#1#2{\leavevmode\hskip-2\p@\href{#1}{\update@ul\hskip2\p@\fancyul{#2}}}% thinspace for some nicer padding
\DeclareRobustCommand*\hlink{\hyper@normalise\hlink@do}
\def\hlink@do#1#2{\leavevmode\hskip-2\p@\hyperlink{#1}{\update@ul\hskip2\p@\fancyul{#2}}}%
\def\cv@link{\link}% allow for later redefinitions