summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/xelatex/nanicolle
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-10-01 16:39:42 +0000
committerKarl Berry <karl@freefriends.org>2019-10-01 16:39:42 +0000
commit42096a6db82c3181bbe2986561e0e370ab21eae6 (patch)
tree5c01daf80922f04e4043a425aa5a28de3c7adda9 /Master/texmf-dist/tex/xelatex/nanicolle
parentd075af77cf425339a2011762b0dd13aae07099f4 (diff)
nanicolle
git-svn-id: svn://tug.org/texlive/trunk@52237 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/xelatex/nanicolle')
-rw-r--r--Master/texmf-dist/tex/xelatex/nanicolle/nanicolle.cls280
1 files changed, 134 insertions, 146 deletions
diff --git a/Master/texmf-dist/tex/xelatex/nanicolle/nanicolle.cls b/Master/texmf-dist/tex/xelatex/nanicolle/nanicolle.cls
index 2f3d72bff49..76f4cddc7c9 100644
--- a/Master/texmf-dist/tex/xelatex/nanicolle/nanicolle.cls
+++ b/Master/texmf-dist/tex/xelatex/nanicolle/nanicolle.cls
@@ -20,7 +20,7 @@
% - the example files: [nanicolle-example.tex, nanicolle-example.pdf].
%%
\NeedsTeXFormat{LaTeX2e}
-\ProvidesClass{nanicolle}[2019/04/28 v2.00 class nanicolle]
+\ProvidesClass{nanicolle}[2019/09/27 v2.01 class nanicolle]
% CATCODE PART I
\makeatletter
% CLASS OPTIONS
@@ -57,7 +57,6 @@
\def\@unit{pt}
\def\vb@xt@{\vbox to}
% CATCODE PART II
-\catcode`\^^@\@other
% CONDITIONS
\newif\if@param@enough@
\newif\if@drew@map@
@@ -100,6 +99,32 @@
\newbox\pin@point
\setbox\pin@point=\vb@xt@\z@{\vss\hb@xt@\z@{%
\hss\includegraphics{point.pdf}\hss}\vss}
+% 20190926
+\newdimen\whiterule
+\newdimen\whitevsep
+\newdimen\whitehsep
+\whiterule=1.5pt
+\whitevsep=0.7pt
+\whitehsep=0.3pt
+\def\white@uline#1{%
+ \setbox\@tempboxa\hbox{\bfseries#1}%
+ \@tempdima\dimexpr\whiterule+%
+ \whitevsep+\dp\@tempboxa\relax
+ \leavevmode\allowbreak\hbox{%
+ \kern-\whitehsep
+ \lower\@tempdima\vbox{%
+ \hbox{%
+ \kern\whitehsep
+ \box\@tempboxa
+ \kern\whitehsep}%
+ \vskip\whitevsep
+ {\color{white}\hrule\@height\whiterule}}%
+ \kern-\whitehsep}}
+\long\def\lines@box#1{%
+ \setbox\@tempboxa=\vbox{#1\par}%
+ \vbox to \ht\@tempboxa{\leaders\hb@xt@\hsize{%
+ \kern1em\uline{\strut\hfill}}\vfill
+ \kern-1em}\vskip-\ht\@tempboxa\box\@tempboxa\par}
% UNIT EXPRESSIONS
\def\degree{\ensuremath{^\circ}}
\def\gobble@char#1{\relax}
@@ -120,116 +145,95 @@
\def\plus@one@cm#1{\plus@one@second{#1}{cm}}
\def\plus@one@m#1{\plus@one@second{#1}{m}}
% PARSING
-\RequirePackage{calc}
+% LATIN PARSING
+\def\inter@taxon@skip{ \hskip .1667em minus .1667em\relax}
+\def\upd@shape{%
+ \advance\word@cnt-\@ne
+ \ifcase\word@cnt
+ \upshape
+ \unskip\penalty-\f@ur
+ \inter@taxon@skip
+ \or
+ \itshape
+ \fi\ignorespaces}
+\RequirePackage{xstring}
+\def\strsubs#1#2{%
+ \StrSubstitute{\@tempstring}{#1}{#2}[\@tempstring]\ignorespaces}
+\def\handle@f{\textup{f.}\unless\ifnum\word@cnt<0\word@cnt\tw@\fi}
+\def\latin@parse#1{%
+ \word@cnt\tw@
+ \edef\@tempstring{#1}%
+ \expandarg
+ \strsubs{ '}{ \upshape`}
+ \strsubs{ }{ \upd@shape}%
+ \strsubs{subsp.}{\textup{subsp.}\word@cnt\tw@}
+ \strsubs{var.}{\textup{var.}\word@cnt\tw@}
+ \strsubs{f.}{\handle@f}
+ \strsubs{sp.}{\upshape sp.\word@cnt\z@}
+ \strsubs{cf.}{\textup{cf.}\word@cnt\tw@}
+ \strsubs{aff.}{\textup{aff.}\word@cnt\tw@}
+ \strsubs{et}{\penalty-\@ne et\penalty-\@ne}
+ \strsubs{ex}{\penalty-\tw@ et\penalty-\tw@}
+ \strsubs{(}{\penalty-\thr@@(}\strsubs{)}{)\penalty-\thr@@}
+ \strsubs{×}{\ensuremath{\mathsf{\times}}\word@cnt\@ne\ignorespaces}
+ {\itshape\@tempstring}}
+\def\col@latin#1{%
+ \raggedright
+ \hangindent=4em
+ \latin@parse{#1}}
+\def\det@latin#1{%
+ \latin@parse{#1}}
\RequirePackage{listofitems}
\reademptyitems
+ \catcode`\^^I\@other
+ \setsepchar{^^I}
\def\get@argin#1{%
\ifnum#1>\temp@arginlen\relax
\else\temp@argin[#1]\fi}
\def\col@parse@params#1{%
- \edef\temp@list{#1}
- \setsepchar{^^@}
- \readlist\temp@argin{\temp@list}
+ \readlist\temp@argin{#1}
\@param@enough@true
- \edef\RecordNo{\get@argin{2}}
- \edef\Collector{\get@argin{3}}
- \edef\CollectionNo{\get@argin{4}}
- \edef\DateCollection{\get@argin{5}}
- \edef\Family{\get@argin{6}}
- \edef\ChineseName{\get@argin{7}}
- \edef\ScientificName{\get@argin{8}}
- \edef\PhotoNo{\get@argin{9}}
- \edef\NoDuplication{\get@argin{10}}
- \edef\Location{\get@argin{11}}
- \edef\Longitude{\get@argin{12}}
- \edef\Latitude{\get@argin{13}}
- \edef\Altitude{\get@argin{14}}
- \edef\Habitat{\get@argin{15}}
- \edef\LifeForm{\get@argin{16}}
- \edef\Height{\get@argin{17}}
- \edef\DBH{\get@argin{18}}
- \edef\Description{\get@argin{19}}
+ \def\RecNum{\get@argin{2}}
+ \def\Collector{\get@argin{3}}
+ \def\ColNum{\get@argin{4}}
+ \def\ColDate{\get@argin{5}}
+ \def\Family{\get@argin{6}}
+ \def\ChnName{\get@argin{7}}
+ \edef\LatName{\get@argin{8}}
+ \def\PhotoNum{\get@argin{9}}
+ \def\NumDup{\get@argin{10}}
+ \def\Location{\get@argin{11}}
+ \def\Longitude{\get@argin{12}}
+ \def\Latitude{\get@argin{13}}
+ \def\Altitude{\get@argin{14}}
+ \def\Habitat{\get@argin{15}}
+ \def\LifeForm{\get@argin{16}}
+ \def\Height{\get@argin{17}}
+ \def\DBH{\get@argin{18}}
+ \def\Descr{\get@argin{19}}
\repeat@cnt\@ne
- \if@auto@duplicate\if\relax\NoDuplication\relax\else
- \repeat@cnt\NoDuplication\relax
+ \if@auto@duplicate\if\relax\NumDup\relax\else
+ \repeat@cnt\NumDup\relax
\fi\fi
\if\relax\Collector\relax\@param@enough@false\fi
- \if\relax\DateCollection\relax\@param@enough@false\fi
+ \if\relax\ColDate\relax\@param@enough@false\fi
\if\relax\Location\relax\@param@enough@false\fi
}
\def\det@parse@params#1{%
- \edef\temp@list{#1}
- \setsepchar{^^@}
- \readlist\temp@argin{\temp@list}
+ \readlist\temp@argin{#1}
\@param@enough@true
- \edef\RecordNo{\get@argin{2}}
- \edef\ScientificName{\get@argin{3}}
- \edef\ChineseName{\get@argin{4}}
- \edef\Identifier{\get@argin{5}}
- \edef\IdentifierStd{\get@argin{6}}
- \edef\DateIdentification{\get@argin{7}}
- \edef\Remark{\get@argin{8}}
- \edef\temp@name{\Identifier\IdentifierStd}
- \if\relax\ScientificName\relax\@param@enough@false\fi
+ \def\RecNum{\get@argin{2}}
+ \def\LatName{\get@argin{3}}
+ \def\ChnName{\get@argin{4}}
+ \def\Identifier{\get@argin{5}}
+ \def\IdentifierStd{\get@argin{6}}
+ \def\DateIdentification{\get@argin{7}}
+ \def\Remark{\get@argin{8}}
+ \def\temp@name{\Identifier\IdentifierStd}
+ \if\relax\LatName\relax\@param@enough@false\fi
\if\relax\temp@name\relax\@param@enough@false\fi
\if\relax\DateIdentification\relax\@param@enough@false\fi
}
-% LATIN PARSING
-\def\col@latin@break{\hfill\penalty-\@ne
- \hskip -3em plus -1fill\relax\hbox{}\hskip3em\relax}
-\def\col@latin@prefix{=-=}
-\def\col@latin@mark#1#2{%
- \expandafter\gdef\csname\col@latin@prefix#1\endcsname{#2}}
- \col@latin@mark{subsp.}{\col@latin@break{\upshape subsp\@.}\itshape\space}
- \col@latin@mark{var.}{\col@latin@break{\upshape var\@.}\itshape\space}
- \col@latin@mark{f.}{\col@latin@break{\upshape f\@.}\itshape\space}
- \col@latin@mark{cf.}{{\upshape cf\@.}\space}
- \col@latin@mark{aff.}{{\upshape aff\@.}\space}
- \col@latin@mark{sp.}{\upshape sp\@.\space}
- \col@latin@mark{@bquote}{\upshape\string`}
- \col@latin@mark{@equote}{\unskip\string'}
- \col@latin@mark{@times}{\ensuremath{\times}}
- \col@latin@mark{@end}{\global\let\@iterator\relax}
-\def\col@latin#1{%
- \itshape
- \gdef\@iterator##1 {%
- \@ifundefined{\col@latin@prefix##1}%
- {##1\space}%
- {\csname\col@latin@prefix##1\endcsname}%
- \@iterator}%
- \@iterator#1 @end
-}
-\def\inter@taxon@skip{\hskip .1667em minus .1667em\relax}
-\def\det@latin@prefix{^_^}
-\def\det@latin@mark#1#2{%
- \expandafter\gdef\csname\det@latin@prefix#1\endcsname{#2}}
- \det@latin@mark{subsp.}{{\upshape subsp\@.}\word@cnt\tw@\space}
- \det@latin@mark{var.}{{\upshape var\@.}\word@cnt\tw@\space}
- \det@latin@mark{f.}{{\upshape f\@.}\advance\word@cnt\tw@\space}
- \det@latin@mark{cf.}{{\upshape cf\@.}\word@cnt\tw@\space}
- \det@latin@mark{aff.}{{\upshape aff\@.}\word@cnt\tw@\space}
- \det@latin@mark{sp.}{\upshape sp\@.\word@cnt\z@\space}
- \det@latin@mark{@bquote}{\upshape\string`}
- \det@latin@mark{@equote}{\unskip\string'}
- \det@latin@mark{@times}{\ensuremath{\mathsf\times}\advance\word@cnt\@ne}
- \det@latin@mark{et}{\penalty-\@ne et\penalty-\@ne\space}
- \det@latin@mark{ex}{\penalty-\tw@ et\penalty-\tw@\space}
- \det@latin@mark{@lparen}{\penalty-\thr@@\lparen}
- \det@latin@mark{@rparen}{\unskip\rparen\penalty-\thr@@}
- \det@latin@mark{@end}{\global\let\@iterator\relax}
-\def\det@latin#1{%
- \itshape
- \word@cnt\tw@
- \leavevmode
- \gdef\@iterator##1 {%
- \@ifundefined{\det@latin@prefix##1}%
- {##1\space}%
- {\csname\det@latin@prefix##1\endcsname}%
- \advance\word@cnt-\@ne
- \ifcase\word@cnt\penalty-\f@ur\upshape\inter@taxon@skip\or\itshape\fi
- \@iterator}%
- \@iterator#1 @end
-}
% FONT STYLE
\def\headerstyle{\bfseries}
\def\headingstyle{\scshape}
@@ -268,21 +272,23 @@
\nointerlineskip
\centerline{\hss\rule{.25\paperwidth}{\NC@seprule}\hss}}
% COMPONENTS OF COLLECTION LABELS
+\RequirePackage{color}
\def\form@line#1#2{%
\par\hangindent=1em%
\leavevmode
- \setbox\header@box=\hbox{\headerstyle#1}%
+ \setbox\header@box=\hbox{\headerstyle\white@uline{#1}}%
\setbox\temp@box=\hbox{\copy\header@box\quad#2}%
\def\glue@begin{\quad\hfill}%
\def\glue@end{\hfill\hfill\hbox{}}%
\ifdim\wd\temp@box>\linewidth
- \def\glue@begin{\CJKglue\quad\CJKglue}\fi
+ \def\glue@begin{\CJKglue\quad\CJKglue}%
+ \def\glue@end{}\fi
\box\header@box
- \uline{\glue@begin#2\glue@end}\par}
+ \glue@begin#2\glue@end\par}
\def\form@cell#1#2{%
\leavevmode
- \hbox{\headerstyle#1}\nobreak
- \uline{\;\hfill#2\hfill\;}\hbox{}\penalty-1\relax}
+ \hbox{\headerstyle\white@uline{#1}}\nobreak
+ \;\hfill#2\hfill\;\hbox{}\penalty-1\relax\ignorespaces}
\def\heading@line#1{%
\setbox\temp@box=\hbox{#1}%
\ifdim\wd\temp@box>\linewidth
@@ -313,39 +319,41 @@
\fi
\fi}
\def\printform{%
- \form@line{采集人}{\Collector}%
- \form@cell{采集号}{\CollectionNo}%
- \if@internal\form@cell{照片号}{\PhotoNo}\par\fi
- \form@cell{采集日期}{\DateCollection}%
- \if@internal\form@cell{标本份数}{\NoDuplication}\fi\par
- \form@line{产地}{\Location}%
- \form@cell{经度}{\plus@one@long\Longitude}%
- \form@cell{纬度}{\plus@one@lat\Latitude}\par
- \form@cell{海拔}{\plus@one@m\Altitude}%
- \form@cell{生境}{\Habitat}\par
- \form@cell{生活型}{\LifeForm}\penalty-2\relax%
- \form@cell{体高}{\plus@one@m\Height}%
- \form@cell{胸径}{\plus@one@cm\DBH}\par
- \form@cell{科名}{\Family}%
- \form@cell{中文名}{\ChineseName}\par
- \form@line{学名}{\expandafter\col@latin\expandafter{\ScientificName}}
- \form@line{附注}{\Description}
+ \lines@box{%
+ \form@line{采集人}{\Collector}%
+ \form@cell{采集号}{\ColNum}%
+ \if@internal\form@cell{照片号}{\PhotoNum}\par\fi
+ \form@cell{采集日期}{\ColDate}%
+ \if@internal\form@cell{标本份数}{\NumDup}\fi\par
+ \form@line{产地}{\Location}%
+ \form@cell{经度}{\plus@one@long\Longitude}%
+ \form@cell{纬度}{\plus@one@lat\Latitude}\par
+ \form@cell{海拔}{\plus@one@m\Altitude}%
+ \form@cell{生境}{\Habitat}\par
+ \form@cell{生活型}{\LifeForm}\penalty-2\relax%
+ \form@cell{体高}{\plus@one@m\Height}%
+ \form@cell{胸径}{\plus@one@cm\DBH}\par
+ \form@cell{科名}{\Family}%
+ \form@cell{中文名}{\ChnName}\par
+ \form@line{学名}{\col@latin{\LatName}}
+ \form@line{附注}{\Descr}}
\nointerlineskip}
\if@col@barcode
\RequirePackage[code=Code39,X=.5mm,H=4mm]{makebarcode}
\fi
\def\printbarcode{%
\let\if@barcodeprepared@\if@col@barcode
- \if\relax\RecordNo\relax\@barcodeprepared@false\fi
+ \if\relax\RecNum\relax\@barcodeprepared@false\fi
\if\relax\@herbariumcode\relax\@barcodeprepared@false\fi
\if@barcodeprepared@
\vskip6.6pt\relax
- \resizebox{\columnwidth}{4mm}{\barcode{\@herbariumcode-\RecordNo}}\par
+ \resizebox{\columnwidth}{4mm}{\barcode{\@herbariumcode-\RecNum}}\par
\nointerlineskip\vskip13.9pt\relax
\else
\vskip\NC@margin
\fi
\cutting@line}
+\RequirePackage{calc}
\def\makemap#1{%
\unless\if@drew@map@
\if\relax\Longitude\relax\else
@@ -396,11 +404,11 @@
\fi
\def\printqrcode{%
\let\if@barcodeprepared@\if@det@barcode
- \if\relax\RecordNo\relax\@barcodeprepared@false\fi
+ \if\relax\RecNum\relax\@barcodeprepared@false\fi
\if\relax\@herbariumcode\relax\@barcodeprepared@false\fi
\if@barcodeprepared@
- \vb@xt@\z@{\vss\hbox{\qrcode[height=1cm]{\@herbariumcode.\RecordNo}}\kern-5pt}\fi}
-\def\identifier@skip{\hskip12mm minus 12mm}
+ \vb@xt@\z@{\vss\hbox{\qrcode[height=1cm]{\@herbariumcode.\RecNum}}\kern-5pt}\fi}
+\def\identifier@skip{\hskip 12mm minus 12mm}
\def\@Identify#1{%
\@identifying@true
\det@parse@params{#1}%
@@ -410,8 +418,8 @@
\vskip\NC@margin
\begingroup
\centering
- {\detlatinstyle\expandafter\det@latin\expandafter{\ScientificName}\par}%
- {\detchinesestyle\leavevmode\ChineseName\par}%
+ {\detlatinstyle\expandafter\det@latin\expandafter{\LatName}\par}%
+ {\detchinesestyle\leavevmode\ChnName\par}%
\endgroup
\vskip7pt\relax
\hb@xt@\linewidth{%
@@ -431,31 +439,11 @@
\@identifying@false}
\def@to@eol\Identify\@Identify
% CATCODES PART III
-\def\markdown{\catcode`\*\active\catcode`\'\active}
-\def\endmarkdown{\catcode`\*\@other\catcode`\'\@other}
-\markdown
-\def*#1*{{\noexpand\noexpand\noexpand\itshape#1}}
-\def'#1'{@bquote #1 @equote }
-\endmarkdown
-\catcode`\×\active
- \def×{@times }
\catcode`\&\active
\def&{et}
-\let\lparen(%)
-\let\rparen)%(
-\catcode`\(\active%\)
-\def(#1){%
- \if@identifying@
- @lparen\space #1 @rparen\space
- \else
- \lparen#1\rparen
- \fi}
-\catcode`\^^@\@other
-\catcode`\^^I\active
- \def^^I{^^@}
\makeatother
% HOOKS
-\AtBeginDocument{\begin{multicols*}{4}\markdown}
-\AtEndDocument{\endmarkdown\end{multicols*}}
+\AtBeginDocument{\begin{multicols*}{4}}
+\AtEndDocument{\end{multicols*}}
\endinput
% END OF FILE nanicolle.cls