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

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