%%%%%
%%
%% oonumbib.sty -- example oobib style file modeled after the unsrt BibTeX
%%                 style
%%%%%

\def\@indval{\MYindex}
\DeclareOption{biborder}{\def\@indval{\ref{@oobib:\MYindex}}}

\DeclareOption*{%
  \PassOptionsToPackage{\CurrentOption}{oobib}%
}

\ProcessOptions

\RequirePackage{oobib}

\renewcommand\@pform[1]{%
  [\@indval]}
\renewcommand\@tform[1]{%
  \@firstetal~[\@indval]}

\renewcommand\@bibname{References}

\PRESETS{Book}{
 \sd\MYbibmap{%
  [\@indval]\ %
  \@Listnames{\MYauthors}\@.%
  \ifnotempty{\MYtitle}{ \emph{\MYtitle}.}%
  \ifnotempty{\MYpublisher}{%
    \ifnotempty{\MYcity}{  \MYcity:} %
    \MYpublisher\ifnotemptyelse{\MYyear}{,}{.}%
  }%
  \ifnotempty{\MYyear}{ \MYyear.}%
 }
}
\PRESETS{Chapter}{%
 \sd\MYbibmap{%
  [\@indval]\ %
  \@Listnames{\MYauthors{}}.%
  \ifnotempty{\MYtitle}{  ``\MYtitle{}''.}%
  \ifnotempty{\MYbook}{  \emph{\MYbook{}}.}%
  \ifnotempty{\MYeditors}{ Ed.\ \@listnames{\MYeditors{}}.}%
  \ifnotempty{\MYpublisher}{%
    \ifnotempty{\MYcity}{  \MYcity{}:} %
    \MYpublisher{}\ifnotemptyelse{\MYyear{}}{,}{.}%
  }%
  \ifnotempty{\MYyear}{ \MYyear{}.}%
  \ifnotempty{\MYpages}{ pp.\ \MYpages{}.}%
 }
}
\PRESETS{Article}{%
 \sd\MYbibmap{%
  [\@indval]\ %
  \@Listnames{\MYauthors}.%
  \ifnotempty{\MYtitle}{  ``\MYtitle''.}%
  \ifnotempty{\MYjournal}{  \emph{\MYjournal}.}%
  \ifnotempty{\MYvolume\MYnumber\MYissue\MYyear}{%
  \ifnotempty{\MYvolume}{ Volume \MYvolume%
    \ifnotempty{\MYnumber\MYissue}{,}}%
  \ifnotempty{\MYnumber}{ Number \MYnumber
    \ifnotempty{\MYissue}{,}}%
  \ifnotempty{\MYissue}{ Issue \MYissue}%
  \ifnotempty{\MYyear}{ (%
    \ifnotempty{\MYmonth}{\MYmonth, }%
    \MYyear)}%
  .%
  }%
  \ifnotempty{\MYpages}{ pp.\ \MYpages{}.}%
 }
}