diff --git a/nopanic.tex b/nopanic.tex index 17e81d6..ef8f740 100644 --- a/nopanic.tex +++ b/nopanic.tex @@ -24,10 +24,16 @@ \newcommand\linklist{} \makeatletter \newcommand{\link}[1]{% - \protected@edef\@tmpkey{{\fontsize{13pt}{0}\selectfont\keys{\arabic{linkcounter}}}}% + \edef\tmptoken{\detokenize{#1}}% + \@ifundefined{nopanic@link@\tmptoken}{% + \protected@edef\@tmpkey{{\fontsize{13pt}{0}\selectfont\keys{\arabic{linkcounter}}}}% + \expandafter\global\expandafter\edef\csname nopanic@link@\tmptoken\endcsname{\arabic{linkcounter}}% + \expandafter\g@addto@macro\expandafter\linklist\expandafter{\@tmpkey & \url{#1}\\}% + \stepcounter{linkcounter}% + }{% + \protected@edef\@tmpkey{{\fontsize{13pt}{0}\selectfont\keys{\csname nopanic@link@\tmptoken\endcsname}}}% + }% \href{#1}{\@tmpkey}% - \expandafter\g@addto@macro\expandafter\linklist\expandafter{\@tmpkey & \url{#1}\\}% - \stepcounter{linkcounter}% } \makeatother