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

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