diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/lwarp/lwarp-hyperref.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/lwarp/lwarp-hyperref.sty | 102 |
1 files changed, 53 insertions, 49 deletions
diff --git a/Master/texmf-dist/tex/latex/lwarp/lwarp-hyperref.sty b/Master/texmf-dist/tex/latex/lwarp/lwarp-hyperref.sty index 51da8aac561..471402b46fc 100644 --- a/Master/texmf-dist/tex/latex/lwarp/lwarp-hyperref.sty +++ b/Master/texmf-dist/tex/latex/lwarp/lwarp-hyperref.sty @@ -38,11 +38,11 @@ \newrobustcmd*{\hyperimage}{% \begingroup% -\catcode`\#=12 -\catcode`\%=12 -\catcode`\&=12 -\catcode`\~=12 -\catcode`\_=12 +\catcode`\#=12% +\catcode`\%=12% +\catcode`\&=12% +\catcode`\~=12% +\catcode`\_=12% \LWR@hyperimageb% } @@ -55,53 +55,57 @@ \newcommand*{\hyperdef}{% \begingroup% -\catcode`\#=12 -\catcode`\%=12 -\catcode`\&=12 -\catcode`\~=12 -\catcode`\_=12 +\catcode`\#=12% +\catcode`\%=12% +\catcode`\&=12% +\catcode`\~=12% +\catcode`\_=12% \LWR@hyperdefb% } -\NewDocumentCommand{\LWR@hyperrefbb}{m m m +m}{% -\def\LWR@templink{#1}% -\@onelevel@sanitize\LWR@templink% -\def\LWR@templinktwo{#2}% -\@onelevel@sanitize\LWR@templinktwo% -\def\LWR@templinkthree{#3}% -\@onelevel@sanitize\LWR@templinkthree% -\LWR@htmltag{a href="\LWR@templink\LWR@hashmark% - \LWR@templinktwo.\LWR@templinkthree"% -}% -#4% +\newcommand{\LWR@hyperreffinish}[1]{% +\begingroup% +\LetLtxMacro\ref\LWR@origref%{} syntax highlighting +#1% +\endgroup% \LWR@htmltag{/a}% +} + +\newcommand*{\LWR@hyperrefbb}[3]{% +\LWR@htmltag{% + a href="% + \detokenize\expandafter{#1}\LWR@hashmark% + \detokenize\expandafter{#2}.\detokenize\expandafter{#3}% + "% +}% \endgroup% +\LWR@hyperreffinish% } \newrobustcmd*{\LWR@hyperrefb}{% \begingroup% -\catcode`\#=12 -\catcode`\%=12 -\catcode`\&=12 -\catcode`\~=12 -\catcode`\_=12 +\catcode`\#=12% +\catcode`\%=12% +\catcode`\&=12% +\catcode`\~=12% +\catcode`\_=12% \LWR@hyperrefbb% } -\NewDocumentCommand{\LWR@hyperrefcb}{O{label} +m}{ + +\NewDocumentCommand{\LWR@hyperrefcb}{O{label}}{% \LWR@startref{#1}% -#2% -\LWR@htmltag{/a}% \endgroup% +\LWR@hyperreffinish% } \newcommand*{\LWR@hyperrefc}{% \begingroup% -\catcode`\#=12 -\catcode`\%=12 -\catcode`\&=12 -\catcode`\~=12 -\catcode`\_=12 +\catcode`\#=12% +\catcode`\%=12% +\catcode`\&=12% +\catcode`\~=12% +\catcode`\_=12% \LWR@hyperrefcb% } @@ -111,33 +115,33 @@ } \NewDocumentCommand{\LWR@hypertargetb}{m +m}{% -\label{#1}% +\label{LWR-ht-#1}% #2% \endgroup% } \newcommand*{\hypertarget}{% \begingroup% -\catcode`\#=12 -\catcode`\%=12 -\catcode`\&=12 -\catcode`\~=12 -\catcode`\_=12 +\catcode`\#=12% +\catcode`\%=12% +\catcode`\&=12% +\catcode`\~=12% +\catcode`\_=12% \LWR@hypertargetb% } -\DeclareDocumentCommand{\LWR@hyperlinkb}{m +m}{% -\hyperref[#1]{#2}% -\endgroup% +\DeclareDocumentCommand{\LWR@hyperlinkb}{m}{% +\LWR@hyperrefcb[LWR-ht-#1]% } -\newcommand*{\hyperlink}{% +\DeclareDocumentCommand{\hyperlink}{}{% +\LWR@ensuredoingapar% \begingroup% -\catcode`\#=12 -\catcode`\%=12 -\catcode`\&=12 -\catcode`\~=12 -\catcode`\_=12 +\catcode`\#=12% +\catcode`\%=12% +\catcode`\&=12% +\catcode`\~=12% +\catcode`\_=12% \LWR@hyperlinkb% } |