summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/edichokey
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/edichokey')
-rw-r--r--macros/latex/contrib/edichokey/edichokey-doc-en.pdfbin63825 -> 65165 bytes
-rw-r--r--macros/latex/contrib/edichokey/edichokey-doc-en.tex12
-rw-r--r--macros/latex/contrib/edichokey/edichokey-ex.pdfbin54358 -> 66474 bytes
-rw-r--r--macros/latex/contrib/edichokey/edichokey-ex.tex2
-rw-r--r--macros/latex/contrib/edichokey/edichokey.sty26
5 files changed, 31 insertions, 9 deletions
diff --git a/macros/latex/contrib/edichokey/edichokey-doc-en.pdf b/macros/latex/contrib/edichokey/edichokey-doc-en.pdf
index a5c89f264d..61f6e26e19 100644
--- a/macros/latex/contrib/edichokey/edichokey-doc-en.pdf
+++ b/macros/latex/contrib/edichokey/edichokey-doc-en.pdf
Binary files differ
diff --git a/macros/latex/contrib/edichokey/edichokey-doc-en.tex b/macros/latex/contrib/edichokey/edichokey-doc-en.tex
index 211fbbeb26..c10b961d2d 100644
--- a/macros/latex/contrib/edichokey/edichokey-doc-en.tex
+++ b/macros/latex/contrib/edichokey/edichokey-doc-en.tex
@@ -51,8 +51,8 @@
\ for dichotomous identification keys}
\author{\zh{杨宇昌} (Yuchang \textsc{Yang})%
\footnote{Email address: \url{yang.yc.allium@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 @@ Here a simple demo is presented, showing how to use the package \pkgname{edichok
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 @@ Apart from the modification on the algorithm, \pkgname{edichokey} behaves differ
\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. \\
diff --git a/macros/latex/contrib/edichokey/edichokey-ex.pdf b/macros/latex/contrib/edichokey/edichokey-ex.pdf
index 9711e1c6df..be47d32cb5 100644
--- a/macros/latex/contrib/edichokey/edichokey-ex.pdf
+++ b/macros/latex/contrib/edichokey/edichokey-ex.pdf
Binary files differ
diff --git a/macros/latex/contrib/edichokey/edichokey-ex.tex b/macros/latex/contrib/edichokey/edichokey-ex.tex
index 25d0c8b51e..0e70f152f1 100644
--- a/macros/latex/contrib/edichokey/edichokey-ex.tex
+++ b/macros/latex/contrib/edichokey/edichokey-ex.tex
@@ -34,7 +34,7 @@
\documentclass[a4paper]{article}
\usepackage[margin=25mm]{geometry}
-\usepackage{edichokey}
+\usepackage[hyperref]{edichokey}
\def\var{\textup{var.} }
\frenchspacing
diff --git a/macros/latex/contrib/edichokey/edichokey.sty b/macros/latex/contrib/edichokey/edichokey.sty
index 1b927eadaf..c4dee913c4 100644
--- a/macros/latex/contrib/edichokey/edichokey.sty
+++ b/macros/latex/contrib/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