From d9a65ab9d3bde4e1c3e155852f7461948a9f8760 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 31 Aug 2020 21:18:29 +0000 Subject: edichokey (31aug20) git-svn-id: svn://tug.org/texlive/trunk@56223 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/tex/latex/edichokey/edichokey.sty | 26 ++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'Master/texmf-dist/tex/latex/edichokey') diff --git a/Master/texmf-dist/tex/latex/edichokey/edichokey.sty b/Master/texmf-dist/tex/latex/edichokey/edichokey.sty index 1b927eadaf7..c4dee913c4a 100644 --- a/Master/texmf-dist/tex/latex/edichokey/edichokey.sty +++ b/Master/texmf-dist/tex/latex/edichokey/edichokey.sty @@ -19,15 +19,20 @@ % - the example files: [edichokey-ex.tex, edichokey-ex.pdf]. %% \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{edichokey}[2020/07/14 v2.00 package edichokey] +\ProvidesPackage{edichokey}[2020/08/31 v2.01y package edichokey] \makeatletter \def\edk@get@array#1{\csname edk@array@#1\endcsname} \def\edk@set@array#1#2{\expandafter\xdef\csname edk@array@#1\endcsname{#2}} \newif\if@edk@named@ +\newif\if@edk@hyperref@\@edk@hyperref@false +\DeclareOption{hyperref}{\@edk@hyperref@true} +\ProcessOptions +\RequirePackage{hyperref} \newdimen\alterindent\alterindent1.2em \newdimen\taxonrightskip\taxonrightskip2em \newdimen\edk@leftskip \newbox\edk@header +\newcount\edk@key \newcount\edk@depth \newcount\edk@couplet \def\edknamestyle{\bfseries\itshape} @@ -50,8 +55,12 @@ \def\dot@line{% \unskip\dot@fill{0pt plus 1fil}\penalty150% \null\nobreak\dot@fill{12pt plus 1fill}} -\newenvironment{Key} - {\edk@depth\z@ +\newenvironment{Key}{% + \global\advance\edk@key\@ne + \if@edk@hyperref@ + \hypersetup{hidelinks=true}% + \fi + \edk@depth\z@ \edk@couplet\z@ \parindent\z@ \advance\rightskip\taxonrightskip @@ -82,8 +91,17 @@ \xdef\edk@number{\the\edk@couplet}% \edk@set@array{\the\edk@depth}{\the\edk@couplet}% \fi + \if@edk@hyperref@ + \def\edk@hyp@prefix{edichokey:\the\edk@key:\edk@number:} + \edef\edk@hyp@this{\edk@hyp@prefix\if@edk@named@ b\else a\fi}% + \edef\edk@hyp@that{\edk@hyp@prefix\if@edk@named@ a\else b\fi}% + \def\edk@hyp@make##1{% + \phantomsection\label{\edk@hyp@this}\hyperref[\edk@hyp@that]{##1}}% + \else + \def\edk@hyp@make##1{##1}% + \fi \@edk@named@false \sbox\edk@header{\edk@number.~}% \leftskip\dimexpr\edk@leftskip+\edk@depth\alterindent+\wd\edk@header\relax - \indent\llap{\box\edk@header}} + \indent\edk@hyp@make{\llap{\box\edk@header}}} \makeatother -- cgit v1.2.3