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

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