summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/lwarp/lwarp-hyperref.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-04-29 23:01:08 +0000
committerKarl Berry <karl@freefriends.org>2018-04-29 23:01:08 +0000
commit962840188681e1d6f4aec0ebf07e05a70609325d (patch)
treee52ae47b050b61688ebd40d705b32c5031c2b200 /Master/texmf-dist/tex/latex/lwarp/lwarp-hyperref.sty
parent52c3c8ff1c0e07c4437eaea8df993e626fc9a52a (diff)
lwarp (26apr18)
git-svn-id: svn://tug.org/texlive/trunk@47491 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/lwarp/lwarp-hyperref.sty')
-rw-r--r--Master/texmf-dist/tex/latex/lwarp/lwarp-hyperref.sty102
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%
}