summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-08-31 21:18:29 +0000
committerKarl Berry <karl@freefriends.org>2020-08-31 21:18:29 +0000
commitd9a65ab9d3bde4e1c3e155852f7461948a9f8760 (patch)
treea310ed1fdedb43fadb386f557886e83a24e38af0
parentadc5ac972bc69b621e9d91ffa2ee650b9b95b669 (diff)
edichokey (31aug20)
git-svn-id: svn://tug.org/texlive/trunk@56223 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/edichokey/edichokey-doc-en.pdfbin63825 -> 65165 bytes
-rw-r--r--Master/texmf-dist/doc/latex/edichokey/edichokey-doc-en.tex12
-rw-r--r--Master/texmf-dist/doc/latex/edichokey/edichokey-ex.pdfbin54358 -> 66474 bytes
-rw-r--r--Master/texmf-dist/doc/latex/edichokey/edichokey-ex.tex2
-rw-r--r--Master/texmf-dist/tex/latex/edichokey/edichokey.sty26
5 files changed, 31 insertions, 9 deletions
diff --git a/Master/texmf-dist/doc/latex/edichokey/edichokey-doc-en.pdf b/Master/texmf-dist/doc/latex/edichokey/edichokey-doc-en.pdf
index a5c89f264d2..61f6e26e195 100644
--- a/Master/texmf-dist/doc/latex/edichokey/edichokey-doc-en.pdf
+++ b/Master/texmf-dist/doc/latex/edichokey/edichokey-doc-en.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/edichokey/edichokey-doc-en.tex b/Master/texmf-dist/doc/latex/edichokey/edichokey-doc-en.tex
index 211fbbeb267..c10b961d2da 100644
--- a/Master/texmf-dist/doc/latex/edichokey/edichokey-doc-en.tex
+++ b/Master/texmf-dist/doc/latex/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/Master/texmf-dist/doc/latex/edichokey/edichokey-ex.pdf b/Master/texmf-dist/doc/latex/edichokey/edichokey-ex.pdf
index 9711e1c6df4..be47d32cb55 100644
--- a/Master/texmf-dist/doc/latex/edichokey/edichokey-ex.pdf
+++ b/Master/texmf-dist/doc/latex/edichokey/edichokey-ex.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/edichokey/edichokey-ex.tex b/Master/texmf-dist/doc/latex/edichokey/edichokey-ex.tex
index 25d0c8b51ed..0e70f152f1e 100644
--- a/Master/texmf-dist/doc/latex/edichokey/edichokey-ex.tex
+++ b/Master/texmf-dist/doc/latex/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/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