source: CMDI-Interoperability/CMD2RDF/trunk/docs/papers/2014-LREC-CMDcloud/lrec2014.bst @ 4757

Last change on this file since 4757 was 4757, checked in by xnrn@gmx.net, 10 years ago

updated layout (to lrec2014 template)
reactivated some comments for the full version

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