% Author: Alexey Shipunov, dactylorhiza@gmail.com

\ProvidesPackage{biolist}%
        [2008/02/06 v0.1 Typesetting species lists for floras (and faunas)]

\newcounter{SEMEYSTVO}[subsection]
\newcounter{VID}[subsection]
\newcounter{SEMVID}[SEMEYSTVO]
\newcount\DOUBLE
\DOUBLE=1

% Species names
\def\VDVID{\ifnum\DOUBLE=0
	\arabic{VID}.%
        \else
        \arabic{SEMVID}(\arabic{VID}).%
        \fi}

\def\VID{\@ifnextchar*\VID@@{\VID@}}
% \VID
\def\VID@#1 #2 #3{\addtocounter{VID}{1}\addtocounter{SEMVID}{1}%
        \hangindent=3.5em\noindent%
        \makebox[3.3em][r]{\VDVID}\hskip.2em%
\textit{#1 #2} #3}
% \VID* for cultivated species
% objazatelen probel posle komandy!
\def\VID@@* #1 #2 #3{\hangindent=3.5em\noindent%
        \makebox[3.3em][r]{$*$\hskip.2em}\hskip.2em%
\textit{#1 #2} #3}

% Comment for species. No paragraph before!
\def\VKOMM#1\par{\par\nopagebreak%
        \parindent=3.5em\hangindent=\parindent%
        \samepage%
	{\footnotesize#1\par}}
\let\VK\VKOMM

% Names for families (or other higher rank taxa)
\def\SEM{\@ifstar{\SEM@@}{\SEM@}}
% \SEM
\def\SEM@#1{\medskip
        \stepcounter{SEMEYSTVO}
        \parindent=2em\hangindent=2em
        {\bfseries\Roman{SEMEYSTVO}. }%
\textbf{#1}\nopagebreak%
\smallskip}
% \SEM* for families consist enrirely of cultivated species
\def\SEM@@#1{\medskip
        \parindent=2em\hangindent=2em
        \textbf{$*$ #1}\nopagebreak%
\smallskip}
