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

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