summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/endnotes-hy
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-04-11 22:23:52 +0000
committerKarl Berry <karl@freefriends.org>2020-04-11 22:23:52 +0000
commit591b80b11e2ee3890ac7419d50582dc3f27180c7 (patch)
treeb9c16460733f156341c37016aa10f08176a25614 /Master/texmf-dist/tex/latex/endnotes-hy
parent1fc41b1fba482cb23d6bf3636c69fe60cc193f5e (diff)
endnotes-hy (10apr20)
git-svn-id: svn://tug.org/texlive/trunk@54658 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/endnotes-hy')
-rw-r--r--Master/texmf-dist/tex/latex/endnotes-hy/endnotes-hy.sty68
1 files changed, 68 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/endnotes-hy/endnotes-hy.sty b/Master/texmf-dist/tex/latex/endnotes-hy/endnotes-hy.sty
new file mode 100644
index 00000000000..3ce809c2ea1
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/endnotes-hy/endnotes-hy.sty
@@ -0,0 +1,68 @@
+%%
+%% This is file `endnotes-hy.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% endnotes-hy.dtx (with options: `copyright,package')
+%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% endnotes-hy.sty package, %%
+%% Copyright (C) 2020 %%
+%% dpstory@uakron.edu dpstory@acrotex.net %%
+%% %%
+%% This program can redistributed and/or modified under %%
+%% the terms of the LaTeX Project Public License %%
+%% Distributed from CTAN archives in directory %%
+%% macros/latex/base/lppl.txt; either version 1.2 of the %%
+%% License, or (at your option) any later version. %%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{endnotes-hy}
+ [2020/04/08 v0.1 Enables hypertext links for endnotes]
+\RequirePackage{endnotes}
+\RequirePackage{etoolbox}
+\newcommand\hyperref@nohy[2][]{#2}
+\AtBeginDocument{\@ifundefined{hyperref}{\let\hyperref@en\hyperref@nohy
+ \let\phantomendnote\relax}
+ {\let\hyperref@en\hyperref}}
+\def\phantomendnote{%
+ \Hy@MakeCurrentHrefAuto{endnote}%
+ \Hy@raisedlink
+ {\hyper@anchorstart{endnote.\@theenmark}\hyper@anchorend}}
+\def\endnoteautorefname{endnote}
+\patchcmd{\theendnotes}{\enoteformat}
+ {\phantomendnote\def\@currentHref{endnote.\@theenmark}%
+ \enoteformat}{}{}
+\newtoks\@entoks
+\def\endnote{\let\@encurrlabelname\@empty
+ \@ifstar{\let\@noMrk1\endnote@i}{\let\@noMrk0\endnote@i}}
+\def\endnote@i{\@ifnextchar[%]
+ {\@xendnote}
+ {\stepcounter{endnote}%
+ \protected@xdef\@theenmark{\theendnote}%
+ \afterassignment\endnote@ii\@entoks}}
+\def\endnote@ii{\@ifnextchar\label{\endnote@iii}{\endnote@iv}}
+\def\endnote@iii\label#1{\def\@encurrlabelname{#1}\endnote@iv}
+\def\endnote@iv{%
+ \if\@noMrk0\relax
+ \ifx\@encurrlabelname\@empty
+ \@endnotemark
+ \else
+ \hyperref@en[\@encurrlabelname]{\@endnotemark}%
+ \fi
+ \fi
+ \expandafter\@endnotetext\expandafter{\the\@entoks}}
+\patchcmd{\@endnotetext}
+ {\def\next{#1}}
+ {\ifx\@encurrlabelname\@empty
+ \def\next{#1}\else
+ \edef\x{\noexpand\label{\@encurrlabelname}}%
+ \expandafter\def\expandafter\next\expandafter{\x#1}\fi}{}{}
+\patchcmd{\@xendnote}
+ {\@endnotemark\@endnotetext}
+ {\afterassignment\endnote@ii\@entoks}
+ {}{}
+\endinput
+%%
+%% End of file `endnotes-hy.sty'.