home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fonts 1 / freshfonts1.bin / programs / amiga / pastex / macros / misc / alpha.bst < prev    next >
Text File  |  1993-09-05  |  22KB  |  1,258 lines

  1. % BibTeX standard bibliography style `alpha'
  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.  
  11. ENTRY
  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 extra.label sort.label }
  37.  
  38. INTEGERS { output.state before.all mid.sentence after.sentence after.block }
  39.  
  40. FUNCTION {init.state.consts}
  41. { #0 'before.all :=
  42.   #1 'mid.sentence :=
  43.   #2 'after.sentence :=
  44.   #3 'after.block :=
  45. }
  46.  
  47. STRINGS { s t }
  48.  
  49. FUNCTION {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.  
  70. FUNCTION {output}
  71. { duplicate$ empty$
  72.     'pop$
  73.     'output.nonnull
  74.   if$
  75. }
  76.  
  77. FUNCTION {output.check}
  78. { 't :=
  79.   duplicate$ empty$
  80.     { pop$ "empty " t * " in " * cite$ * warning$ }
  81.     'output.nonnull
  82.   if$
  83. }
  84.  
  85. FUNCTION {output.bibitem}
  86. { newline$
  87.   "\bibitem[" write$
  88.   label write$
  89.   "]{" write$
  90.   cite$ write$
  91.   "}" write$
  92.   newline$
  93.   ""
  94.   before.all 'output.state :=
  95. }
  96.  
  97. FUNCTION {fin.entry}
  98. { add.period$
  99.   write$
  100.   newline$
  101. }
  102.  
  103. FUNCTION {new.block}
  104. { output.state before.all =
  105.     'skip$
  106.     { after.block 'output.state := }
  107.   if$
  108. }
  109.  
  110. FUNCTION {new.sentence}
  111. { output.state after.block =
  112.     'skip$
  113.     { output.state before.all =
  114.     'skip$
  115.     { after.sentence 'output.state := }
  116.       if$
  117.     }
  118.   if$
  119. }
  120.  
  121. FUNCTION {not}
  122. {   { #0 }
  123.     { #1 }
  124.   if$
  125. }
  126.  
  127. FUNCTION {and}
  128. {   'skip$
  129.     { pop$ #0 }
  130.   if$
  131. }
  132.  
  133. FUNCTION {or}
  134. {   { pop$ #1 }
  135.     'skip$
  136.   if$
  137. }
  138.  
  139. FUNCTION {new.block.checka}
  140. { empty$
  141.     'skip$
  142.     'new.block
  143.   if$
  144. }
  145.  
  146. FUNCTION {new.block.checkb}
  147. { empty$
  148.   swap$ empty$
  149.   and
  150.     'skip$
  151.     'new.block
  152.   if$
  153. }
  154.  
  155. FUNCTION {new.sentence.checka}
  156. { empty$
  157.     'skip$
  158.     'new.sentence
  159.   if$
  160. }
  161.  
  162. FUNCTION {new.sentence.checkb}
  163. { empty$
  164.   swap$ empty$
  165.   and
  166.     'skip$
  167.     'new.sentence
  168.   if$
  169. }
  170.  
  171. FUNCTION {field.or.null}
  172. { duplicate$ empty$
  173.     { pop$ "" }
  174.     'skip$
  175.   if$
  176. }
  177.  
  178. FUNCTION {emphasize}
  179. { duplicate$ empty$
  180.     { pop$ "" }
  181.     { "{\em " swap$ * "}" * }
  182.   if$
  183. }
  184.  
  185. INTEGERS { nameptr namesleft numnames }
  186.  
  187. FUNCTION {format.names}
  188. { 's :=
  189.   #1 'nameptr :=
  190.   s num.names$ 'numnames :=
  191.   numnames 'namesleft :=
  192.     { namesleft #0 > }
  193.     { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
  194.       nameptr #1 >
  195.     { namesleft #1 >
  196.         { ", " * t * }
  197.         { numnames #2 >
  198.         { "," * }
  199.         'skip$
  200.           if$
  201.           t "others" =
  202.         { " et~al." * }
  203.         { " and " * t * }
  204.           if$
  205.         }
  206.       if$
  207.     }
  208.     't
  209.       if$
  210.       nameptr #1 + 'nameptr :=
  211.       namesleft #1 - 'namesleft :=
  212.     }
  213.   while$
  214. }
  215.  
  216. FUNCTION {format.authors}
  217. { author empty$
  218.     { "" }
  219.     { author format.names }
  220.   if$
  221. }
  222.  
  223. FUNCTION {format.editors}
  224. { editor empty$
  225.     { "" }
  226.     { editor format.names
  227.       editor num.names$ #1 >
  228.     { ", editors" * }
  229.     { ", editor" * }
  230.       if$
  231.     }
  232.   if$
  233. }
  234.  
  235. FUNCTION {format.title}
  236. { title empty$
  237.     { "" }
  238.     { title "t" change.case$ }
  239.   if$
  240. }
  241.  
  242. FUNCTION {n.dashify}
  243. { 't :=
  244.   ""
  245.     { t empty$ not }
  246.     { t #1 #1 substring$ "-" =
  247.     { t #1 #2 substring$ "--" = not
  248.         { "--" *
  249.           t #2 global.max$ substring$ 't :=
  250.         }
  251.         {   { t #1 #1 substring$ "-" = }
  252.         { "-" *
  253.           t #2 global.max$ substring$ 't :=
  254.         }
  255.           while$
  256.         }
  257.       if$
  258.     }
  259.     { t #1 #1 substring$ *
  260.       t #2 global.max$ substring$ 't :=
  261.     }
  262.       if$
  263.     }
  264.   while$
  265. }
  266.  
  267. FUNCTION {format.date}
  268. { year empty$
  269.     { month empty$
  270.     { "" }
  271.     { "there's a month but no year in " cite$ * warning$
  272.       month
  273.     }
  274.       if$
  275.     }
  276.     { month empty$
  277.     'year
  278.     { month " " * year * }
  279.       if$
  280.     }
  281.   if$
  282. }
  283.  
  284. FUNCTION {format.btitle}
  285. { title emphasize
  286. }
  287.  
  288. FUNCTION {tie.or.space.connect}
  289. { duplicate$ text.length$ #3 <
  290.     { "~" }
  291.     { " " }
  292.   if$
  293.   swap$ * *
  294. }
  295.  
  296. FUNCTION {either.or.check}
  297. { empty$
  298.     'pop$
  299.     { "can't use both " swap$ * " fields in " * cite$ * warning$ }
  300.   if$
  301. }
  302.  
  303. FUNCTION {format.bvolume}
  304. { volume empty$
  305.     { "" }
  306.     { "volume" volume tie.or.space.connect
  307.       series empty$
  308.     'skip$
  309.     { " of " * series emphasize * }
  310.       if$
  311.       "volume and number" number either.or.check
  312.     }
  313.   if$
  314. }
  315.  
  316. FUNCTION {format.number.series}
  317. { volume empty$
  318.     { number empty$
  319.     { series field.or.null }
  320.     { output.state mid.sentence =
  321.         { "number" }
  322.         { "Number" }
  323.       if$
  324.       number tie.or.space.connect
  325.       series empty$
  326.         { "there's a number but no series in " cite$ * warning$ }
  327.         { " in " * series * }
  328.       if$
  329.     }
  330.       if$
  331.     }
  332.     { "" }
  333.   if$
  334. }
  335.  
  336. FUNCTION {format.edition}
  337. { edition empty$
  338.     { "" }
  339.     { output.state mid.sentence =
  340.     { edition "l" change.case$ " edition" * }
  341.     { edition "t" change.case$ " edition" * }
  342.       if$
  343.     }
  344.   if$
  345. }
  346.  
  347. INTEGERS { multiresult }
  348.  
  349. FUNCTION {multi.page.check}
  350. { 't :=
  351.   #0 'multiresult :=
  352.     { multiresult not
  353.       t empty$ not
  354.       and
  355.     }
  356.     { t #1 #1 substring$
  357.       duplicate$ "-" =
  358.       swap$ duplicate$ "," =
  359.       swap$ "+" =
  360.       or or
  361.     { #1 'multiresult := }
  362.     { t #2 global.max$ substring$ 't := }
  363.       if$
  364.     }
  365.   while$
  366.   multiresult
  367. }
  368.  
  369. FUNCTION {format.pages}
  370. { pages empty$
  371.     { "" }
  372.     { pages multi.page.check
  373.     { "pages" pages n.dashify tie.or.space.connect }
  374.     { "page" pages tie.or.space.connect }
  375.       if$
  376.     }
  377.   if$
  378. }
  379.  
  380. FUNCTION {format.vol.num.pages}
  381. { volume field.or.null
  382.   number empty$
  383.     'skip$
  384.     { "(" number * ")" * *
  385.       volume empty$
  386.     { "there's a number but no volume in " cite$ * warning$ }
  387.     'skip$
  388.       if$
  389.     }
  390.   if$
  391.   pages empty$
  392.     'skip$
  393.     { duplicate$ empty$
  394.     { pop$ format.pages }
  395.     { ":" * pages n.dashify * }
  396.       if$
  397.     }
  398.   if$
  399. }
  400.  
  401. FUNCTION {format.chapter.pages}
  402. { chapter empty$
  403.     'format.pages
  404.     { type empty$
  405.     { "chapter" }
  406.     { type "l" change.case$ }
  407.       if$
  408.       chapter tie.or.space.connect
  409.       pages empty$
  410.     'skip$
  411.     { ", " * format.pages * }
  412.       if$
  413.     }
  414.   if$
  415. }
  416.  
  417. FUNCTION {format.in.ed.booktitle}
  418. { booktitle empty$
  419.     { "" }
  420.     { editor empty$
  421.     { "In " booktitle emphasize * }
  422.     { "In " format.editors * ", " * booktitle emphasize * }
  423.       if$
  424.     }
  425.   if$
  426. }
  427.  
  428. FUNCTION {empty.misc.check}
  429. { author empty$ title empty$ howpublished empty$
  430.   month empty$ year empty$ note empty$
  431.   and and and and and
  432.   key empty$ not and
  433.     { "all relevant fields are empty in " cite$ * warning$ }
  434.     'skip$
  435.   if$
  436. }
  437.  
  438. FUNCTION {format.thesis.type}
  439. { type empty$
  440.     'skip$
  441.     { pop$
  442.       type "t" change.case$
  443.     }
  444.   if$
  445. }
  446.  
  447. FUNCTION {format.tr.number}
  448. { type empty$
  449.     { "Technical Report" }
  450.     'type
  451.   if$
  452.   number empty$
  453.     { "t" change.case$ }
  454.     { number tie.or.space.connect }
  455.   if$
  456. }
  457.  
  458. FUNCTION {format.article.crossref}
  459. { key empty$
  460.     { journal empty$
  461.     { "need key or journal for " cite$ * " to crossref " * crossref *
  462.       warning$
  463.       ""
  464.     }
  465.     { "In {\em " journal * "\/}" * }
  466.       if$
  467.     }
  468.     { "In " key * }
  469.   if$
  470.   " \cite{" * crossref * "}" *
  471. }
  472.  
  473. FUNCTION {format.crossref.editor}
  474. { editor #1 "{vv~}{ll}" format.name$
  475.   editor num.names$ duplicate$
  476.   #2 >
  477.     { pop$ " et~al." * }
  478.     { #2 <
  479.     'skip$
  480.     { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
  481.         { " et~al." * }
  482.         { " and " * editor #2 "{vv~}{ll}" format.name$ * }
  483.       if$
  484.     }
  485.       if$
  486.     }
  487.   if$
  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.   editor empty$
  500.   editor field.or.null author field.or.null =
  501.   or
  502.     { key empty$
  503.     { series empty$
  504.         { "need editor, key, or series for " cite$ * " to crossref " *
  505.           crossref * warning$
  506.           "" *
  507.         }
  508.         {