From: Thomas Pietrzak Date: Tue, 15 Feb 2022 10:47:17 +0000 (+0100) Subject: footurl command X-Git-Tag: first-full-draft~59 X-Git-Url: https://git.thomaspietrzak.com/?a=commitdiff_plain;h=8d036edd784a832464e18cbe2ff364c6a462040c;p=hdr.git footurl command --- diff --git a/mystyle.sty b/mystyle.sty index b8c68d6..ac342e4 100644 --- a/mystyle.sty +++ b/mystyle.sty @@ -404,6 +404,26 @@ \newcommand{\centrevertical}[1]{\raisebox{-\height + \ht\@arstrutbox}{#1}} \makeatother +\newcommand{\footurl}[1]{\footnote{\href{#1}{\replunderscores{#1}}}} + +\makeatletter +% \expandafter for the case that the filename is given in a command +\newcommand{\replunderscores}[1]{\expandafter\@repl@underscores#1_\relax} + +\def\@repl@underscores#1_#2\relax{% + \ifx \relax #2\relax + % #2 is empty => finish + #1% + \else + % #2 is not empty => underscore was contained, needs to be replaced + #1% + \textunderscore + % continue replacing + % #2 ends with an extra underscore so I don't need to add another one + \@repl@underscores#2\relax + \fi +} +\makeatother \renewenvironment{Abstract}{% %\vspace{5mm}