summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/nmbib/nmbib.dtx
blob: 24647ae06f9507728e442ca9c65ccc3b3a39b2c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
% \iffalse
% $Id: nmbib.dtx,v 1.21 2015/07/27 20:22:45 boris Exp $
%
%% Copyright 2015, 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 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