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

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