% \iffalse
% $Id: nmbib.dtx,v 1.21 2015/07/27 20:22:45 boris Exp $
%
%% Copyright 2015-2024, Michael Cohen <mcohen@u-aizu.ac.jp>
%% and Boris Veytsman <borisv@lk.net>
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
%% version 1.3 of this license or (at your option) any 
%% later version.
%% The latest version of the license is in
%%    http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of
%% LaTeX version 2003/06/01 or later.
%%
%% This work has the LPPL maintenance status `maintained'.
%%
%% The Current Maintainer of this work is Boris Veytsman
%%
%<*gobble> 
% \fi
% \CheckSum{978}
%
%
%% \CharacterTable
%%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%%   Digits        \0\1\2\3\4\5\6\7\8\9
%%   Exclamation   \!     Double quote  \"     Hash (number) \#
%%   Dollar        \$     Percent       \%     Ampersand     \&
%%   Acute accent  \'     Left paren    \(     Right paren   \)
%%   Asterisk      \*     Plus          \+     Comma         \,
%%   Minus         \-     Point         \.     Solidus       \/
%%   Colon         \:     Semicolon     \;     Less than     \<
%%   Equals        \=     Greater than  \>     Question mark \?
%%   Commercial at \@     Left bracket  \[     Backslash     \\
%%   Right bracket \]     Circumflex    \^     Underscore    \_
%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%%   Right brace   \}     Tilde         \~} 
%
%\iffalse
%    \begin{macrocode}
\documentclass{ltxdoc}
\usepackage{hypdoc}
\usepackage{nmbib}
\let\cite\citep
\PageIndex
\CodelineIndex
\RecordChanges
\EnableCrossrefs
\begin{document}
  \DocInput{nmbib.dtx}
\end{document}
%    \end{macrocode}
%</gobble> 
% \fi
% \MakeShortVerb{|}
% \GetFileInfo{nmbib.sty}
% 
% \changes{v1.00}{2014/01/23}{Preliminary release}
% \changes{v1.03}{2015/07/25}{Added day field in the chrono bst}
% 
% \title{New Multibibliography Package\thanks{\copyright 2015--2024 Michael
% Cohen and Boris Veytsman}} 
% \author{Boris Veytsman\thanks{borisv@lk.net}
%   \and Michael Cohen\thanks{mcohen@u-aizu.ac.jp}}
% \date{\filedate, \fileversion}
% \maketitle
%
% \begin{abstract}
%   The |nmbib| package is a rewrite of |multibiliography| package
%   providing multiple bibliographies with different sorting.  The new
%   version offers a number of citation commands, streamlines the
%   creation of bibliographies, ensures compatibility with the
%   |natbib| package, and provides other improvements.
% \end{abstract}
%
% \tableofcontents
%
% \clearpage
%
%\section{Introduction}
%\label{sec:intro}
%
% The list of cited works accompanying a scholarly work is not just
% a technical appendix or a subtle way to avoid accusations of
% plagiarism.  Rather, it is an organic part of the work, telling the
% user a story about the field of study and showing why the given
% work is an organic part of it.  There are several ways to tell the
% story, and accordingly there are several ways to organize the list
% of references.  One can tell it accordingly to logical
% development of ideas, so the order of citations follows the order
% they are mentioned in the paper.  This leads to the ``unsorted''
% style of references, usual in physics and mathematics papers and books.
% Alternatively, one can choose to tell the story as the story of
% people behind the ideas, ordering the citations alphabetically by
% author names.  This is the order used in humanities and other fields.
% Yet another possibility is to tell the story in the chronological
% order.  The chronological order of citations is not widely used,
% with the important exception of resumes and CVs, but it has its own
% advantages.  
%
% In the times BC (Before Computers), difficulties in manual creation
% of reference lists discouraged presentation of more than one such
% list.  Now we can easily have as many lists as we want.  Accordingly
% we can have not one, but several lists of references, each telling a
% different story.  The package
% |multibibliography|~\cite{Multibibliography, Multibibliography13}
% provided just this: multiple bibliographies with the same references arranged
% in different orders, with hyperlinks between entries.  However, this
% package had various limitations, including: the fixed format of
% typesetting citations in text, the limitation on the possible
% Bib\TeX\ styles.  Also, it requires post-processing by a Perl
% script.
%
% This package tries to lift these limitations.  It provides the
% following improvements over the original |multibiliography|:
% \begin{enumerate}
% \item A Perl postprocessing is no longer needed:  all processing is done
% by Bib\TeX.
% \item The user can work with familiar |natbib|~\cite{Daly:Natbib}
%   commands \cs{citep}, \cs{citet}, \cs{citeauthor}, \cs{citeyear},
%   \cs{citenum}. 
% \item Any |natbib|-compatible |.bst| file can be used for formatting
% the bibliography provided that it has the right sorting of entries
% (note that the provided style gives |natbib|-compatible
% chronological ordering).
% \item The style is much more customizable than that produced by
% |multibibliography|.  
% \item Hyperlinks between the entries are improved.
% \end{enumerate}
% 
% Note about the name.  The letter \emph{n} in the package name can be
% interpreted as
% \begin{enumerate}
% \item \emph{N}ew multibibliography style, or
% \item \emph{N}atbib-compatible multibibliography style, or even
% \item \emph{N}-ordering multibibliography style, with $N$ being a
% usual mathematical moniker for ``many''.
% \end{enumerate}
% 
%
%\section{User Guide}
%\label{sec:ug}
%
%
%\subsection{Usage Summary}
%\label{sec:ug_usage}
%
% The simplest way to use the package is the following:
% \begin{enumerate}
% \item Add to the preamble of your |.tex| file
% \begin{verbatim}
% \usepackage{nmbib}
% \multibibliography{FILE1, FILE2, ...}
% \multibibliographystyle{timeline}{STYLE1}
% \multibibliographystyle{sequence}{STYLE2}
% \multibibliographystyle{authors}{STYLE3}
% \end{verbatim}
% 
% \item Use |natbib| commands such as |\cite|, |\citep|, |\citet|,
%   |\citeauthor|, |\citeyear|, and |\citenum|.  The command |\citeall|
%   creates a ``full citation'', showing the author,  year, and 
%   number of the citation.
% \item Put in your document at the places where you want the
%   bibliography the commands |\printbibliography{timeline}|,
%   |\printbibliography{sequence}|, and |\printbibliography{authors}|.
% 
% \item Run |latex| on the |tex| file.  This will create, besides the
% standard auxiliary file |FILE.aux|, three new files:
% |FILE-timeline.aux|, |FILE-sequence.aux| and |FILE-authors.aux|.
% \item Run |bibtex| on each of the three auxiliary files mentioned
%   above:
% \begin{verbatim}
% bibtex FILE-timeline
% bibtex FILE-sequence
% bibtex FILE-authors
% \end{verbatim}
% \item Run |latex| on the |tex| file at least twice (this is a
% |natbib| requirement).
% \end{enumerate}
% 
% Below we discuss these commands in more detail as well as
% customization commands.
%
%
%\subsection{Options}
%\label{sec:ug_options}
%
% The |nmbib| package internally uses |natbib| \cite{Daly:Natbib} for citation
% formatting.  The options used for |nmbib| are sent to |natbib|.
%
%\subsection{Setting up}
%\label{sec:ug_setting}
% 
% \DescribeMacro{\multibibliography}%
% The list of \BibTeX\ databases to be used for references is set by
% the command \cs{multibibliography}\marg{bibfile1, bibfile2, \dots}.
% Note that the similar command \cs{bibliography} in standard
% \LaTeX\ performs \emph{two} functions:
% it sets up the databases and prints the
% bibliography.  The command \cs{multibibliography}, on the other
% hand, performs only one function: the setting up of the databases.
% The bibliographies themselves are printed by the command
% \cs{printbibliography}, discussed below.  Therefore the \cs{multibibliography} command
% can be issued anywhere in the file, including
% the preamble. 
%
% \DescribeMacro{\multibibliographystyle}
% The standard \cs{bibliographystyle} command sets the bibliography
% style of the reference list.  Since |nmbib| generates several
% bibliographies, the corresponding command is more versatile:
% \cs{multibibliographystyle}\marg{type}\marg{style},
% where |type| is the type of the bibliography
% \begin{description}
% \item[timeline:] Chronologically ordered list.
% \item[sequence:] Sequentially ordered list.
% \item[authors:] Alphabetic list, ordered according to 
% authors' names.
% \end{description}
% and \marg{style} is the corresponding \BibTeX\ style.  The style, of
% course, must sort the entries in the proper order.
%
% The package can accommodate any |natbib| \BibTeX\ style,
% including |unsrtnat|, |plainnat|, and |abbrvnat|.  It may work with other
% styles, but success is not guaranteed.  The \BibTeX\ styles
% supplied with the package offer additional hyperlink features;  if
% you do not use |hyperref| or do not care for the links between the
% different reference lists, you probably do not need these features.  
% 
% There are three citation styles provided with the package:
% \begin{description}
% \item[chronoplainnm:] Similar to |plainnat|, but sorting
% entries in chronological order (using year, month and day if the
% latter two are available) and providing links to other lists from the
% body of the entries.
% \item[plainnm:] Similar to |plainnat|, but providing links to other
%   lists from the body of the entries.  The sorting is alphabetical
%   by authors' names, as in |plainnat|.
% \item[unsrtnm:] Similar to |unsrtnat|, but providing links to other
%   lists from the body of the entries.  The order of entries is the
%   order of citations, as in |unsrtnat|.
% \end{description}
% 
%
%\subsection{Citation commands}
%\label{sec:ug_commands}
%
% All citations commands defined in |natbib| can be used: \cs{cite},
% \cs{citenum}, \cs{citealt}, \cs{citet}, \cs{Citet}, etc.  The |nmbib| package
% adds a couple of new commands, described here.
%
% \DescribeMacro{\citealn}%
% The commands \cs{citealn}\marg{keys} is the alternative \cs{citenum}
% command:  it puts square brackets around its argument.
%
% \DescribeMacro{\citeall}%
% The command \cs{citeall}\marg{keys} produces citations with
% authors' names, years, and sequence numbers, similar to that
% produced by the \cs{cite} command in the |multibibliography| package.
% To reproduce the behavior of that package, just put in
% the preamble of your document
% \begin{verbatim}
% \let\cite\citeall
% \end{verbatim}
%
% The starred command \cs{citeall*} is similar to \cs{citeall} with
% the following difference: if \cs{citeall} prints the shortened author
% list for papers with multiple authors (``Jones et.\ al.''),
% \cs{citeall*} prints the full list (``Jones, Smith, and Brown'').   
%
%
%\subsection{Printing the bibliographies}
%\label{sec:ug_print}
%
%
% \DescribeMacro{\printbibliography}%
% The command \cs{printbibliography}\marg{type} prints the
% bibliography.  The argument is the type of bibliography---
% |timeline|, |sequence|, or |authors| (see the explanation above).
% 
%
%  You can put this command anywhere in your file;  the corresponding
%  bibliography will be printed in this place.  You can use all three
%  possible lists, any two, or even one.  The only limitation is
%  that the ``base type'' list must be included.
% (See Section~\ref{sec:ug_customization} for the discussion of base type.)
%
%
%\subsection{Hyperlinks}
%\label{sec:ug_hyperlinks}
%
% The |nmbib| package tries to fully exploit features of |hyperref| package
% \cite{Rahtz:Hyperref}.  Links from and between
% citations should work ``smartly'':  links from authors' names go
% into the alphabetic list, links from the publication years go into the
% chronological list, and links from the citation numbers go into the
% sequential list.  
%
% \DescribeMacro{\nmbibRedirectLinks}%
% Of course, the user might include only some of the three possible
% lists.  In this case some links become ``dangling.''  The command
% \cs{nmbibRedirectLinks}\penalty0\marg{source\_type}%
% \penalty0\marg{target\_type} redirects the links that otherwise go to
% the list \marg{source\_type} to the list \marg{source\_type}.  For
% example, if a chronological list is not included, the
% command |\nmbibRedirectLinks{timeline}{authors}| makes the links
% from the publication year go into the alphabetical list of
% publications.
%
% \DescribeMacro{\nmbibLink}%
% The clickable links themselves are created with the help of the
% command \cs{nmbibLink}\marg{citation}\marg{type}\marg{text}.  This
% command is available to the user, which enables constructions like
% \begin{verbatim}
% The idea was proposed by \citet{Thor10}.   Note the assumption of 
% differentiability in \nmbibLink{Thor10}{authors}{his paper}.  
% \end{verbatim}
% In this example ``his paper'' becomes a hyperlink to the paper in
% the alphabetical list.  
%
% The links created with \cs{nmbibLink} respect the redirections set
% by the command \cs{nmbibRedirectLinks}.
% 
%
%\subsection{Advanced customization}
%\label{sec:ug_customization}
%
% \DescribeMacro{\timelinerefname}%
% \DescribeMacro{\sequencerefname}%
% \DescribeMacro{\authorsrefname}%
% \DescribeMacro{\timelinebibname}%
% \DescribeMacro{\sequencebibname}%
% \DescribeMacro{\authorsbibname}%
% The commands \cs{refname} (for article-like classes) and
% \cs{bibname} (for book-like classes) retain the names of the
% bibliography.  The |nmbib| package defines three macros |\TYPErefname| and
% three commands |\TYPEbibname|, |TYPE| being |timeline|, |sequence|,
% or |authors|.  These macros can be redefined with the usual
% \cs{renewcommand}.
% For example, for a German article, one might use
% \begin{verbatim}
% \renewcommand{\timelinerefname}{Chronologische Referenzliste}
% \renewcommand{\sequencerefname}{Sequenzielle Referenzliste}
% \renewcommand{\authorsrefname}{Alphabetische Referenzliste}
% \end{verbatim}
%
% 
%
% \DescribeMacro{\multibibliographyfilename}
% By default the package creates three auxillary files with the
% following file names:  |FILE-timeline.aux|,
% |FILE-sequence.aux|, and |FILE-authors.aux|.  The command
% \cs{multibibliograpyfilename}\marg{type}\marg{name} changes this
% default.  Here \marg{type} is |timeline|, |sequence|, or |authors|, and
% \marg{name} is the file name.  The default setting is equivalent to
% \begin{verbatim}
% \multibibliograpyfilename{timeline}{\jobname-timeline}
% \multibibliograpyfilename{sequence}{\jobname-sequence}
% \multibibliograpyfilename{authors}{\jobname-authors}
% \end{verbatim}
% This command may be present only in the preamble of a document.
%
%
% 
% \DescribeMacro{\nmbibBasetype}%
% Suppose an author published several works in the same year.  They
% need to be distinguished in the text and bibliography.  In the
% standard author-year styles this is done by adding a suffix after
% the year: if we want to cite three works by A.\,U.\ Thor published
% in 2013, they are respectively cited as Thor~(2013a), Thor~(2013b), and
% Thor~(2013c).  When we have only one reference list,
% the choice of suffixes is simple: the first work becomes 2013a, the
% second 2013b, etc.  But how should we deal with the situation of
% several subbibliographies?  The order of these references in different
% lists could be different, so the same work could get different labels in
% different lists.
%
% To prevent this confusion, only one reference list is used to
% construct the labels.  We call the corresponding list type the
% \emph{base type}.  By default it is |sequence|, but this might be
% changed (and should be chaged if the user does not include
% sequential list) with the command \cs{nmbibBasetype}\marg{type}, with
% \marg{type} being |timeline|, |sequence|, or |authors|.  The list
% chosen as a base type must be included with the
% \cs{printbibliography} macro.
%
% Package |natbib| defines citation aliases:  you can use ``Paper~I''
% or ``Paper~II'' as aliases for some papers.  Normally hyperlinks
% from aliases go into the alphabetic list;  however, you can change
% it with the special type |alias| in \cs{nmbibRedirectLinks}, for
% example,
% \begin{verbatim}
% \nmbibRedirectLinks{alias}{timeline}
% \end{verbatim}
%
%
% 
% \DescribeMacro{\nmbibSetCiteall}%
% The format of the \cs{citeall} and \cs{citeall*} macros can be
% changed by the command \cs{nmbibSetCiteall}\marg{pattern}, where
% \marg{pattern} sets the citation format.  The pattern can use any
% punctuation, \cs{nmbibLink} command and the special tokens
% \cs{nmbibKEY}, \cs{nmbibNAME}, \cs{nmbibDATE} and \cs{nmbibNUM},
% which are substituted by the citation information.  For example, the
% default format is established by the command
% \begin{verbatim}
% \nmbibSetCiteall{\nmbibLink{\nmbibKEY}{authors}{\nmbibNAME} 
%  (\nmbibLink{\nmbibKEY}{timeline}{\nmbibDATE}) 
%  [\nmbibLink{\nmbibKEY}{sequence}{\nmbibNUM}]}
% \end{verbatim}
% which produces the following result: \citeall{Daly:Natbib}.  
%
% \DescribeMacro{\nmbibSetBiblabel}%
% The command \cs{nmbibSetBiblabel}\marg{type}{pattern} is used to set
% the format of the label in the reference list of the given type.
% The \marg{pattern} parameter uses the same tokens as \cs{nmbibSetCiteall}.
% The default is
% \begin{verbatim}
%\nmbibSetBiblabel{timeline}{[\nmbibDATE: 
%  \nmbibLink{\nmbibKEY}{authors}{\nmbibNAME}; 
%  \nmbibLink{\nmbibKEY}{sequence}{\nmbibNUM}]}
%\nmbibSetBiblabel{authors}{[\nmbibNAME\  
%  (\nmbibLink{\nmbibKEY}{timeline}{\nmbibDATE}); 
%  \nmbibLink{\nmbibKEY}{sequence}{\nmbibNUM}]}
%\nmbibSetBiblabel{sequence}{[\nmbibNUM: 
%  \nmbibLink{\nmbibKEY}{authors}{\nmbibNAME}
%  (\nmbibLink{\nmbibKEY}{timeline}{\nmbibDATE})]}
% \end{verbatim}
% To suppress the label for any type, use an empty pattern:
% |\nmbibSetBiblabel{authors}{}|.  To use numerical labels only for a
% sequential list, issue |\nmbibSetBiblabel{sequence}{[\nmbibNUM]}|
% etc. 
%
% \DescribeMacro{nmbibYearSuffixOff}%
% \DescribeMacro{nmbibYearSuffixOn}%
% If there are several works with the same authors and year, the
% package adds suffixes to the year numbers, like 2003a and 2003b.  By
% default these suffixes are printed both in the labels \emph{and} in
% the bibliographic entries themselves.  The command
% \cs{nmbibYearSuffixOff} deletes these suffixes from the bibliography
% entries (but not from labels).  The command \cs{nmbibYearSuffixOff}
% restores them.
% 
%
%\subsection{Auxillary script}
%\label{sec:script}
%
% To integrate the package with IDEs like \TeX Shop, we provide a
% simple script |nmbibtex| which compiles all bibliographies.  Its
% usage is very simple:
% \begin{verbatim}
% nmbibtex FILE
% \end{verbatim}
% where |FILE| is the file name without prefixes.
% 
% 
%\StopEventually{\clearpage\nmbibYearSuffixOff
% \multibibliography{nmbib}%
% \multibibliographystyle{timeline}{chronoplainnm}%
% \multibibliographystyle{sequence}{unsrtnm}%
% \multibibliographystyle{authors}{plainnm}%
% \printbibliography{sequence}%
% \printbibliography{authors}%
% \printbibliography{timeline}}
%
% \clearpage
% 
% \section{Implementation}
% \label{sec:implementation}
% 
%
%\subsection{Declarations}
%\label{sec:decl}
% 
%  We start with declaration, who we are:
%
%
%    \begin{macrocode}
%<style>\NeedsTeXFormat{LaTeX2e}
%<*gobble>
\ProvidesFile{nmbib.dtx}
%</gobble>
%<style>\ProvidesPackage{nmbib}
%<*style>
[2015/07/27 v1.04 Multibibliography support for LaTeX]
%    \end{macrocode}
%
%
%
%\subsection{Loading packages}
%\label{sec:loading}
%
% We send all options to |natbib|
%    \begin{macrocode}
\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{natbib}}
\ProcessOptions\relax
%    \end{macrocode}
% and call |natbib|
%    \begin{macrocode}
\RequirePackage{natbib}
%    \end{macrocode}
% 
%
% 
%
%\subsection{Preliminary Definitions and opening aux files}
%\label{sec:opening}
%
% \begin{macro}{\NMBIB@types}
%   The comma-separated collection of types: right now we have three
%   of them.
%    \begin{macrocode}
\def\NMBIB@types{timeline,sequence,authors}
%    \end{macrocode}
%   
% \end{macro}
% 
%
%
% \begin{macro}{\multibibliographyfilename}
%   Defining the names for bibliography files
%    \begin{macrocode}
\def\multibibliographyfilename#1#2{%
  \expandafter\edef\csname NMBIB@#1@filename\endcsname{#2}}
\@onlypreamble{\multibibliographyfilename}
%    \end{macrocode}   
% \end{macro}
%
% \begin{macro}{\NMBIB@@timeline@filename}
% \begin{macro}{\NMBIB@@sequence@filename}
% \begin{macro}{\NMBIB@@authors@filename}
%   The file names for aux files (without |.aux| extension)
%    \begin{macrocode}
\@for\@tempa:=\NMBIB@types\do{%
  \expandafter\multibibliographyfilename{\@tempa}{\jobname-\@tempa}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
%
% \begin{macro}{\NMBIB@timeline@aux}
% \begin{macro}{\NMBIB@sequence@aux}
% \begin{macro}{\NMBIB@authors@aux}
%   We introduce the output streams
%    \begin{macrocode}
\@for\@tempa:=\NMBIB@types\do{%
  \expandafter\newwrite\csname NMBIB@\@tempa @aux\endcsname}
%    \end{macrocode}
%  We open and close them at the beginning and end of the document
%    \begin{macrocode}
\AtBeginDocument{%
  \if@filesw
  \@for\@tempa:=\NMBIB@types\do{%
    \immediate\openout\csname NMBIB@\@tempa @aux\endcsname
    \csname NMBIB@\@tempa @filename\endcsname.aux
    \immediate\write\csname NMBIB@\@tempa @aux\endcsname{\relax}}%
  \fi}
\AtEndDocument{%
  \if@filesw
  \@for\@tempa:=\NMBIB@types\do{%
    \immediate\closeout\csname NMBIB@\@tempa @aux\endcsname}%
  \fi}
%    \end{macrocode}
%  
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\multibibliographystyle}
%   Define the bibliographystyle for the corresponding list.  Note the
%   trick with \cs{@begindocumenthook}, which allows us to write the
%   files only after the files are opened.
%    \begin{macrocode}
\def\multibibliographystyle#1#2{%
    \ifx\@begindocumenthook\@undefined\else
      \expandafter\AtBeginDocument
    \fi
    {\if@filesw
      \immediate\write\csname NMBIB@#1@aux\endcsname{%
        \string\bibstyle{#2}}%
     \fi}}
%    \end{macrocode}
%   
% \end{macro}
%
%
%
% \begin{macro}{\multibibliography}
%   Writing bibliography data to the aux files
%    \begin{macrocode}
\def\multibibliography#1{%
    \ifx\@begindocumenthook\@undefined\else
      \expandafter\AtBeginDocument
    \fi
    {\if@filesw
      \@for\@tempa:=\NMBIB@types\do{%
        \immediate\write\csname NMBIB@\@tempa @aux\endcsname
        {\string\bibdata{#1}}}%
      \fi}}
%    \end{macrocode}
%   
% \end{macro}
%
% \begin{macro}{\nmbibBasetype}
% \begin{macro}{\NMBIB@bibcite@type}
%   The macro \cs{nmbibBasetype} sets the type that is used for the
%   citation command:
%    \begin{macrocode}
\def\nmbibBasetype#1{\gdef\NMBIB@bibcite@type{#1}}
\nmbibBasetype{sequence}
%    \end{macrocode}
%   
% \end{macro}
% \end{macro}
%
% \begin{macro}{\NMBIB@timeline@cite@suffix}
% \begin{macro}{\NMBIB@sequence@cite@suffix}
% \begin{macro}{\NMBIB@authors@cite@suffix}
% \begin{macro}{\NMBIB@alias@cite@suffix}
%   The macro \cs{NMBIB@TYPE@cite@suffix} keeps the suffix added to
%   the hyperlink |cite|:
%    \begin{macrocode}
\@for\@tempa:=\NMBIB@types\do{%
  \expandafter\edef\csname NMBIB@\@tempa
  @cite@suffix\endcsname{\@tempa}}
\def\NMBIB@alias@cite@suffix{authors}
%    \end{macrocode}
%   
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\nmbibRedirectLinks}
%   The macro \cs{nmbibRedirectLinks}\marg{from}\marg{to} redefines
%   the suffix:
%    \begin{macrocode}
\def\nmbibRedirectLinks#1#2{%
  \expandafter\edef\csname NMBIB@#1@cite@suffix\endcsname{#2}}
%    \end{macrocode}
%   
% \end{macro}
%
%\subsection{Citation commands}
%\label{sec:citex}
%
%
% \begin{macro}{\NAT@set@cites}
%   The command |\NAT@set@cites| is used by |natbib| to set up
%   citation styles.  It is added to the |begindocument| hook, so we
%   need to disable it here:
%    \begin{macrocode}
\def\NAT@set@cites{}
\let\@cite\NAT@cite
\let\@citex\NAT@citex
\let\@biblabel\NAT@biblabel
\let\@bibsetup\NAT@bibsetup
\let\NAT@space\NAT@spacechar
\let\NAT@penalty\@empty
\renewcommand\NAT@idxtxt{\NAT@name\NAT@spacechar\NAT@open\NAT@date\NAT@close}
\def\natexlab#1{#1}
%    \end{macrocode}
%   
% \end{macro}
%
% \begin{macro}{\ifNMBIB@printyearsuffix}
% \changes{v1.02}{2015/04/24}{Added macro}
%   Whether to print the year suffix
%    \begin{macrocode}
\newif\ifNMBIB@printyearsuffix
\NMBIB@printyearsuffixtrue
%    \end{macrocode}
%   
% \end{macro}
%
% \begin{macro}{\nmbibYearSuffixOn}
% \changes{v1.02}{2015/04/24}{Added macro}
%   Switching on the suffixes
%    \begin{macrocode}
\def\nmbibYearSuffixOn{\NMBIB@printyearsuffixtrue}
%    \end{macrocode}
%   
% \end{macro}
% 
% \begin{macro}{\nmbibYearSuffixOff}
% \changes{v1.02}{2015/04/24}{Added macro}
%   Switching off the suffixes
%    \begin{macrocode}
\def\nmbibYearSuffixOff{\NMBIB@printyearsuffixfalse}
%    \end{macrocode}
%   
% \end{macro}
% 
%
%
% \begin{macro}{\NAT@sort@cites}
%   The command \cs{NAT@sort@cites} sorts the citations and writes
%   them to the aux file.  We want to write them to another file
%   instead.
%    \begin{macrocode}
\renewcommand\NAT@sort@cites[1]{%
  \let\NAT@cite@list\@empty
  \@for\@citeb:=#1\do{\expandafter\NAT@star@cite\@citeb\@@}%
  \if@filesw
    \@for\@tempa:=\NMBIB@types\do{%
      \expandafter\immediate\expandafter\write\expandafter
      \csname NMBIB@\@tempa @aux\endcsname
      \expandafter{\expandafter\string\expandafter\citation\expandafter{\NAT@cite@list}}}%
  \fi
  \@ifnum{\NAT@sort>\z@}{%
    \expandafter\NAT@sort@cites@\expandafter{\NAT@cite@list}%
  }{}%
}%
%    \end{macrocode}
%   
% \end{macro}
%
% 
% \begin{macro}{\nmbibcitenumber}
%   This command is written to the main |aux| file and contains the
%   number of the citation (since different lists may produce
%   different numbers).  We store the number in the macro
%   |\nmbib@num@KEY\@extra@binfo|.  We also use |natbib| warnings
%   about multiple citations.
%    \begin{macrocode}
\def\nmbibcitenumber#1#2{%
  \@ifundefined{nmbib@num@#1\@extra@binfo}{\relax}{%
    \NAT@citemultiple
    \PackageWarningNoLine{natbib}{Citation `#1' multiply defined}%
 }%
 \global\@namedef{nmbib@num@#1\@extra@binfo}{#2}}
\AtEndDocument{\let\nmbibcitenumber\NMBIB@testnum}
%    \end{macrocode}
%   
% \end{macro}
%
% \begin{macro}{\NMBIB@testnum}
%   Testing whether citation number have been changed.
%    \begin{macrocode}
\newcommand\NMBIB@testnum[2]{%
  \def\NAT@temp{#2}%
  \expandafter \ifx \csname nmbib@num@#1\@extra@binfo\endcsname\NAT@temp
  \else
    \ifNAT@swa \NAT@swafalse
      \PackageWarningNoLine{natbib}{%
        Citation(s) may have changed.\MessageBreak
        Rerun to get citations correct%
      }%
    \fi
  \fi
}%
%    \end{macrocode}
%   
% \end{macro}
%
% \begin{macro}{\NAT@parse}
%   The |natbib| command \cs{NAT@parse} parses the \cs{bibcite}
%   arguments and stores them in the corresponding macros.  However,
%   the citation number may be wrong since it might be taken from a
%   wrong list.  Therefore we use the number from \cs{nmbibcitenumber}
%   instead.
%    \begin{macrocode}
\let\NAT@parse@orig=\NAT@parse\relax
\renewcommand\NAT@parse[1]{\NAT@parse@orig{#1}%
  \@ifundefined{nmbib@num@#1\@extra@binfo}{\def\NAT@num{0}}{%
    \edef\NAT@num{\csname nmbib@num@#1\@extra@binfo\endcsname}}}
%    \end{macrocode}
%   
% \end{macro}
%
%
% \begin{macro}{\nmbibLink}
%   The command \cs{nmbibLink}\marg{key}\marg{type}\marg{text} is like
%   \cs{NAT@hyper@}, but on the user level:
%    \begin{macrocode}
\def\nmbibLink#1#2#3{%
  \hyper@natlinkstart{#1\@extra@b@citeb-\csname 
    NMBIB@#2@cite@suffix\endcsname}#3\hyper@natlinkend}
%    \end{macrocode}
%   
% \end{macro}
%
% \begin{macro}{\NAT@citexnum}
%   We use \cs{NAT@citexnum} to cite numbers:
%    \begin{macrocode}
\def\NAT@citexnum[#1][#2]#3{%
  \NAT@reset@parser
  \NAT@sort@cites{#3}%
  \NAT@reset@citea
  \@cite{\def\NAT@num{-1}\let\NAT@last@yr\relax\let\NAT@nm\@empty
    \@for\@citeb:=\NAT@cite@list\do
    {\@safe@activestrue
     \edef\@citeb{\expandafter\@firstofone\@citeb\@empty}%
     \@safe@activesfalse
     \@ifundefined{b@\@citeb\@extra@b@citeb}{%
       {\reset@font\bfseries?}
        \NAT@citeundefined\PackageWarning{natbib}%
       {Citation `\@citeb' on page \thepage \space undefined}}%
     {\let\NAT@last@num\NAT@num\let\NAT@last@nm\NAT@nm
      \NAT@parse{\@citeb}%
      \ifNAT@longnames\@ifundefined{bv@\@citeb\@extra@b@citeb}{%
        \let\NAT@name=\NAT@all@names
        \global\@namedef{bv@\@citeb\@extra@b@citeb}{}}{}%
      \fi
      \ifNAT@full\let\NAT@nm\NAT@all@names\else
        \let\NAT@nm\NAT@name\fi
      \ifNAT@swa
       \@ifnum{\NAT@ctype>\@ne}{%
        \@citea
        \NMBIB@hyper@{alias}{\@ifnum{\NAT@ctype=\tw@}{\NAT@test{\NAT@ctype}}{\NAT@alias}}%
       }{%
        \@ifnum{\NAT@cmprs>\z@}{%
         \NAT@ifcat@num\NAT@num
          {\let\NAT@nm=\NAT@num}%
          {\def\NAT@nm{-2}}%
         \NAT@ifcat@num\NAT@last@num
          {\@tempcnta=\NAT@last@num\relax}%
          {\@tempcnta\m@ne}%
         \@ifnum{\NAT@nm=\@tempcnta}{%
          \@ifnum{\NAT@merge>\@ne}{}{\NAT@last@yr@mbox}%
         }{%
           \advance\@tempcnta by\@ne
           \@ifnum{\NAT@nm=\@tempcnta}{%
             \ifx\NAT@last@yr\relax
               \def@NAT@last@yr{\@citea}%
             \else
               \def@NAT@last@yr{--\NAT@penalty}%
             \fi
           }{%
             \NAT@last@yr@mbox
           }%
         }%
        }{%
         \@tempswatrue
         \@ifnum{\NAT@merge>\@ne}{\@ifnum{\NAT@last@num=\NAT@num\relax}{\@tempswafalse}{}}{}%
         \if@tempswa\NAT@citea@mbox\fi
        }%
       }%
       \NAT@def@citea
      \else 
        \ifcase\NAT@ctype  
          \ifx\NAT@last@nm\NAT@nm \NAT@yrsep\NAT@penalty\NAT@space\else
            \@citea \NAT@test{\@ne}\NAT@spacechar\NAT@mbox{\NAT@super@kern\NAT@@open}%
          \fi
          \if*#1*\else#1\NAT@spacechar\fi
          \NAT@mbox{\NMBIB@hyper@{sequence}{{\citenumfont{\NAT@num}}}}%
          \NAT@def@citea@box
        \or
          \NMBIB@hyper@citea@space{sequence}{\NAT@test{\NAT@ctype}}%
        \or
          \NAT@hyper@citea@space{sequence}{\NAT@test{\NAT@ctype}}%
        \or
          \NAT@hyper@citea@space{alias}{\NAT@alias}%
        \fi
      \fi
     }%
    }%
      \@ifnum{\NAT@cmprs>\z@}{\NAT@last@yr}{}%
      \ifNAT@swa\else
        \@ifnum{\NAT@ctype=\z@}{%
          \if*#2*\else\NAT@cmt#2\fi
        }{}%
        \NAT@mbox{\NAT@@close}%
      \fi
  }{#1}{#2}%
}%
%    \end{macrocode}
%   
% \end{macro}
%
%
%
% 
%
% \begin{macro}{\NMBIB@hyper@}
%   This is the replacement for \cs{NAT@hyper@}
%    \begin{macrocode}
\def\NMBIB@hyper@#1#2{%
 \nmbibLink{\@citeb}{#1}{#2}}
%    \end{macrocode}
%   
% \end{macro}
%
% \begin{macro}{\NMBIB@hyper@citea}
%   This is the replacement for \cs{NAT@hyper@citea}:
%    \begin{macrocode}
\def\NMBIB@hyper@citea#1#2{%
 \@citea
 \NMBIB@hyper@{#1}{#2}%
 \NAT@def@citea
}%
%    \end{macrocode}
%   
% \end{macro}
%
% \begin{macro}{\NMBIB@hyper@citea@space}
%   The replacement for \cs{NAT@hyper@citea@space}
%    \begin{macrocode}
\def\NMBIB@hyper@citea@space#1#2{%
 \@citea
 \NMBIB@hyper@{#1}{#2}%
 \NAT@def@citea@space
}%
%    \end{macrocode}
%   
% \end{macro}
%
% \begin{macro}{\def@NAT@last@yr}
%   Another |natbib| macro to redefine
%    \begin{macrocode}
\def\def@NAT@last@yr#1{%
 \protected@edef\NAT@last@yr{%
  #1%
  \noexpand\mbox{%
   \noexpand\hyper@natlinkstart{\@citeb\@extra@b@citeb-\NMBIB@sequence@cite@suffix}%
   {\noexpand\citenumfont{\NAT@num}}%
   \noexpand\hyper@natlinkend
  }%
 }%
}%
%    \end{macrocode}
%   
% \end{macro}
%
%
% \begin{macro}{\NAT@citea@mbox}
%   This is used in numerical citations
%    \begin{macrocode}
\def\NAT@citea@mbox{%
 \@citea\mbox{\NMBIB@hyper@{sequence}{{\citenumfont{\NAT@num}}}}%
}%
%    \end{macrocode}
%   
% \end{macro}
%
% \begin{macro}{\NMBIB@citex}
%   And now the heart of |natbib|\dots
%    \begin{macrocode}
\def\NMBIB@citex%
  [#1][#2]#3{%
  \NAT@reset@parser
  \NAT@sort@cites{#3}%
  \NAT@reset@citea
  \@cite{\let\NAT@nm\@empty\let\NAT@year\@empty
    \@for\@citeb:=\NAT@cite@list\do
    {\@safe@activestrue
     \edef\@citeb{\expandafter\@firstofone\@citeb\@empty}%
     \@safe@activesfalse
     \@ifundefined{b@\@citeb\@extra@b@citeb}{\@citea%
       {\reset@font\bfseries ?}\NAT@citeundefined
                 \PackageWarning{natbib}%
       {Citation `\@citeb' on page \thepage \space undefined}\def\NAT@date{}}%
     {\let\NAT@last@nm=\NAT@nm\let\NAT@last@yr=\NAT@year
      \NAT@parse{\@citeb}%
      \ifNAT@longnames\@ifundefined{bv@\@citeb\@extra@b@citeb}{%
        \let\NAT@name=\NAT@all@names
        \global\@namedef{bv@\@citeb\@extra@b@citeb}{}}{}%
      \fi
     \ifNAT@full\let\NAT@nm\NAT@all@names\else
       \let\NAT@nm\NAT@name\fi
     \ifNAT@swa\ifcase\NAT@ctype
       \if\relax\NAT@date\relax
         \@citea\NMBIB@hyper@{authors}{\NAT@nmfmt{\NAT@nm}}%
         \NMBIB@hyper@{timeline}{\NAT@date}%
       \else
         \ifx\NAT@last@nm\NAT@nm\NAT@yrsep
            \ifx\NAT@last@yr\NAT@year
              \def\NAT@temp{{?}}%
              \ifx\NAT@temp\NAT@exlab\PackageWarningNoLine{natbib}%
               {Multiple citation on page \thepage: same authors and
               year\MessageBreak without distinguishing extra
               letter,\MessageBreak appears as question mark}\fi
              \NMBIB@hyper@{timeline}{\NAT@exlab}%
            \else\unskip\NAT@spacechar
              \NMBIB@hyper@{timeline}{\NAT@date}%
            \fi
         \else
           \@citea\NMBIB@hyper@{authors}{%
             \NAT@nmfmt{\NAT@nm}%
             \hyper@natlinkbreak{%
               \NAT@aysep\NAT@spacechar}{\@citeb\@extra@b@citeb
             }}%
             \NMBIB@hyper@{timeline}{\NAT@date
           }%
         \fi
       \fi
     \or\@citea\NMBIB@hyper@{authors}{\NAT@nmfmt{\NAT@nm}}%
     \or\@citea\NMBIB@hyper@{timeline}{\NAT@date}%
     \or\@citea\NMBIB@hyper@{alias}{\NAT@alias}%
     \fi \NAT@def@citea
     \else
       \ifcase\NAT@ctype
        \if\relax\NAT@date\relax
          \@citea\NMBIB@hyper@{authors}{\NAT@nmfmt{\NAT@nm}}%
        \else
         \ifx\NAT@last@nm\NAT@nm\NAT@yrsep
            \ifx\NAT@last@yr\NAT@year
              \def\NAT@temp{{?}}%
              \ifx\NAT@temp\NAT@exlab\PackageWarningNoLine{natbib}%
               {Multiple citation on page \thepage: same authors and
               year\MessageBreak without distinguishing extra
               letter,\MessageBreak appears as question mark}\fi
              \NMBIB@hyper@{timeline}{\NAT@exlab}%
            \else
              \unskip\NAT@spacechar
              \NMBIB@hyper@{timeline}{\NAT@date}%
            \fi
         \else
           \@citea\NMBIB@hyper@{authors}{%
             \NAT@nmfmt{\NAT@nm}%
             \hyper@natlinkbreak{\NAT@spacechar\NAT@@open\if*#1*\else#1\NAT@spacechar\fi}%
               {\@citeb\@extra@b@citeb}}%
             \NMBIB@hyper@{timeline}{\NAT@date
           }%
         \fi
        \fi
       \or\@citea\NMBIB@hyper@{authors}{\NAT@nmfmt{\NAT@nm}}%
       \or\@citea\NMBIB@hyper@{timeline}{\NAT@date}%
       \or\@citea\NMBIB@hyper@{alias}{\NAT@alias}%
       \fi
       \if\relax\NAT@date\relax
         \NAT@def@citea
       \else
         \NAT@def@citea@close
       \fi
     \fi
     }}\ifNAT@swa\else\if*#2*\else\NAT@cmt#2\fi
     \if\relax\NAT@date\relax\else\NAT@@close\fi\fi}{#1}{#2}}
\let\@citex\NMBIB@citex
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\citealn}
%   Alternative numerical citation command:
%    \begin{macrocode}
\newcommand\citealn[1]{[\citenum{#1}]}
%    \end{macrocode}
%   
% \end{macro}
%
% \begin{macro}{\nmbibSetCiteall}
%   Setting the format of \cs{citeall}
%    \begin{macrocode}
\def\nmbibSetCiteall#1{\def\NMBIB@citeallformat{#1}}
\nmbibSetCiteall{\nmbibLink{\nmbibKEY}{authors}{\nmbibNAME} %
  (\nmbibLink{\nmbibKEY}{timeline}{\nmbibDATE}) %
  [\nmbibLink{\nmbibKEY}{sequence}{\nmbibNUM}]}
%    \end{macrocode}
%   
% \end{macro}
%
%
% \begin{macro}{\citeall}
%   The full cite command
%    \begin{macrocode}
\DeclareRobustCommand\citeall
{\begingroup\@ifnextchar*{\NAT@fulltrue\@citeall}{\NAT@fullfalse\@citeall*}}
\def\@citeall#1{\@ifnextchar[{\@@citeall}{\@@citeall[]}}
\def\@@citeall[#1]{\@ifnextchar[{\@@@citeall[#1]}{\@@@citeall[][#1]}}
\def\@@@citeall[#1][#2]#3{%  
  \NAT@reset@parser
  \NAT@sort@cites{#3}%
  \NAT@reset@citea
  \@cite{%
    \@for\@citeb:=\NAT@cite@list\do
    {\@safe@activestrue
     \edef\@citeb{\expandafter\@firstofone\@citeb\@empty}%
     \@safe@activesfalse
     \@ifundefined{b@\@citeb\@extra@b@citeb}{\@citea%
       {\reset@font\bfseries ?}\NAT@citeundefined
                 \PackageWarning{natbib}%
       {Citation `\@citeb' on page \thepage \space undefined}\def\NAT@date{}}%
     {\NAT@parse{\@citeb}%
       \ifNAT@full\let\NAT@nm\NAT@all@names\else
         \let\NAT@nm\NAT@name\fi
       \edef\nmbibKEY{\@citeb}%
       \edef\nmbibDATE{\NAT@date}%
       \edef\nmbibNAME{\NAT@nm}%
       \edef\nmbibNUM{\NAT@num}%
       \@citea\NMBIB@citeallformat
       \def\@citea{; }%
     }}\if*#2*\else\NAT@cmt#2\fi}{#1}{#2}}
%    \end{macrocode}
%   
% \end{macro}
%
%
%\subsection{Processing bibliography}
%\label{sec:processing_bibliography}
%
% \begin{macro}{\timelinerefname}
% \changes{v1.01}{2015/01/27}{Typo corrected}
%   Reference list for chrono ordering
%    \begin{macrocode}
\providecommand{\timelinerefname}{Chronological List of References}
%    \end{macrocode}   
% \end{macro}
% \begin{macro}{\timelinebibname}
% \changes{v1.04}{2015/07/27}{Typo corrected}
%   Reference list for chrono ordering
%    \begin{macrocode}
\providecommand{\timelinebibname}{Chronological Bibliography}
%    \end{macrocode}   
% \end{macro}
% \begin{macro}{\sequencerefname}
%   Reference list for sequential ordering
%    \begin{macrocode}
\providecommand{\sequencerefname}{Sequential List of References}
%    \end{macrocode}   
% \end{macro}
% \begin{macro}{\sequencebibname}
%   Reference list for sequential ordering
%    \begin{macrocode}
\providecommand{\sequencebibname}{Sequential Bibliography}
%    \end{macrocode}   
% \end{macro}
% \begin{macro}{\authorsrefname}
%   Reference list for alph ordering
%    \begin{macrocode}
\providecommand{\authorsrefname}{Alphabetic List of References}
%    \end{macrocode}   
% \end{macro}
% \begin{macro}{\authorsbibname}
%   Reference list for alph ordering
%    \begin{macrocode}
\providecommand{\authorsbibname}{Alphabetic Bibliography}
%    \end{macrocode}   
% \end{macro}
%
%
% \begin{macro}{\ifNMBIB@writenumber}
%   The switch whether to write the citation number to the |aux|
%   file.  Should be true for sequence, false otherwise.
%    \begin{macrocode}
\newif\ifNMBIB@writenumber
\NMBIB@writenumberfalse
%    \end{macrocode}
%   
% \end{macro}
%
% \begin{macro}{\NMBIB@setup@authors}
%   Set up alphabetical-style reference list
%    \begin{macrocode}
\def\NMBIB@setup@authors{%
  \NMBIB@writenumberfalse}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\NMBIB@setup@timeline}
%   Timeline reference list looks like alhpabetical
%    \begin{macrocode}
\let\NMBIB@setup@timeline\NMBIB@setup@authors
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\NMBIB@setup@sequence}
%   Sequential citations are numerical
%    \begin{macrocode}
\def\NMBIB@setup@sequence{%
  \NMBIB@writenumbertrue}
%    \end{macrocode}
% \end{macro}
%
%
%
% \begin{macro}{\printbibliography}
% \changes{v1.02}{2015/04/24}{Added suppression of suffixes}
%   The actual printing of the bibliography of the given type.  Note
%   that we need to reset \cs{natexlab} afterwards---just in case it
%   is used outside the bibliography.
%    \begin{macrocode}
\def\printbibliography#1{%
  \def\NMBIB@current@type{#1}%
  \def\@biblabel{\csname NMBIB@#1@biblabel\endcsname}
  \edef\NMBIB@current@cite@suffix{\csname NMBIB@#1@cite@suffix\endcsname}%
  \csname NMBIB@setup@#1\endcsname
  \ifx\NMBIB@current@type\NMBIB@bibcite@type
    \def\natexlab@real##1{##1}%
  \else
    \def\natexlab@real##1{\NAT@exlab}%
  \fi
  \edef\refname{\csname #1refname\endcsname}%
  \edef\bibname{\csname #1bibname\endcsname}%
  \@input@{\csname NMBIB@#1@filename\endcsname.bbl}%
  \def\natexlab##1{##1}}
%    \end{macrocode}
%   
% \end{macro}
%
% \begin{macro}{\bibitem}
%   Normally \cs{bibitem} is defined as \cs{@lbibitem}.  We want first
%   to calculate the biblabel
%    \begin{macrocode}
\def\bibitem{\@ifnextchar[{\@@lbibitem}{\@@lbibitem[]}}%
%    \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\@@lbibitem}
% \changes{v1.02}{2015/04/24}{Added suppression of suffixes}
%   The macro \cs{@@lbibitem} calculates \cs{NAT@exlab} and
%   calls \cs{@lbibitem}:
%    \begin{macrocode}
\def\@@lbibitem[#1]#2{%
  \let\natexlab\natexlab@real
  \NAT@parse{#2}%
  \def\nmbibKEY{#2}%
  \edef\nmbibDATE{\NAT@date}%
  \edef\nmbibNAME{\NAT@name}%
  \edef\nmbibNUM{\NAT@num}%
  \@lbibitem[#1]{#2}%
  \ifNMBIB@printyearsuffix\else\def\natexlab##1{}\fi}
%    \end{macrocode}
%   
% \end{macro}
%
% \begin{macro}{\NAT@exlab}
%   Before the package is loaded, \cs{NAT@exlab} should not give an
%   error:
%    \begin{macrocode}
\providecommand\NAT@exlab{}
%    \end{macrocode}
%   
% \end{macro}
%
% \begin{macro}{\NAT@wrout}
%   The original \cs{NAT@wrout} writes to aux file the information
%   from the bbl file.  Here we check whether we need to do this and
%   whether to write the number:
%    \begin{macrocode}
\renewcommand\NAT@wrout[5]{%
\if@filesw
  \ifx\NMBIB@current@type\NMBIB@bibcite@type
      {\let\protect\noexpand\let~\relax
       \immediate
       \write\@auxout{\string\bibcite{#5}{{#1}{#2}{{#3}}{{#4}}}}}\fi
  \ifNMBIB@writenumber
      {\let\protect\noexpand\let~\relax
       \immediate
       \write\@auxout{\string\nmbibcitenumber{#5}{#1}}}\fi
\fi
\ignorespaces}
%    \end{macrocode}
%   
% \end{macro}
%
% \begin{macro}{\NAT@anchor}
%   The command \cs{NAT@anchor}\marg{KEY}\marg{text} creates a
%   hyperlink if the package |hyperref| is loaded.  Here we redefine
%   it to create cites in the style |KEY-TYPE|:
%    \begin{macrocode}
\def\NAT@anchor#1#2{%
 \hyper@natanchorstart{#1\@extra@b@citeb-\NMBIB@current@cite@suffix}%
  \def\@tempa{#2}\@ifx{\@tempa\@empty}{}{\@biblabel{#2}}%
 \hyper@natanchorend
}%
%    \end{macrocode}
%   
% \end{macro}
%
% \begin{macro}{\nmbibSetBiblabel}
%   Setting biblabel for the list
%    \begin{macrocode}
\def\nmbibSetBiblabel#1#2{%
  \expandafter\def\csname NMBIB@#1@biblabel\endcsname##1{#2}}
%    \end{macrocode}
%   
% \end{macro}
%
% \begin{macro}{\NMBIB@timeline@biblabel}
% \begin{macro}{\NMBIB@sequence@biblabel}
% \changes{v1.01}{2015/01/27}{Punctiuation changed}
% \begin{macro}{\NMBIB@authors@biblabel}
%   The default labels
%    \begin{macrocode}
\nmbibSetBiblabel{timeline}{[\nmbibDATE: 
  \nmbibLink{\nmbibKEY}{authors}{\nmbibNAME}; 
  \nmbibLink{\nmbibKEY}{sequence}{\nmbibNUM}]}
\nmbibSetBiblabel{authors}{[\nmbibNAME\  
  (\nmbibLink{\nmbibKEY}{timeline}{\nmbibDATE}); 
  \nmbibLink{\nmbibKEY}{sequence}{\nmbibNUM}]}
\nmbibSetBiblabel{sequence}{[\nmbibNUM: 
  \nmbibLink{\nmbibKEY}{authors}{\nmbibNAME}
  (\nmbibLink{\nmbibKEY}{timeline}{\nmbibDATE})]}
%    \end{macrocode}
%   
% \end{macro}
% \end{macro}
% \end{macro}
%
%
%\subsection{Ending the Style}
%\label{sec:end}
%
%
%
%    \begin{macrocode}
%</style>
%    \end{macrocode}
%\Finale
%\clearpage
%
%\PrintChanges
%\clearpage
%\PrintIndex
%
\endinput