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

Revision 593, 24.8 KB checked in by wojtekp, 12 years ago (diff)
Line 
1%%
2%% This is file `model1c-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: model1c-num-names.bst 139 2009-10-07 12:24:10Z rishi $
17%%
18%% $URL: http://lenova.river-valley.com/svn/elsbst/trunk/New-Model-1c/model1c-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  crossref missing$
812    {
813      journal
814      "journal" bibinfo.check
815      "journal" output.check
816      add.blank
817      format.vol.num.pages output
818    }
819    { format.article.crossref output.nonnull
820    }
821  if$
822  format.journal.pages
823  new.sentence
824  format.note output
825  fin.entry
826}
827FUNCTION {book}
828{ "%Type = Book" write$
829  output.bibitem
830  author empty$
831    { format.editors "author and editor" output.check
832      editor format.key output
833    }
834    { format.authors output.nonnull
835      crossref missing$
836        { "author and editor" editor either.or.check }
837        'skip$
838      if$
839    }
840  if$
841  format.btitle "title" output.check
842  crossref missing$
843    { format.bvolume output
844      format.number.series output
845      format.publisher.address output
846    }
847    {
848      format.book.crossref output.nonnull
849    }
850  if$
851  format.edition output
852  format.date "year" output.check
853  new.sentence
854  format.note output
855  fin.entry
856}
857FUNCTION {booklet}
858{ "%Type = Booklet" write$
859  output.bibitem
860  format.authors output
861  author format.key output
862  format.title "title" output.check
863  howpublished "howpublished" bibinfo.check output
864  address "address" bibinfo.check output
865  format.date "year" output.check
866  new.sentence
867  format.note output
868  fin.entry
869}
870
871FUNCTION {inbook}
872{ "%Type = Inbook" write$
873  output.bibitem
874  author empty$
875    { format.editors "author and editor" output.check
876      editor format.key output
877    }
878    { format.authors output.nonnull
879      crossref missing$
880        { "author and editor" editor either.or.check }
881        'skip$
882      if$
883    }
884  if$
885  format.btitle "title" output.check
886  crossref missing$
887    {
888      format.bvolume output
889      format.number.series output
890      format.publisher.address output
891      format.date "year" output.check
892    }
893    {
894      format.book.crossref output.nonnull
895    }
896  if$
897  format.edition output
898  format.pages "pages" output.check
899  new.sentence
900  format.note output
901  fin.entry
902}
903
904FUNCTION {incollection}
905{ "%Type = Incollection" write$
906  output.bibitem
907  format.authors "author" output.check
908  author format.key output
909  crossref missing$
910    { format.in.ed.booktitle "booktitle" output.check
911      format.bvolume output
912      format.number.series output
913      format.publisher.address output
914      format.date "year" output.check
915      format.edition output
916    }
917    { format.incoll.inproc.crossref output.nonnull
918    }
919  if$
920  format.pages "pages" output.check
921  new.sentence
922  format.note output
923  fin.entry
924}
925FUNCTION {inproceedings}
926{ "%Type = Inproceedings" write$
927  output.bibitem
928  format.authors "author" output.check
929  author format.key output
930  crossref missing$
931    {
932      journal
933      "journal" bibinfo.check
934      "journal" output.check
935      format.in.ed.booktitle "booktitle" output.check
936      format.bvolume output
937      format.number.series output
938      publisher empty$
939        { format.organization.address output }
940        { organization "organization" bibinfo.check output
941          format.publisher.address output
942          format.date "year" output.check
943        }
944      if$
945    }
946    { format.incoll.inproc.crossref output.nonnull
947    }
948  if$
949  format.pages "pages" output.check
950  new.sentence
951  format.note output
952  fin.entry
953}
954FUNCTION {conference} { inproceedings }
955FUNCTION {manual}
956{ "%Type = Manual" write$
957  output.bibitem
958  format.authors output
959  author format.key output
960  format.btitle "title" output.check
961  organization "organization" bibinfo.check output
962  address "address" bibinfo.check output
963  format.edition output
964  format.date "year" output.check
965  new.sentence
966  format.note output
967  fin.entry
968}
969
970FUNCTION {mastersthesis}
971{ "%Type = Masterthesis" write$
972  output.bibitem
973  format.authors "author" output.check
974  author format.key output
975  format.btitle
976  "title" output.check
977  bbl.mthesis format.thesis.type output.nonnull
978  school "school" bibinfo.warn output
979  address "address" bibinfo.check output
980  format.date "year" output.check
981  new.sentence
982  format.note output
983  fin.entry
984}
985
986FUNCTION {misc}
987{ "%Type = Misc" write$
988  output.bibitem
989  format.authors output
990  author format.key output
991  format.title output
992  howpublished "howpublished" bibinfo.check output
993  format.date "year" output.check
994  new.sentence
995  format.note output
996  fin.entry
997}
998FUNCTION {phdthesis}
999{ "%Type = Phdthesis" write$
1000  output.bibitem
1001  format.authors "author" output.check
1002  author format.key output
1003  format.btitle
1004  "title" output.check
1005  bbl.phdthesis format.thesis.type output.nonnull
1006  school "school" bibinfo.warn output
1007  address "address" bibinfo.check output
1008  format.date "year" output.check
1009  new.sentence
1010  format.note output
1011  fin.entry
1012}
1013
1014FUNCTION {proceedings}
1015{ "%Type = Proceedings" write$
1016  output.bibitem
1017  format.editors output
1018  editor format.key output
1019  format.btitle "title" output.check
1020  format.bvolume output
1021  format.number.series output
1022  publisher empty$
1023    { format.organization.address output }
1024    { organization "organization" bibinfo.check output
1025      format.publisher.address output
1026    }
1027  if$
1028  format.date "year" output.check
1029  new.sentence
1030  format.note output
1031  fin.entry
1032}
1033
1034FUNCTION {techreport}
1035{ "%Type = Techreport" write$
1036  output.bibitem
1037  format.authors "author" output.check
1038  author format.key output
1039  format.btitle
1040  "title" output.check
1041  format.tr.number output.nonnull
1042  institution "institution" bibinfo.warn output
1043  address "address" bibinfo.check output
1044  format.date "year" output.check
1045  new.sentence
1046  format.note output
1047  fin.entry
1048}
1049
1050FUNCTION {unpublished}
1051{ "%Type = Unpublished" write$
1052  output.bibitem
1053  format.authors "author" output.check
1054  author format.key output
1055  format.title "title" output.check
1056  format.date "year" output.check
1057  new.sentence
1058  format.note "note" output.check
1059  fin.entry
1060}
1061
1062FUNCTION {default.type} { misc }
1063READ
1064FUNCTION {sortify}
1065{ purify$
1066  "l" change.case$
1067}
1068INTEGERS { len }
1069FUNCTION {chop.word}
1070{ 's :=
1071  'len :=
1072  s #1 len substring$ =
1073    { s len #1 + global.max$ substring$ }
1074    's
1075  if$
1076}
1077FUNCTION {format.lab.names}
1078{ 's :=
1079  "" 't :=
1080  s #1 "{vv~}{ll}" format.name$
1081  s num.names$ duplicate$
1082  #2 >
1083    { pop$
1084      " " * bbl.etal *
1085    }
1086    { #2 <
1087        'skip$
1088        { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
1089            {
1090              " " * bbl.etal *
1091            }
1092            { bbl.and space.word * s #2 "{vv~}{ll}" format.name$
1093              * }
1094          if$
1095        }
1096      if$
1097    }
1098  if$
1099}
1100
1101FUNCTION {author.key.label}
1102{ author empty$
1103    { key empty$
1104        { cite$ #1 #3 substring$ }
1105        'key
1106      if$
1107    }
1108    { author format.lab.names }
1109  if$
1110}
1111
1112FUNCTION {author.editor.key.label}
1113{ author empty$
1114    { editor empty$
1115        { key empty$
1116            { cite$ #1 #3 substring$ }
1117            'key
1118          if$
1119        }
1120        { editor format.lab.names }
1121      if$
1122    }
1123    { author format.lab.names }
1124  if$
1125}
1126
1127FUNCTION {editor.key.label}
1128{ editor empty$
1129    { key empty$
1130        { cite$ #1 #3 substring$ }
1131        'key
1132      if$
1133    }
1134    { editor format.lab.names }
1135  if$
1136}
1137
1138FUNCTION {calc.short.authors}
1139{ type$ "book" =
1140  type$ "inbook" =
1141  or
1142    'author.editor.key.label
1143    { type$ "proceedings" =
1144        'editor.key.label
1145        'author.key.label
1146      if$
1147    }
1148  if$
1149  'short.list :=
1150}
1151
1152FUNCTION {calc.label}
1153{ calc.short.authors
1154  short.list
1155  "("
1156  *
1157  year duplicate$ empty$
1158     { pop$ "????" }
1159     { purify$ #-1 #4 substring$ }
1160  if$
1161  *
1162  'label :=
1163}
1164
1165FUNCTION {sort.format.names}
1166{ 's :=
1167  #1 'nameptr :=
1168  ""
1169  s num.names$ 'numnames :=
1170  numnames 'namesleft :=
1171    { namesleft #0 > }
1172    { s nameptr
1173      "{ll{ }}{  f{ }}{  jj{ }}"
1174      format.name$ 't :=
1175      nameptr #1 >
1176        {
1177          "   "  *
1178          namesleft #1 = t "others" = and
1179            { "zzzzz" * }
1180            { t sortify * }
1181          if$
1182        }
1183        { t sortify * }
1184      if$
1185      nameptr #1 + 'nameptr :=
1186      namesleft #1 - 'namesleft :=
1187    }
1188  while$
1189}
1190
1191FUNCTION {sort.format.title}
1192{ 't :=
1193  "A " #2
1194    "An " #3
1195      "The " #4 t chop.word
1196    chop.word
1197  chop.word
1198  sortify
1199  #1 global.max$ substring$
1200}
1201FUNCTION {author.sort}
1202{ author empty$
1203    { key empty$
1204        { "to sort, need author or key in " cite$ * warning$
1205          ""
1206        }
1207        { key sortify }
1208      if$
1209    }
1210    { author sort.format.names }
1211  if$
1212}
1213FUNCTION {author.editor.sort}
1214{ author empty$
1215    { editor empty$
1216        { key empty$
1217            { "to sort, need author, editor, or key in " cite$ * warning$
1218              ""
1219            }
1220            { key sortify }
1221          if$
1222        }
1223        { editor sort.format.names }
1224      if$
1225    }
1226    { author sort.format.names }
1227  if$
1228}
1229FUNCTION {editor.sort}
1230{ editor empty$
1231    { key empty$
1232        { "to sort, need editor or key in " cite$ * warning$
1233          ""
1234        }
1235        { key sortify }
1236      if$
1237    }
1238    { editor sort.format.names }
1239  if$
1240}
1241FUNCTION {presort}
1242{ calc.label
1243  label sortify
1244  "    "
1245  *
1246  type$ "book" =
1247  type$ "inbook" =
1248  or
1249    'author.editor.sort
1250    { type$ "proceedings" =
1251        'editor.sort
1252        'author.sort
1253      if$
1254    }
1255  if$
1256  #1 entry.max$ substring$
1257  'sort.label :=
1258  sort.label
1259  *
1260  "    "
1261  *
1262  title field.or.null
1263  sort.format.title
1264  *
1265  #1 entry.max$ substring$
1266  'sort.key$ :=
1267}
1268
1269ITERATE {presort}
1270SORT
1271STRINGS { last.label next.extra }
1272INTEGERS { last.extra.num number.label }
1273FUNCTION {initialize.extra.label.stuff}
1274{ #0 int.to.chr$ 'last.label :=
1275  "" 'next.extra :=
1276  #0 'last.extra.num :=
1277  #0 'number.label :=
1278}
1279FUNCTION {forward.pass}
1280{ last.label label =
1281    { last.extra.num #1 + 'last.extra.num :=
1282      last.extra.num int.to.chr$ 'extra.label :=
1283    }
1284    { "a" chr.to.int$ 'last.extra.num :=
1285      "" 'extra.label :=
1286      label 'last.label :=
1287    }
1288  if$
1289  number.label #1 + 'number.label :=
1290}
1291FUNCTION {reverse.pass}
1292{ next.extra "b" =
1293    { "a" 'extra.label := }
1294    'skip$
1295  if$
1296  extra.label 'next.extra :=
1297  extra.label
1298  duplicate$ empty$
1299    'skip$
1300    { "{\natexlab{" swap$ * "}}" * }
1301  if$
1302  'extra.label :=
1303  label extra.label * 'label :=
1304}
1305EXECUTE {initialize.extra.label.stuff}
1306ITERATE {forward.pass}
1307REVERSE {reverse.pass}
1308FUNCTION {bib.sort.order}
1309{ sort.label
1310  "    "
1311  *
1312  year field.or.null sortify
1313  *
1314  "    "
1315  *
1316  title field.or.null
1317  sort.format.title
1318  *
1319  #1 entry.max$ substring$
1320  'sort.key$ :=
1321}
1322ITERATE {bib.sort.order}
1323SORT
1324FUNCTION {begin.bib}
1325{ preamble$ empty$
1326    'skip$
1327    { preamble$ write$ newline$ }
1328  if$
1329  "\begin{thebibliography}{" number.label int.to.str$ * "}" *
1330  write$ newline$
1331  "\expandafter\ifx\csname natexlab\endcsname\relax\def\natexlab#1{#1}\fi"
1332  write$ newline$
1333  "\providecommand{\bibinfo}[2]{#2}"
1334  write$ newline$
1335        "\ifx\xfnm\relax \def\xfnm[#1]{\unskip,\space#1}\fi"
1336  write$ newline$
1337}
1338EXECUTE {begin.bib}
1339EXECUTE {init.state.consts}
1340ITERATE {call.type$}
1341FUNCTION {end.bib}
1342{ newline$
1343  "\end{thebibliography}" write$ newline$
1344}
1345EXECUTE {end.bib}
1346%% End of customized bst file
1347%%
1348%% End of file `model1c-num-names.bst'.
Note: See TracBrowser for help on using the repository browser.