texlive[56223] Master/texmf-dist: edichokey (31aug20)

commits+karl at tug.org commits+karl at tug.org
Mon Aug 31 23:18:29 CEST 2020


Revision: 56223
          http://tug.org/svn/texlive?view=revision&revision=56223
Author:   karl
Date:     2020-08-31 23:18:29 +0200 (Mon, 31 Aug 2020)
Log Message:
-----------
edichokey (31aug20)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/edichokey/edichokey-doc-en.pdf
    trunk/Master/texmf-dist/doc/latex/edichokey/edichokey-doc-en.tex
    trunk/Master/texmf-dist/doc/latex/edichokey/edichokey-ex.pdf
    trunk/Master/texmf-dist/doc/latex/edichokey/edichokey-ex.tex
    trunk/Master/texmf-dist/tex/latex/edichokey/edichokey.sty

Modified: trunk/Master/texmf-dist/doc/latex/edichokey/edichokey-doc-en.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/edichokey/edichokey-doc-en.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/edichokey/edichokey-doc-en.tex	2020-08-31 21:18:15 UTC (rev 56222)
+++ trunk/Master/texmf-dist/doc/latex/edichokey/edichokey-doc-en.tex	2020-08-31 21:18:29 UTC (rev 56223)
@@ -51,8 +51,8 @@
 	\ for dichotomous identification keys}
 \author{\zh{杨宇昌} (Yuchang \textsc{Yang})%	
 	\footnote{Email address: \url{yang.yc.allium at gmail.com}.}}
-\date{July \nth{14}, 2020\qquad ver.~2.00}
-
+\date{August \nth{31}, 2020\qquad ver.~2.01y}
+\hypersetup{hidelinks}
 \frenchspacing
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -127,10 +127,12 @@
 
 A larger example key containing 107 \textit{Allium} species is provided separatedly in the package as file \texttt{edichokey-ex.tex}, which was taken almost verbatim from \textit{Flora of North America} (see the file for full citation; reusable under CC BY license\footnote{Re-use terms of FNA: \url{http://beta.floranorthamerica.org/Copyright}.}), except that the two branches at the base (led by alternatives with number 1) were exchanged (but its meaning stayed the same). This example, in the given order, cannot be constructed with \pkgname{dichokey}. 
 
-Apart from the modification on the algorithm, \pkgname{edichokey} behaves differently from \pkgname{dichokey} in two more aspects: 
+The package option $hyperref$ (type $\string\usepackage[hyperref]\{edichokey\}$ instead of $\string\usepackage\{edichokey\}$) can make the output key in PDF file easier to use on electronic devices: conjugated alternatives in a key will be hyperlinked to each other, so a reader can jump quickly by clicking their numbers. However, to apply this feature, the source file is required to be compiled twice.
+
+Apart from the mentioned modifications, \pkgname{edichokey} behaves differently from \pkgname{dichokey} in two more aspects: 
 {\parskip-5pt 
 \begin{itemize}
-	\parskip0pt\itemsep2pt
+	\parskip0pt\itemsep0pt
 	\item Dots connecting an alternative and a taxon can be wrapped into two lines;
 	\item All alternatives (maybe with following dots) are wrapped at $\string\righttaxonskip$ length (by default $2em$) from the right margin, leaving only the keyed out taxa reaching the true right boundary.
 \end{itemize}}
@@ -141,6 +143,8 @@
 \parskip=0pt
 \parindent=0pt
 \begin{description}[style=nextline]
+	\item[ver. 2.01y (2020.8.31)]
+		Package option $hyperref$ added.
 	\item[ver. 2.00 (2020.7.14)] 
 		Package renamed as \pkgname{edichokey}. \\
 		Documentation in English finished. \\

Modified: trunk/Master/texmf-dist/doc/latex/edichokey/edichokey-ex.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/edichokey/edichokey-ex.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/edichokey/edichokey-ex.tex	2020-08-31 21:18:15 UTC (rev 56222)
+++ trunk/Master/texmf-dist/doc/latex/edichokey/edichokey-ex.tex	2020-08-31 21:18:29 UTC (rev 56223)
@@ -34,7 +34,7 @@
 \documentclass[a4paper]{article}
 
 \usepackage[margin=25mm]{geometry}
-\usepackage{edichokey}
+\usepackage[hyperref]{edichokey}
 
 \def\var{\textup{var.} }
 \frenchspacing

Modified: trunk/Master/texmf-dist/tex/latex/edichokey/edichokey.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/edichokey/edichokey.sty	2020-08-31 21:18:15 UTC (rev 56222)
+++ trunk/Master/texmf-dist/tex/latex/edichokey/edichokey.sty	2020-08-31 21:18:29 UTC (rev 56223)
@@ -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 at get@array#1{\csname edk at array@#1\endcsname}
 \def\edk at set@array#1#2{\expandafter\xdef\csname edk at array@#1\endcsname{#2}}
 \newif\if at edk@named@
+\newif\if at edk@hyperref@\@edk at hyperref@false
+\DeclareOption{hyperref}{\@edk at hyperref@true}
+\ProcessOptions
+\RequirePackage{hyperref}
 \newdimen\alterindent\alterindent1.2em
 \newdimen\taxonrightskip\taxonrightskip2em
 \newdimen\edk at leftskip
 \newbox\edk at header
+\newcount\edk at key
 \newcount\edk at depth
 \newcount\edk at couplet
 \def\edknamestyle{\bfseries\itshape}
@@ -50,8 +55,12 @@
 \def\dot at line{%
   \unskip\dot at fill{0pt plus 1fil}\penalty150%
   \null\nobreak\dot at fill{12pt plus 1fill}}
-\newenvironment{Key}
-  {\edk at depth\z@
+\newenvironment{Key}{%
+  \global\advance\edk at key\@ne
+  \if at edk@hyperref@
+	\hypersetup{hidelinks=true}%
+  \fi
+  \edk at depth\z@
   \edk at couplet\z@
   \parindent\z@
   \advance\rightskip\taxonrightskip
@@ -82,8 +91,17 @@
     \xdef\edk at number{\the\edk at couplet}%
     \edk at set@array{\the\edk at depth}{\the\edk at couplet}%
   \fi
+  \if at edk@hyperref@
+    \def\edk at hyp@prefix{edichokey:\the\edk at key:\edk at number:}
+    \edef\edk at hyp@this{\edk at hyp@prefix\if at edk@named@ b\else a\fi}%
+    \edef\edk at hyp@that{\edk at hyp@prefix\if at edk@named@ a\else b\fi}%
+	\def\edk at hyp@make##1{%
+      \phantomsection\label{\edk at hyp@this}\hyperref[\edk at hyp@that]{##1}}%
+  \else
+    \def\edk at hyp@make##1{##1}%
+  \fi
   \@edk at named@false
   \sbox\edk at header{\edk at number.~}%
   \leftskip\dimexpr\edk at leftskip+\edk at depth\alterindent+\wd\edk at header\relax
-  \indent\llap{\box\edk at header}}  
+  \indent\edk at hyp@make{\llap{\box\edk at header}}}
 \makeatother



More information about the tex-live-commits mailing list.