source: trunk/UTIL/PYTHON/bibweb/custom.bst @ 967

Last change on this file since 967 was 967, checked in by aslmd, 12 years ago

UTIL PYTHON a tool to build automatic web page with ADS

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