source: papers/SMPaT-2012_DCWoRMS/elsevier_guide/aricle/model6-num-names.bst @ 593

Revision 593, 29.5 KB checked in by wojtekp, 12 years ago (diff)
Line 
1%%
2%% This is file `model6-num-names.bst',
3%%
4%% Copyright 2009 Elsevier Ltd
5%%
6%% This file is part of the 'Elsarticle Bundle'.
7%% ---------------------------------------------
8%%
9%% It may be distributed under the conditions of the LaTeX Project Public
10%% License, either version 1.2 of this license or (at your option) any
11%% later version.  The latest version of this license is in
12%%    http://www.latex-project.org/lppl.txt
13%% and version 1.2 or later is part of all distributions of LaTeX
14%% version 1999/12/01 or later.
15%%
16%% $Id: model6-num-names.bst 162 2009-10-08 06:58:50Z rishi $
17%%
18%% $URL: http://lenova.river-valley.com/svn/elsbst/trunk/New-Model-6/model6-num-names.bst $
19%%
20%%
21
22ENTRY
23  { address
24    archive
25    author
26    booktitle
27    chapter
28    collaboration
29    doi
30    edition
31    editor
32    eid
33    eprint
34    howpublished
35    institution
36    isbn
37    journal
38    key
39    month
40    note
41    number
42    numpages
43    organization
44    pages
45    publisher
46    school
47    series
48    title
49    type
50    url
51    volume
52    year
53  }
54  {}
55  { label extra.label sort.label short.list }
56INTEGERS { output.state before.all mid.sentence after.sentence after.block }
57FUNCTION {init.state.consts}
58{ #0 'before.all :=
59  #1 'mid.sentence :=
60  #2 'after.sentence :=
61  #3 'after.block :=
62}
63STRINGS { s t}
64FUNCTION {output.nonnull}
65{ 's :=
66  output.state mid.sentence =
67    { "; " * write$ }
68    { output.state after.block =
69        { add.period$ write$
70          newline$
71          "\newblock " write$
72        }
73        { output.state before.all =
74            'write$
75            { add.period$ " " * write$ }
76          if$
77        }
78      if$
79      mid.sentence 'output.state :=
80    }
81  if$
82  s
83}
84FUNCTION {output}
85{ duplicate$ empty$
86    'pop$
87    'output.nonnull
88  if$
89}
90FUNCTION {output.check}
91{ 't :=
92  duplicate$ empty$
93    { pop$ "empty " t * " in " * cite$ * warning$ }
94    'output.nonnull
95  if$
96}
97FUNCTION {fin.entry}
98{ add.period$
99  write$
100  newline$
101}
102
103FUNCTION {new.block}
104{ output.state before.all =
105    'skip$
106    { after.block 'output.state := }
107  if$
108}
109FUNCTION {new.sentence}
110{ output.state after.block =
111    'skip$
112    { output.state before.all =
113        'skip$
114        { after.sentence 'output.state := }
115      if$
116    }
117  if$
118}
119FUNCTION {add.blank}
120{  " " * before.all 'output.state :=
121}
122
123FUNCTION {no.blank.or.punct}
124{  "" * before.all 'output.state :=
125}
126
127FUNCTION {date.block}
128{
129  ";" *
130  no.blank.or.punct
131}
132
133FUNCTION {book.date.block}
134{ ":\unskip" *
135  no.blank.or.punct
136}
137
138FUNCTION {not}
139{   { #0 }
140    { #1 }
141  if$
142}
143FUNCTION {and}
144{   'skip$
145    { pop$ #0 }
146  if$
147}
148FUNCTION {or}
149{   { pop$ #1 }
150    'skip$
151  if$
152}
153STRINGS {z}
154FUNCTION {remove.dots}
155{ 'z :=
156  ""
157  { z empty$ not }
158  { z #1 #1 substring$
159    z #2 global.max$ substring$ 'z :=
160    duplicate$ "." = 'pop$
161      { * }
162    if$
163  }
164  while$
165}
166FUNCTION {new.block.checkb}
167{ empty$
168  swap$ empty$
169  and
170    'skip$
171    'new.block
172  if$
173}
174FUNCTION {field.or.null}
175{ duplicate$ empty$
176    { pop$ "" }
177    'skip$
178  if$
179}
180FUNCTION {emphasize}
181{ duplicate$ empty$
182    { pop$ "" }
183    { "\emph{" swap$ * "}" * }
184  if$
185}
186FUNCTION {tie.or.space.prefix}
187{ duplicate$ text.length$ #3 <
188    { "~" }
189    { " " }
190  if$
191  swap$
192}
193
194FUNCTION {capitalize}
195{ "u" change.case$ "t" change.case$ }
196
197FUNCTION {space.word}
198{ " " swap$ * " " * }
199 % Here are the language-specific definitions for explicit words.
200 % Each function has a name bbl.xxx where xxx is the English word.
201 % The language selected here is ENGLISH
202FUNCTION {bbl.and}
203{ "and"}
204
205FUNCTION {bbl.etal}
206{ "et~al." }
207
208FUNCTION {bbl.editors}
209{ "eds." }
210
211FUNCTION {bbl.editor}
212{ "ed." }
213
214FUNCTION {bbl.edby}
215{ "edited by" }
216
217FUNCTION {bbl.edition}
218{ "ed." }
219
220FUNCTION {bbl.volume}
221{ "vol." }
222
223FUNCTION {bbl.of}
224{ "of" }
225
226FUNCTION {bbl.number}
227{ "no." }
228
229FUNCTION {bbl.nr}
230{ "no." }
231
232FUNCTION {bbl.in}
233{ "in" }
234
235FUNCTION {bbl.pages}
236{ "" }
237
238FUNCTION {bbl.page}
239{ "" }
240
241FUNCTION {bbl.eidpp}
242{ "pages" }
243
244FUNCTION {bbl.chapter}
245{ "chap." }
246
247FUNCTION {bbl.techrep}
248{ "Tech. Rep." }
249
250FUNCTION {bbl.mthesis}
251{ "Master's thesis" }
252
253FUNCTION {bbl.phdthesis}
254{ "Ph.D. thesis" }
255
256FUNCTION {close.brace}
257{ "}{}" }
258
259MACRO {jan} {"Jan."}
260
261MACRO {feb} {"Feb."}
262
263MACRO {mar} {"Mar."}
264
265MACRO {apr} {"Apr."}
266
267MACRO {may} {"May"}
268
269MACRO {jun} {"Jun."}
270
271MACRO {jul} {"Jul."}
272
273MACRO {aug} {"Aug."}
274
275MACRO {sep} {"Sep."}
276
277MACRO {oct} {"Oct."}
278
279MACRO {nov} {"Nov."}
280
281MACRO {dec} {"Dec."}
282
283MACRO {acmcs} {"ACM Comput. Surv."}
284
285MACRO {acta} {"Acta Inf."}
286
287MACRO {cacm} {"Commun. ACM"}
288
289MACRO {ibmjrd} {"IBM J. Res. Dev."}
290
291MACRO {ibmsj} {"IBM Syst.~J."}
292
293MACRO {ieeese} {"IEEE Trans. Software Eng."}
294
295MACRO {ieeetc} {"IEEE Trans. Comput."}
296
297MACRO {ieeetcad}
298 {"IEEE Trans. Comput. Aid. Des."}
299
300MACRO {ipl} {"Inf. Process. Lett."}
301
302MACRO {jacm} {"J.~ACM"}
303
304MACRO {jcss} {"J.~Comput. Syst. Sci."}
305
306MACRO {scp} {"Sci. Comput. Program."}
307
308MACRO {sicomp} {"SIAM J. Comput."}
309
310MACRO {tocs} {"ACM Trans. Comput. Syst."}
311
312MACRO {tods} {"ACM Trans. Database Syst."}
313
314MACRO {tog} {"ACM Trans. Graphic."}
315
316MACRO {toms} {"ACM Trans. Math. Software"}
317
318MACRO {toois} {"ACM Trans. Office Inf. Syst."}
319
320MACRO {toplas} {"ACM Trans. Progr. Lang. Syst."}
321
322MACRO {tcs} {"Theor. Comput. Sci."}
323
324FUNCTION {bibinfo.check}
325{ swap$
326  duplicate$ missing$
327    {
328      pop$ pop$
329      ""
330    }
331    { duplicate$ empty$
332        {
333          swap$ pop$
334        }
335        { swap$
336          "\bibinfo{" swap$ * "}{" * swap$ * "}" *
337        }
338      if$
339    }
340  if$
341}
342FUNCTION {bibinfo.warn}
343{ swap$
344  duplicate$ missing$
345    {
346      swap$ "missing " swap$ * " in " * cite$ * warning$ pop$
347      ""
348    }
349    { duplicate$ empty$
350        {
351          swap$ "empty " swap$ * " in " * cite$ * warning$
352        }
353        { swap$
354          pop$
355        }
356      if$
357    }
358  if$
359}
360FUNCTION {format.eprint}
361{ eprint duplicate$ empty$
362    'skip$
363    { "\eprint"
364      archive empty$
365        'skip$
366        { "[" * archive * "]" * }
367      if$
368      "{" * swap$ * "}" *
369    }
370  if$
371}
372FUNCTION {format.url}
373{ url empty$
374    { "" }
375    { "\urlprefix\url{" url * "}" * }
376  if$
377}
378
379INTEGERS { nameptr namesleft numnames }
380
381
382STRINGS  { bibinfo}
383
384% FUNCTION {format.names}
385% { 'bibinfo :=
386%   duplicate$ empty$ 'skip$ {
387%   's :=
388%   "" 't :=
389%   #1 'nameptr :=
390%   s num.names$ 'numnames :=
391%   numnames 'namesleft :=
392%     { namesleft #0 > }
393%     { s nameptr
394%       "{vv~}{ll}{ jj}{ f{}}"
395%       format.name$
396%       remove.dots
397%       bibinfo bibinfo.check
398%       't :=
399%       nameptr #1 >
400%         {
401%           namesleft #1 >
402%             { ", " * t * }
403%             {
404%               s nameptr "{ll}" format.name$ duplicate$ "others" =
405%                 { 't := }
406%                 { pop$ }
407%               if$
408%               "," *
409%               t "others" =
410%                 {
411%                   " " * bbl.etal *
412%                 }
413%                 { " " * t * }
414%               if$
415%             }
416%           if$
417%         }
418%         't
419%       if$
420%       nameptr #1 + 'nameptr :=
421%       namesleft #1 - 'namesleft :=
422%     }
423%   while$
424%   } if$
425% }
426
427FUNCTION {format.names}
428{ 'bibinfo :=
429  duplicate$ empty$ 'skip$ {
430  's :=
431  "" 't :=
432  #1 'nameptr :=
433  s num.names$ 'numnames :=
434  numnames 'namesleft :=
435    { namesleft #0 > }
436    { s nameptr
437      "{vv~}{ll}{ jj}\xfnm[{ f{.}.}]"
438      format.name$
439%      remove.dots
440      bibinfo bibinfo.check
441      't :=
442      nameptr #1 >
443        {
444          namesleft #1 >
445            { ", " * t * }
446            {
447              "," *
448              s nameptr "{ll}" format.name$ duplicate$ "others" =
449                { 't := }
450                { pop$ }
451              if$
452              t "others" =
453                {
454                  " " * bbl.etal *
455                }
456                { " " * t * }
457              if$
458            }
459          if$
460        }
461        't
462      if$
463      nameptr #1 + 'nameptr :=
464      namesleft #1 - 'namesleft :=
465    }
466  while$
467  } if$
468}
469
470
471FUNCTION {format.names.ed}
472{
473  format.names
474}
475FUNCTION {format.key}
476{ empty$
477    { key field.or.null }
478    { "" }
479  if$
480}
481
482FUNCTION {format.authors}
483{ author "author" format.names
484    duplicate$ empty$ 'skip$
485    { collaboration "collaboration" bibinfo.check
486      duplicate$ empty$ 'skip$
487        { " (" swap$ * ")" * }
488      if$
489      *
490    }
491  if$
492}
493FUNCTION {get.bbl.editor}
494{ editor num.names$ #1 > 'bbl.editors 'bbl.editor if$ }
495
496FUNCTION {format.editors}
497{ editor "editor" format.names duplicate$ empty$ 'skip$
498    {
499      "," *
500      " " *
501      get.bbl.editor
502      *
503    }
504  if$
505}
506FUNCTION {format.isbn}
507{ isbn "isbn" bibinfo.check
508  duplicate$ empty$ 'skip$
509    {
510      new.block
511      "ISBN " swap$ *
512    }
513  if$
514}
515
516FUNCTION {format.doi}
517{ doi "doi" bibinfo.check
518  duplicate$ empty$ 'skip$
519    {
520      new.block
521      "\doi{" swap$ * "}" *
522    }
523  if$
524}
525FUNCTION {format.note}
526{
527 note empty$
528    { "" }
529    { note #1 #1 substring$
530      duplicate$ "{" =
531        'skip$
532        { output.state mid.sentence =
533          { "l" }
534          { "u" }
535        if$
536        change.case$
537        }
538      if$
539      note #2 global.max$ substring$ * "note" bibinfo.check
540    }
541  if$
542}
543
544FUNCTION {format.title}
545{ title
546  duplicate$ empty$ 'skip$
547    { "t" change.case$ }
548  if$
549  "title" bibinfo.check
550}
551FUNCTION {format.full.names}
552{'s :=
553 "" 't :=
554  #1 'nameptr :=
555  s num.names$ 'numnames :=
556  numnames 'namesleft :=
557    { namesleft #0 > }
558    { s nameptr
559      "{vv~}{ll}" format.name$
560      't :=
561      nameptr #1 >
562        {
563          namesleft #1 >
564            { ", " * t * }
565            {
566              s nameptr "{ll}" format.name$ duplicate$ "others" =
567                { 't := }
568                { pop$ }
569              if$
570              t "others" =
571                {
572                  " " * bbl.etal *
573                }
574                {
575                  bbl.and
576                  space.word * t *
577                }
578              if$
579            }
580          if$
581        }
582        't
583      if$
584      nameptr #1 + 'nameptr :=
585      namesleft #1 - 'namesleft :=
586    }
587  while$
588}
589
590FUNCTION {author.editor.key.full}
591{ author empty$
592    { editor empty$
593        { key empty$
594            { cite$ #1 #3 substring$ }
595            'key
596          if$
597        }
598        { editor format.full.names }
599      if$
600    }
601    { author format.full.names }
602  if$
603}
604
605FUNCTION {author.key.full}
606{ author empty$
607    { key empty$
608         { cite$ #1 #3 substring$ }
609          'key
610      if$
611    }
612    { author format.full.names }
613  if$
614}
615
616FUNCTION {editor.key.full}
617{ editor empty$
618    { key empty$
619         { cite$ #1 #3 substring$ }
620          'key
621      if$
622    }
623    { editor format.full.names }
624  if$
625}
626
627FUNCTION {make.full.names}
628{ type$ "book" =
629  type$ "inbook" =
630  or
631    'author.editor.key.full
632    { type$ "proceedings" =
633        'editor.key.full
634        'author.key.full
635      if$
636    }
637  if$
638}
639
640FUNCTION {output.bibitem}
641{ newline$
642  "\bibitem[{" write$
643  label write$
644  ")" make.full.names duplicate$ short.list =
645     { pop$ }
646     { * }
647   if$
648  "}]{" * write$
649  cite$ write$
650  "}" write$
651  newline$
652  ""
653  before.all 'output.state :=
654}
655
656FUNCTION {n.dashify}
657{
658  't :=
659  ""
660    { t empty$ not }
661    { t #1 #1 substring$ "-" =
662        { t #1 #2 substring$ "--" = not
663            { "--" *
664              t #2 global.max$ substring$ 't :=
665            }
666            {   { t #1 #1 substring$ "-" = }
667                { "-" *
668                  t #2 global.max$ substring$ 't :=
669                }
670              while$
671            }
672          if$
673        }
674        { t #1 #1 substring$ *
675          t #2 global.max$ substring$ 't :=
676        }
677      if$
678    }
679  while$
680}
681
682FUNCTION {word.in}
683{ bbl.in capitalize
684  ":" *
685  " " * }
686
687FUNCTION {format.date}
688{ year "year" bibinfo.check duplicate$ empty$
689    {
690      "empty year in " cite$ * "; set to ????" * warning$
691       pop$ "????"
692    }
693    'skip$
694  if$
695  extra.label *
696}
697FUNCTION {format.btitle}
698{ title "title" bibinfo.check
699  duplicate$ empty$ 'skip$
700    {
701    }
702  if$
703}
704FUNCTION {either.or.check}
705{ empty$
706    'pop$
707    { "can't use both " swap$ * " fields in " * cite$ * warning$ }
708  if$
709}
710FUNCTION {format.bvolume}
711{ volume empty$
712    { "" }
713    { bbl.volume volume tie.or.space.prefix
714      "volume" bibinfo.check * *
715      series "series" bibinfo.check
716      duplicate$ empty$ 'pop$
717        { swap$ bbl.of space.word * swap$
718          emphasize * }
719      if$
720      "volume and number" number either.or.check
721    }
722  if$
723}
724FUNCTION {format.number.series}
725{ volume empty$
726    { number empty$
727        { series field.or.null }
728        { series empty$
729            { number "number" bibinfo.check }
730            { output.state mid.sentence =
731                { bbl.number }
732                { bbl.number capitalize }
733              if$
734              number tie.or.space.prefix "number" bibinfo.check * *
735              bbl.in space.word *
736              series "series" bibinfo.check *
737            }
738          if$
739        }
740      if$
741    }
742    { "" }
743  if$
744}
745
746FUNCTION {format.edition}
747{ edition duplicate$ empty$ 'skip$
748    {
749      output.state mid.sentence =
750        { "l" }
751        { "t" }
752      if$ change.case$
753      "edition" bibinfo.check
754      " " * bbl.edition *
755    }
756  if$
757}
758INTEGERS { multiresult }
759FUNCTION {multi.page.check}
760{ 't :=
761  #0 'multiresult :=
762    { multiresult not
763      t empty$ not
764      and
765    }
766    { t #1 #1 substring$
767      duplicate$ "-" =
768      swap$ duplicate$ "," =
769      swap$ "+" =
770      or or
771        { #1 'multiresult := }
772        { t #2 global.max$ substring$ 't := }
773      if$
774    }
775  while$
776  multiresult
777}
778FUNCTION {format.pages}
779{ pages duplicate$ empty$ 'skip$
780    { duplicate$ multi.page.check
781        {
782          bbl.pages swap$
783          n.dashify
784        }
785        {
786          bbl.page swap$
787        }
788      if$
789      tie.or.space.prefix
790      "pages" bibinfo.check
791      * *
792    }
793  if$
794}
795FUNCTION {format.journal.pages}
796{ pages duplicate$ empty$ 'pop$
797    { swap$ duplicate$ empty$
798        { pop$ pop$ format.pages }
799        {
800          ":" *
801          swap$
802          n.dashify
803          "pages" bibinfo.check
804          *
805        }
806      if$
807    }
808  if$
809}
810FUNCTION {format.journal.eid}
811{ eid "eid" bibinfo.check
812  duplicate$ empty$ 'pop$
813    { swap$ duplicate$ empty$ 'skip$
814      {
815          ":" *
816      }
817      if$
818      swap$ *
819      numpages empty$ 'skip$
820        { bbl.eidpp numpages tie.or.space.prefix
821          "numpages" bibinfo.check * *
822          " (" swap$ * ")" * *
823        }
824      if$
825    }
826  if$
827}
828FUNCTION {format.vol.num.pages}
829{ volume field.or.null
830  duplicate$ empty$ 'skip$
831    {
832      "volume" bibinfo.check
833    }
834  if$
835  number "number" bibinfo.check duplicate$ empty$ 'skip$
836    {
837      swap$ duplicate$ empty$
838        { "there's a number but no volume in " cite$ * warning$ }
839        'skip$
840      if$
841      swap$
842      "(" swap$ * ")" *
843    }
844  if$ *
845}
846
847FUNCTION {format.chapter.pages}
848{ chapter empty$
849    { "" }
850    { type empty$
851        { bbl.chapter }
852        { type "l" change.case$
853          "type" bibinfo.check
854        }
855      if$
856      chapter tie.or.space.prefix
857      "chapter" bibinfo.check
858      * *
859    }
860  if$
861}
862
863FUNCTION {format.booktitle}
864{
865  booktitle "booktitle" bibinfo.check
866      emphasize
867}
868FUNCTION {format.in.ed.booktitle}
869{ format.booktitle duplicate$ empty$ 'skip$
870    {
871      editor "editor" format.names.ed duplicate$ empty$ 'pop$
872        {
873          "," *
874          " " *
875          get.bbl.editor
876          " " *
877          * swap$
878          * }
879      if$
880      word.in swap$ *
881    }
882  if$
883}
884FUNCTION {format.thesis.type}
885{ type duplicate$ empty$
886    'pop$
887    { swap$ pop$
888      "t" change.case$ "type" bibinfo.check
889    }
890  if$
891}
892FUNCTION {format.tr.number}
893{ number "number" bibinfo.check
894  type duplicate$ empty$
895    { pop$ bbl.techrep }
896    'skip$
897  if$
898  "type" bibinfo.check
899  swap$ duplicate$ empty$
900    { pop$ "t" change.case$ }
901    { tie.or.space.prefix * * }
902  if$
903}
904FUNCTION {format.article.crossref}
905{
906  word.in
907  " \cite{" * crossref * "}" *
908}
909FUNCTION {format.book.crossref}
910{ volume duplicate$ empty$
911    { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
912      pop$ word.in
913    }
914    { bbl.volume
915      capitalize
916      swap$ tie.or.space.prefix "volume" bibinfo.check * * bbl.of space.word *
917    }
918  if$
919  " \cite{" * crossref * "}" *
920}
921FUNCTION {format.incoll.inproc.crossref}
922{
923  word.in
924  " \cite{" * crossref * "}" *
925}
926FUNCTION {format.org.or.pub}
927{ 't :=
928  ""
929  address empty$ t empty$ and
930    'skip$
931    {
932      address "address" bibinfo.check *
933      t empty$
934        'skip$
935        { address empty$
936            'skip$
937            { ": " * }
938          if$
939          t *
940        }
941      if$
942    }
943  if$
944}
945FUNCTION {format.publisher.address}
946{ publisher "publisher" bibinfo.check format.org.or.pub
947}
948
949FUNCTION {format.organization.address}
950{ organization "organization" bibinfo.check format.org.or.pub
951}
952
953FUNCTION {article}
954{ "%Type = Article" write$
955  output.bibitem
956  format.authors "author" output.check
957  author format.key output
958  new.block
959  format.title "title" output.check
960  new.block
961  crossref missing$
962    {
963      journal
964      remove.dots
965      "journal" bibinfo.check
966      emphasize
967      "journal" output.check
968      add.blank
969      format.date "year" output.check
970      date.block
971      format.vol.num.pages output
972    }
973    { format.article.crossref output.nonnull
974    }
975  if$
976  eid empty$
977    { format.journal.pages }
978    { format.journal.eid }
979  if$
980  format.doi output
981  new.block
982  format.note output
983  format.eprint output
984  format.url output
985  fin.entry
986}
987FUNCTION {book}
988{ "%Type = Book" write$
989  output.bibitem
990  author empty$
991    { format.editors "author and editor" output.check
992      editor format.key output
993    }
994    { format.authors output.nonnull
995      crossref missing$
996        { "author and editor" editor either.or.check }
997        'skip$
998      if$
999    }
1000  if$
1001  new.block
1002  format.btitle "title" output.check
1003  crossref missing$
1004    { format.bvolume output
1005      new.block
1006      new.sentence
1007      format.number.series output
1008      format.edition output
1009      format.publisher.address output
1010    }
1011    {
1012      new.block
1013      format.book.crossref output.nonnull
1014    }
1015  if$
1016  format.date "year" output.check
1017  format.isbn output
1018  format.doi output
1019  new.block
1020  format.note output
1021  format.eprint output
1022  format.url output
1023  fin.entry
1024}
1025FUNCTION {booklet}
1026{ "%Type = Booklet" write$
1027  output.bibitem
1028  format.authors output
1029  author format.key output
1030  new.block
1031  format.title "title" output.check
1032  new.block
1033  howpublished "howpublished" bibinfo.check output
1034  address "address" bibinfo.check output
1035  format.date "year" output.check
1036  format.isbn output
1037  format.doi output
1038  new.block
1039  format.note output
1040  format.eprint output
1041  format.url output
1042  fin.entry
1043}
1044
1045FUNCTION {inbook}
1046{ "%Type = Inbook" write$
1047  output.bibitem
1048  author empty$
1049    { format.editors "author and editor" output.check
1050      editor format.key output
1051    }
1052    { format.authors output.nonnull
1053      crossref missing$
1054        { "author and editor" editor either.or.check }
1055        'skip$
1056      if$
1057    }
1058  if$
1059  new.block
1060  format.btitle "title" output.check
1061  crossref missing$
1062    {
1063      format.bvolume output
1064      format.chapter.pages "chapter and pages" output.check
1065      new.block
1066      new.sentence
1067      format.number.series output
1068      format.publisher.address output
1069    }
1070    {
1071      format.chapter.pages "chapter and pages" output.check
1072      new.block
1073      format.book.crossref output.nonnull
1074    }
1075  if$
1076  format.edition output
1077  crossref missing$
1078    { format.isbn output }
1079    'skip$
1080  if$
1081  format.date "year" output.check
1082  book.date.block
1083  format.pages "pages" output.check
1084  format.doi output
1085  new.block
1086  format.note output
1087  format.eprint output
1088  format.url output
1089  fin.entry
1090}
1091
1092FUNCTION {incollection}
1093{ "%Type = Incollection" write$
1094  output.bibitem
1095  format.authors "author" output.check
1096  author format.key output
1097  new.block
1098  format.title "title" output.check
1099  new.block
1100  crossref missing$
1101    { format.in.ed.booktitle "booktitle" output.check
1102      format.bvolume output
1103      format.chapter.pages output
1104      new.sentence
1105      format.number.series output
1106      format.publisher.address output
1107      format.edition output
1108      format.isbn output
1109    }
1110    { format.incoll.inproc.crossref output.nonnull
1111      format.chapter.pages output
1112    }
1113  if$
1114  format.date "year" output.check
1115  book.date.block
1116  format.pages "pages" output.check
1117  format.doi output
1118  new.block
1119  format.note output
1120  format.eprint output
1121  format.url output
1122  fin.entry
1123}
1124FUNCTION {inproceedings}
1125{ "%Type = Inproceedings" write$
1126  output.bibitem
1127  format.authors "author" output.check
1128  author format.key output
1129  new.block
1130  format.title "title" output.check
1131  new.block
1132  crossref missing$
1133    { format.in.ed.booktitle "booktitle" output.check
1134      format.bvolume output
1135      new.sentence
1136      format.number.series output
1137      publisher empty$
1138        { format.organization.address output }
1139        { organization "organization" bibinfo.check output
1140          format.publisher.address output
1141        }
1142      if$
1143      format.isbn output
1144    }
1145    { format.incoll.inproc.crossref output.nonnull
1146    }
1147  if$
1148  format.date "year" output.check
1149  book.date.block
1150  format.pages "pages" output.check
1151  format.doi output
1152  new.block
1153  format.note output
1154  format.eprint output
1155  format.url output
1156  fin.entry
1157}
1158FUNCTION {conference} { inproceedings }
1159FUNCTION {manual}
1160{ "%Type = Manual" write$
1161  output.bibitem
1162  format.authors output
1163  author format.key output
1164  new.block
1165  format.btitle "title" output.check
1166  organization address new.block.checkb
1167  organization "organization" bibinfo.check output
1168  address "address" bibinfo.check output
1169  format.edition output
1170  format.date "year" output.check
1171  format.doi output
1172  new.block
1173  format.note output
1174  format.eprint output
1175  format.url output
1176  fin.entry
1177}
1178
1179FUNCTION {mastersthesis}
1180{ "%Type = Mastersthesis" write$
1181  output.bibitem
1182  format.authors "author" output.check
1183  author format.key output
1184  new.block
1185  format.title
1186  "title" output.check
1187  new.block
1188  bbl.mthesis format.thesis.type output.nonnull
1189  school "school" bibinfo.warn output
1190  address "address" bibinfo.check output
1191  format.date "year" output.check
1192  format.doi output
1193  new.block
1194  format.note output
1195  format.eprint output
1196  format.url output
1197  fin.entry
1198}
1199
1200FUNCTION {misc}
1201{ "%Type = Misc" write$
1202  output.bibitem
1203  format.authors output
1204  author format.key output
1205  new.block
1206  format.title output
1207  new.block
1208  howpublished "howpublished" bibinfo.check output
1209  format.date "year" output.check
1210  format.doi output
1211  new.block
1212  format.note output
1213  format.eprint output
1214  format.url output
1215  fin.entry
1216}
1217FUNCTION {phdthesis}
1218{ "%Type = Phdthesis" write$
1219  output.bibitem
1220  format.authors "author" output.check
1221  author format.key output
1222  new.block
1223  format.title
1224  "title" output.check
1225  new.block
1226  bbl.phdthesis format.thesis.type output.nonnull
1227  school "school" bibinfo.warn output
1228  address "address" bibinfo.check output
1229  format.date "year" output.check
1230  format.doi output
1231  new.block
1232  format.note output
1233  format.eprint output
1234  format.url output
1235  fin.entry
1236}
1237
1238FUNCTION {proceedings}
1239{ "%Type = Proceedings" write$
1240  output.bibitem
1241  format.editors output
1242  editor format.key output
1243  new.block
1244  format.btitle "title" output.check
1245  format.bvolume output
1246  new.sentence
1247  format.number.series output
1248  publisher empty$
1249    { format.organization.address output }
1250    { organization "organization" bibinfo.check output
1251      format.publisher.address output
1252    }
1253  if$
1254  format.date "year" output.check
1255  format.isbn output
1256  format.doi output
1257  new.block
1258  format.note output
1259  format.eprint output
1260  format.url output
1261  fin.entry
1262}
1263
1264FUNCTION {techreport}
1265{ "%Type = Techreport" write$
1266  output.bibitem
1267  format.authors "author" output.check
1268  author format.key output
1269  new.block
1270  format.title
1271  "title" output.check
1272  new.block
1273  format.tr.number output.nonnull
1274  institution "institution" bibinfo.warn output
1275  address "address" bibinfo.check output
1276  format.date "year" output.check
1277  format.doi output
1278  new.block
1279  format.note output
1280  format.eprint output
1281  format.url output
1282  fin.entry
1283}
1284
1285FUNCTION {unpublished}
1286{ "%Type = Unpublished" write$
1287  output.bibitem
1288  format.authors "author" output.check
1289  author format.key output
1290  new.block
1291  format.title "title" output.check
1292  format.date "year" output.check
1293  format.doi output
1294  new.block
1295  format.note "note" output.check
1296  format.eprint output
1297  format.url output
1298  fin.entry
1299}
1300
1301FUNCTION {default.type} { misc }
1302READ
1303FUNCTION {sortify}
1304{ purify$
1305  "l" change.case$
1306}
1307INTEGERS { len }
1308FUNCTION {chop.word}
1309{ 's :=
1310  'len :=
1311  s #1 len substring$ =
1312    { s len #1 + global.max$ substring$ }
1313    's
1314  if$
1315}
1316FUNCTION {format.lab.names}
1317{ 's :=
1318  "" 't :=
1319  s #1 "{vv~}{ll}" format.name$
1320  s num.names$ duplicate$
1321  #2 >
1322    { pop$
1323      " " * bbl.etal *
1324    }
1325    { #2 <
1326        'skip$
1327        { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
1328            {
1329              " " * bbl.etal *
1330            }
1331            { bbl.and space.word * s #2 "{vv~}{ll}" format.name$
1332              * }
1333          if$
1334        }
1335      if$
1336    }
1337  if$
1338}
1339
1340FUNCTION {author.key.label}
1341{ author empty$
1342    { key empty$
1343        { cite$ #1 #3 substring$ }
1344        'key
1345      if$
1346    }
1347    { author format.lab.names }
1348  if$
1349}
1350
1351FUNCTION {author.editor.key.label}
1352{ author empty$
1353    { editor empty$
1354        { key empty$
1355            { cite$ #1 #3 substring$ }
1356            'key
1357          if$
1358        }
1359        { editor format.lab.names }
1360      if$
1361    }
1362    { author format.lab.names }
1363  if$
1364}
1365
1366FUNCTION {editor.key.label}
1367{ editor empty$
1368    { key empty$
1369        { cite$ #1 #3 substring$ }
1370        'key
1371      if$
1372    }
1373    { editor format.lab.names }
1374  if$
1375}
1376
1377FUNCTION {calc.short.authors}
1378{ type$ "book" =
1379  type$ "inbook" =
1380  or
1381    'author.editor.key.label
1382    { type$ "proceedings" =
1383        'editor.key.label
1384        'author.key.label
1385      if$
1386    }
1387  if$
1388  'short.list :=
1389}
1390
1391FUNCTION {calc.label}
1392{ calc.short.authors
1393  short.list
1394  "("
1395  *
1396  year duplicate$ empty$
1397     { pop$ "????" }
1398     { purify$ #-1 #4 substring$ }
1399  if$
1400  *
1401  'label :=
1402}
1403
1404FUNCTION {sort.format.names}
1405{ 's :=
1406  #1 'nameptr :=
1407  ""
1408  s num.names$ 'numnames :=
1409  numnames 'namesleft :=
1410    { namesleft #0 > }
1411    { s nameptr
1412      "{vv{ } }{ll{ }}{  f{ }}{  jj{ }}"
1413%      "{vv~}{ll~}{\rd[f.f.]}{jj~}"
1414      format.name$ 't :=
1415      nameptr #1 >
1416        {
1417          "   "  *
1418          namesleft #1 = t "others" = and
1419            { "zzzzz" * }
1420            { t sortify * }
1421          if$
1422        }
1423        { t sortify * }
1424      if$
1425      nameptr #1 + 'nameptr :=
1426      namesleft #1 - 'namesleft :=
1427    }
1428  while$
1429}
1430
1431FUNCTION {sort.format.title}
1432{ 't :=
1433  "A " #2
1434    "An " #3
1435      "The " #4 t chop.word
1436    chop.word
1437  chop.word
1438  sortify
1439  #1 global.max$ substring$
1440}
1441FUNCTION {author.sort}
1442{ author empty$
1443    { key empty$
1444        { "to sort, need author or key in " cite$ * warning$
1445          ""
1446        }
1447        { key sortify }
1448      if$
1449    }
1450    { author sort.format.names }
1451  if$
1452}
1453FUNCTION {author.editor.sort}
1454{ author empty$
1455    { editor empty$
1456        { key empty$
1457            { "to sort, need author, editor, or key in " cite$ * warning$
1458              ""
1459            }
1460            { key sortify }
1461          if$
1462        }
1463        { editor sort.format.names }
1464      if$
1465    }
1466    { author sort.format.names }
1467  if$
1468}
1469FUNCTION {editor.sort}
1470{ editor empty$
1471    { key empty$
1472        { "to sort, need editor or key in " cite$ * warning$
1473          ""
1474        }
1475        { key sortify }
1476      if$
1477    }
1478    { editor sort.format.names }
1479  if$
1480}
1481INTEGERS { seq.num }
1482FUNCTION {init.seq}
1483{ #0 'seq.num :=}
1484EXECUTE {init.seq}
1485FUNCTION {int.to.fix}
1486{ "000000000" swap$ int.to.str$ *
1487  #-1 #10 substring$
1488}
1489FUNCTION {presort}
1490{ calc.label
1491  label sortify
1492  "    "
1493  *
1494  seq.num #1 + 'seq.num :=
1495  seq.num  int.to.fix
1496  'sort.label :=
1497  sort.label
1498  *
1499  "    "
1500  *
1501  title field.or.null
1502  sort.format.title
1503  *
1504  #1 entry.max$ substring$
1505  'sort.key$ :=
1506}
1507
1508ITERATE {presort}
1509SORT
1510STRINGS { last.label next.extra }
1511INTEGERS { last.extra.num number.label }
1512FUNCTION {initialize.extra.label.stuff}
1513{ #0 int.to.chr$ 'last.label :=
1514  "" 'next.extra :=
1515  #0 'last.extra.num :=
1516  #0 'number.label :=
1517}
1518FUNCTION {forward.pass}
1519{ last.label label =
1520    { last.extra.num #1 + 'last.extra.num :=
1521      last.extra.num int.to.chr$ 'extra.label :=
1522    }
1523    { "a" chr.to.int$ 'last.extra.num :=
1524      "" 'extra.label :=
1525      label 'last.label :=
1526    }
1527  if$
1528  number.label #1 + 'number.label :=
1529}
1530FUNCTION {reverse.pass}
1531{ next.extra "b" =
1532    { "a" 'extra.label := }
1533    'skip$
1534  if$
1535  extra.label 'next.extra :=
1536  extra.label
1537  duplicate$ empty$
1538    'skip$
1539    { "{\natexlab{" swap$ * "}}" * }
1540  if$
1541  'extra.label :=
1542  label extra.label * 'label :=
1543}
1544EXECUTE {initialize.extra.label.stuff}
1545ITERATE {forward.pass}
1546REVERSE {reverse.pass}
1547FUNCTION {bib.sort.order}
1548{ sort.label
1549  "    "
1550  *
1551  year field.or.null sortify
1552  *
1553  "    "
1554  *
1555  title field.or.null
1556  sort.format.title
1557  *
1558  #1 entry.max$ substring$
1559  'sort.key$ :=
1560}
1561ITERATE {bib.sort.order}
1562SORT
1563FUNCTION {begin.bib}
1564{ preamble$ empty$
1565    'skip$
1566    { preamble$ write$ newline$ }
1567  if$
1568  "\begin{thebibliography}{" number.label int.to.str$ * "}" *
1569  write$ newline$
1570  "\providecommand{\natexlab}[1]{#1}"
1571  write$ newline$
1572  "\providecommand{\url}[1]{\texttt{#1}}"
1573  write$ newline$
1574  "\providecommand{\urlprefix}{URL }"
1575  write$ newline$
1576  "\expandafter\ifx\csname urlstyle\endcsname\relax"
1577  write$ newline$
1578  "  \providecommand{\doi}[1]{doi:\discretionary{}{}{}#1}\else"
1579  write$ newline$
1580  "  \providecommand{\doi}{doi:\discretionary{}{}{}\begingroup \urlstyle{rm}\Url}\fi"
1581  write$ newline$
1582  "\providecommand{\eprint}[2][]{\url{#2}}"
1583  write$ newline$
1584  "\providecommand{\BIBand}{and}"
1585  write$ newline$
1586  "\providecommand{\bibinfo}[2]{#2}"
1587  write$ newline$
1588        "\ifx\xfnm\undefined \def\xfnm[#1]{\unskip,\space#1}\fi"
1589  write$ newline$
1590  "\makeatletter\def\@biblabel#1{#1.}\makeatother"
1591  write$ newline$
1592}
1593EXECUTE {begin.bib}
1594EXECUTE {init.state.consts}
1595ITERATE {call.type$}
1596FUNCTION {end.bib}
1597{ newline$
1598  "\end{thebibliography}" write$ newline$
1599}
1600EXECUTE {end.bib}
1601%% End of customized bst file
1602%%
1603%% End of file `model6-num-names.bst'.
1604
Note: See TracBrowser for help on using the repository browser.