1 % PROTEINS bibliography style (3-Mar-93 version)
4 % 4/22/92 Cindy Fisher---Original version for BibTeX 0.99c
5 % THIS `proteins' VERSION DOES NOT WORK WITH BIBTEX 0.98i.
6 % For Proteins: Struct. Func. Genet. journal
8 % 3/3/93 Cindy Fisher---Fixed editors bug in function "inproceedings"
38 INTEGERS { output.state before.all mid.sentence after.sentence after.block }
40 FUNCTION {init.state.consts}
49 FUNCTION {output.nonnull}
51 output.state mid.sentence =
53 { output.state after.block =
58 { output.state before.all =
60 { add.period$ " " * write$ }
64 mid.sentence 'output.state :=
77 FUNCTION {output.check}
80 { pop$ "empty " t * " in " * cite$ * warning$ }
85 FUNCTION {output.bibitem}
92 before.all 'output.state :=
102 { output.state before.all =
104 { after.block 'output.state := }
108 FUNCTION {new.sentence}
109 { output.state after.block =
111 { output.state before.all =
113 { after.sentence 'output.state := }
137 FUNCTION {new.block.checka}
144 FUNCTION {new.block.checkb}
153 FUNCTION {field.or.null}
163 { "{\em " swap$ * "}" * }
167 FUNCTION {emphasizeic}
170 { "{\em " swap$ * "\/}" * }
177 { "{\sc " swap$ * "}" * }
184 { "{\bf " swap$ * "}" * }
188 FUNCTION {boldfaceic}
191 { "{\bf " swap$ * "\/}" * }
195 INTEGERS { nameptr namesleft numnames }
197 FUNCTION {format.names}
200 s num.names$ 'numnames :=
201 numnames 'namesleft :=
203 { s nameptr "{vv~}{ll}{, f.}{~jj}" format.name$ 't :=
208 { " {\em et~al}." * }
216 nameptr #1 + 'nameptr :=
217 namesleft #1 - 'namesleft :=
222 % For names inside entries (e.g., editors of an "In ...");
223 % this is exactly ABBRV.BST's `format.names' function.
224 FUNCTION {format.innames}
227 s num.names$ 'numnames :=
228 numnames 'namesleft :=
230 { s nameptr "{f.~}{vv~}{ll}{, jj}" format.name$ 't :=
239 { " {\em et~al}." * }
247 nameptr #1 + 'nameptr :=
248 namesleft #1 - 'namesleft :=
253 FUNCTION {format.authors}
256 { author format.names }
260 FUNCTION {format.editors}
263 { editor format.names
264 editor num.names$ #1 >
272 FUNCTION {format.ineditors}
275 { editor num.names$ #1 >
276 { editor format.names * " eds. " * }
277 { editor format.names * " ed. " * }
283 FUNCTION {format.title}
286 { title "t" change.case$ }
294 { t #1 #1 substring$ "-" =
295 { t #1 #2 substring$ "--" = not
297 t #2 global.max$ substring$ 't :=
299 { { t #1 #1 substring$ "-" = }
301 t #2 global.max$ substring$ 't :=
307 { t #1 #1 substring$ *
308 t #2 global.max$ substring$ 't :=
315 FUNCTION {format.date}
319 { "there's a month but no year in " cite$ * warning$
326 { month " " * year * }
332 FUNCTION {format.btitle}
336 FUNCTION {tie.or.space.connect}
337 { duplicate$ text.length$ #3 <
344 FUNCTION {either.or.check}
347 { "can't use both " swap$ * " fields in " * cite$ * warning$ }
351 FUNCTION {format.bvolume}
354 { "Vol.~" volume * ". " *
357 { " of " * series emphasize * }
359 "volume and number" number either.or.check
364 FUNCTION {format.number.series}
367 { series field.or.null }
368 { output.state mid.sentence =
374 { "there's a number but no series in " cite$ * warning$ }
375 { " in " * series * }
384 FUNCTION {format.edition}
387 { output.state mid.sentence =
388 { edition "l" change.case$ "~Ed." * }
389 { edition "t" change.case$ "~Ed." * }
395 FUNCTION {format.pages}
402 INTEGERS { multiresult }
404 FUNCTION {multi.page.check}
413 swap$ duplicate$ "," =
416 { #1 'multiresult := }
417 { t #2 global.max$ substring$ 't := }
426 STRINGS {current.char}
428 FUNCTION {take.first.page}
431 { t char.num #1 substring$ 'current.char :=
434 current.char "" = or or not
436 { char.num #1 + 'char.num := }
438 char.num #1 - 'char.num :=
439 t #1 char.num substring$
442 FUNCTION {format.pp.pages}
445 { pages multi.page.check
446 { "~" pages n.dashify * }
453 FUNCTION {format.vol.num.pages.date}
454 { volume field.or.null
457 { "(" number * ")" * *
459 { "there's a number but no volume in " cite$ * warning$ }
467 { pop$ format.pages }
468 { ":" * pages n.dashify * }
471 { "empty year in " cite$ * warning$ }
472 { ", " * format.date * }
478 FUNCTION {format.chapter.pages}
483 { type "l" change.case$ chapter tie.or.space.connect }
487 { ", " * format.pp.pages * }
493 FUNCTION {format.in.booktitle.ed}
496 { "In: " booktitle * ". " *
499 { "Vol. " * volume * ". " *}
509 FUNCTION {format.in.ed.booktitle}
515 { ", " * format.ineditors * }
521 FUNCTION {format.address.publisher.date.pages}
523 { "empty address in " cite$ * warning$ }
527 { "empty publisher in " cite$ * warning$ }
528 { ": " * publisher * }
531 { "empty year in " cite$ * warning$ }
532 { ". " * format.date * }
536 { ": " * format.pages *}
540 FUNCTION {format.address.publisher.date}
542 { "empty address in " cite$ * warning$ }
546 { "empty publisher in " cite$ * warning$ }
547 { ": " * publisher * }
550 { "empty year in " cite$ * warning$ }
551 { ". " * format.date * }
555 FUNCTION {format.proc.date}
559 { "empty year in " cite$ * warning$
581 FUNCTION {format.in.proc.date}
584 { "In " booktitle format.proc.date * }
588 FUNCTION {empty.misc.check}
589 { author empty$ title empty$ howpublished empty$
590 month empty$ year empty$ note empty$
593 { "all relevant fields are empty in " cite$ * warning$ }
598 FUNCTION {format.thesis.type}
602 type "t" change.case$
607 FUNCTION {format.tr.number}
614 { number tie.or.space.connect }
618 FUNCTION {format.article.crossref}
621 { "need key or journal for " cite$ * " to crossref " * crossref *
625 { "In {\em " journal * "\/}" * }
630 " \cite{" * crossref * "}" *
633 FUNCTION {format.crossref.editor}
634 { editor #1 "{vv~}{ll}" format.name$
635 editor num.names$ duplicate$
637 { pop$ " {\em et~al}." * }
640 { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
641 { " {\em et~al}." * }
642 { " and " * editor #2 "{vv~}{ll}" format.name$ * }
650 FUNCTION {format.book.crossref}
652 { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
660 editor field.or.null author field.or.null =
664 { "need editor, key, or series for " cite$ * " to crossref " *
668 { "{\em " * series * "\/}" * }
674 { format.crossref.editor * }
676 " \cite{" * crossref * "}" *
679 FUNCTION {format.incoll.inproc.crossref}
681 editor field.or.null author field.or.null =
685 { "need editor, key, or booktitle for " cite$ * " to crossref " *
689 { "In {\em " booktitle * "\/}" * }
695 { "In " format.crossref.editor * }
697 " \cite{" * crossref * "}" *
702 format.authors "author" output.check
704 format.title "title" output.check
707 { journal "journal" output.check
708 format.vol.num.pages.date output
710 { format.article.crossref output.nonnull
722 { format.editors "author and editor" output.check }
723 { format.authors output.nonnull
725 { "author and editor" editor either.or.check }
730 format.btitle "title" output.check
732 format.edition output
734 { format.bvolume output
735 format.number.series output
736 format.address.publisher.date output
739 format.book.crossref output.nonnull
749 format.authors output
751 format.title "title" output.check
752 howpublished address new.block.checkb
764 { format.editors "author and editor" output.check }
765 { format.authors output.nonnull
767 { "author and editor" editor either.or.check }
774 format.in.booktitle.ed output
775 format.edition output
777 { format.number.series output
778 format.address.publisher.date.pages "address and publisher" output.check
781 format.book.crossref output.nonnull
789 FUNCTION {incollection}
791 format.authors "author" output.check
793 format.title "title" output.check
796 { format.in.booktitle.ed output
797 format.edition output
798 format.bvolume output
799 format.number.series output
801 publisher "publisher" output.check
803 format.date "year" output.check
805 { format.incoll.inproc.crossref output.nonnull }
807 format.chapter.pages output
813 FUNCTION {inproceedings}
815 format.authors "author" output.check
820 { format.in.proc.date output
822 format.editors output
823 format.bvolume output
824 format.number.series output
830 { format.incoll.inproc.crossref output.nonnull }
832 % format.pp.pages output
838 FUNCTION {conference} { inproceedings }
843 { organization scapify output }
844 { format.authors output.nonnull }
847 format.title "title" output.check
848 format.edition output
850 { address new.block.checka }
851 { organization address new.block.checkb
862 FUNCTION {mastersthesis}
864 format.authors "author" output.check
866 format.title "title" output.check
868 "Master's thesis" format.thesis.type output.nonnull
870 school "school" output.check
874 format.date "year" output.check
882 format.authors output
883 title howpublished new.block.checkb
886 howpublished new.block.checka
898 format.authors "author" output.check
900 format.title "title" output.check
902 "PhD thesis" format.thesis.type output.nonnull
904 school "school" output.check
908 format.date "year" output.check
914 FUNCTION {proceedings}
917 { organization output }
918 { format.editors output.nonnull }
921 title format.proc.date "title" output.check
922 format.bvolume output
923 format.number.series output
926 { organization output }
934 FUNCTION {techreport}
936 format.authors "author" output.check
938 format.title "title" output.check
940 format.tr.number output.nonnull
942 institution "institution" output.check
945 format.date "year" output.check
951 FUNCTION {unpublished}
953 format.authors "author" output.check
955 format.title "title" output.check
957 note "note" output.check
962 FUNCTION {default.type} { misc }
980 MACRO {sep} {"Sept."}
988 MACRO {jacs} {"J. Am. Chem. Soc."}
990 MACRO {bbrc} {"Biochem. Biophys. Res. Commun."}
992 MACRO {jbc} {"J. Biol. Chem."}
994 MACRO {pnas} {"Proc. Natl. Acad. Sci. U.S.A."}
996 MACRO {jmb} {"J. Mol. Biol."}
998 MACRO {embo} {"EMBO J."}
1000 MACRO {tibs} {"Trends Biochem. Sci."}
1002 MACRO {protsfg} {"Proteins: Struct. Func. Gen."}
1013 FUNCTION {chop.word}
1016 s #1 len substring$ =
1017 { s len #1 + global.max$ substring$ }
1022 FUNCTION {sort.format.names}
1026 s num.names$ 'numnames :=
1027 numnames 'namesleft :=
1033 s nameptr "{vv{ } }{ll{ }}{ f{ }}{ jj{ }}" format.name$ 't :=
1034 nameptr numnames = t "others" = and
1035 { "{\em et al}." * }
1038 nameptr #1 + 'nameptr :=
1039 namesleft #1 - 'namesleft :=
1044 FUNCTION {sort.format.title}
1048 "The " #4 t chop.word
1052 #1 global.max$ substring$
1055 FUNCTION {author.sort}
1058 { "to sort, need author or key in " cite$ * warning$
1064 { author sort.format.names }
1068 FUNCTION {author.editor.sort}
1072 { "to sort, need author, editor, or key in " cite$ * warning$
1078 { editor sort.format.names }
1081 { author sort.format.names }
1085 FUNCTION {author.organization.sort}
1087 { organization empty$
1089 { "to sort, need author, organization, or key in " cite$ * warning$
1095 { "The " #4 organization chop.word sortify }
1098 { author sort.format.names }
1102 FUNCTION {editor.organization.sort}
1104 { organization empty$
1106 { "to sort, need editor, organization, or key in " cite$ * warning$
1112 { "The " #4 organization chop.word sortify }
1115 { editor sort.format.names }
1124 { type$ "proceedings" =
1125 'editor.organization.sort
1127 'author.organization.sort
1136 year field.or.null sortify
1143 #1 entry.max$ substring$
1151 STRINGS { longest.label }
1153 INTEGERS { number.label longest.label.width }
1155 FUNCTION {initialize.longest.label}
1156 { "" 'longest.label :=
1158 #0 'longest.label.width :=
1161 FUNCTION {longest.label.pass}
1162 { number.label int.to.str$ 'label :=
1163 number.label #1 + 'number.label :=
1164 label width$ longest.label.width >
1165 { label 'longest.label :=
1166 label width$ 'longest.label.width :=
1172 EXECUTE {initialize.longest.label}
1174 ITERATE {longest.label.pass}
1176 FUNCTION {begin.bib}
1179 { preamble$ write$ newline$ }
1181 "\begin{thebibliography}{" longest.label * "}" * write$ newline$
1186 EXECUTE {init.state.consts}
1188 ITERATE {call.type$}
1192 "\end{thebibliography}" write$ newline$