From 8d036edd784a832464e18cbe2ff364c6a462040c Mon Sep 17 00:00:00 2001 From: Thomas Pietrzak Date: Tue, 15 Feb 2022 11:47:17 +0100 Subject: [PATCH] footurl command --- mystyle.sty | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) 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} -- 2.30.2