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