home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume38 / annote / part03 < prev    next >
Encoding:
Text File  |  1993-06-19  |  67.7 KB  |  3,318 lines

  1. Newsgroups: comp.sources.misc
  2. From: arrouye@cosmos.imag.fr (Yves Arrouye)
  3. Subject: v38i007:  annote - BibTeX styles supporting annotations, v1.5.1, Part03/04
  4. Message-ID: <1993Jun17.185632.10374@sparky.imd.sterling.com>
  5. X-Md4-Signature: f16f5a300b2b019d6f0e57c436823b6b
  6. Sender: kent@sparky.imd.sterling.com (Kent Landfield)
  7. Organization: IMAG Institute, University of Grenoble
  8. Date: Thu, 17 Jun 1993 18:56:32 GMT
  9. Approved: kent@sparky.imd.sterling.com
  10.  
  11. Submitted-by: arrouye@cosmos.imag.fr (Yves Arrouye)
  12. Posting-number: Volume 38, Issue 7
  13. Archive-name: annote/part03
  14. Environment: LaTex
  15. Supersedes: annote: Volume 37, Issue 57-59
  16.  
  17. #! /bin/sh
  18. # This is a shell archive.  Remove anything before this line, then unpack
  19. # it by saving it into a file and typing "sh file".  To overwrite existing
  20. # files, type "sh file -c".  You can also feed this as standard input via
  21. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  22. # will see the following message at the end:
  23. #        "End of shell archive."
  24. # Contents:  plain.bst unsrt.bst apalike.bst
  25. # Wrapped by arrouye@cosmos on Tue Jun  8 13:47:09 1993
  26. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  27. if test -f 'plain.bst' -a "${1}" != "-c" ; then 
  28.   echo shar: Will not clobber existing file \"'plain.bst'\"
  29. else
  30. echo shar: Extracting \"'plain.bst'\" \(21696 characters\)
  31. sed "s/^X//" >'plain.bst' <<'END_OF_FILE'
  32. X% Style file modified on Tue Jun  8 12:31:14 1993 with `annotebib.el' v1.5.1
  33. X%                     by Yves.Arrouye <arrouye@cosmos>
  34. X%                     to support the `annote' annotation field.
  35. X% Style file modified on Tue Jun  8 12:31:14 1993 with `annotebib.el' v1.5.1
  36. X%                     by Yves.Arrouye <arrouye@cosmos>
  37. X%                     to support the `commentaire' annotation field.
  38. X
  39. X% This bibliography style was made `annote'-compatible by "annotebib.el".
  40. X% It can be used for both annotated and non-annotated bibliographies listing
  41. X% (`annote' package by Yves Arrouye <arrouye@imag.imag.fr>).
  42. X
  43. X% BibTeX standard bibliography style `plain'
  44. X        % version 0.99a for BibTeX versions 0.99a or later, LaTeX version 2.09.
  45. X        % Copyright (C) 1985, all rights reserved.
  46. X        % Copying of this file is authorized only if either
  47. X        % (1) you make absolutely no changes to your copy, including name, or
  48. X        % (2) if you do make changes, you name it something other than
  49. X        % btxbst.doc, plain.bst, unsrt.bst, alpha.bst, and abbrv.bst.
  50. X        % This restriction helps ensure that all standard styles are identical.
  51. X        % The file btxbst.doc has the documentation for this style.
  52. X
  53. XENTRY
  54. X  { annote
  55. X    commentaire
  56. X    address
  57. X    author
  58. X    booktitle
  59. X    chapter
  60. X    edition
  61. X    editor
  62. X    howpublished
  63. X    institution
  64. X    journal
  65. X    key
  66. X    month
  67. X    note
  68. X    number
  69. X    organization
  70. X    pages
  71. X    publisher
  72. X    school
  73. X    series
  74. X    title
  75. X    type
  76. X    volume
  77. X    year
  78. X  }
  79. X  {}
  80. X  { label }
  81. X
  82. XINTEGERS { output.state before.all mid.sentence after.sentence after.block }
  83. X
  84. XFUNCTION {init.state.consts}
  85. X{ #0 'before.all :=
  86. X  #1 'mid.sentence :=
  87. X  #2 'after.sentence :=
  88. X  #3 'after.block :=
  89. X}
  90. X
  91. XSTRINGS { s t }
  92. X
  93. XFUNCTION {output.nonnull}
  94. X{ 's :=
  95. X  output.state mid.sentence =
  96. X    { ", " * write$ }
  97. X    { output.state after.block =
  98. X        { add.period$ write$
  99. X          newline$
  100. X          "\newblock " write$
  101. X        }
  102. X        { output.state before.all =
  103. X            'write$
  104. X            { add.period$ " " * write$ }
  105. X          if$
  106. X        }
  107. X      if$
  108. X      mid.sentence 'output.state :=
  109. X    }
  110. X  if$
  111. X  s
  112. X}
  113. X
  114. XFUNCTION {output}
  115. X{ duplicate$ empty$
  116. X    'pop$
  117. X    'output.nonnull
  118. X  if$
  119. X}
  120. X
  121. XFUNCTION {output.check}
  122. X{ 't :=
  123. X  duplicate$ empty$
  124. X    { pop$ "empty " t * " in " * cite$ * warning$ }
  125. X    'output.nonnull
  126. X  if$
  127. X}
  128. X
  129. XFUNCTION {output.bibitem}
  130. X{ newline$
  131. X  "\bibitem{" write$
  132. X  cite$ write$
  133. X  "}" write$
  134. X  newline$
  135. X  ""
  136. X  before.all 'output.state :=
  137. X}
  138. X
  139. XFUNCTION {annotebib.format.commentaire}
  140. X{ commentaire empty$
  141. X        { "" }
  142. X        { "\ifx\commentaire\undefined\else\begin{commentaire} "
  143. X          commentaire
  144. X          * " \end{commentaire}\fi " *
  145. X        }
  146. X      if$
  147. X}
  148. X
  149. XFUNCTION {annotebib.format.annote}
  150. X{ annote empty$
  151. X        { "" }
  152. X        { "\ifx\annote\undefined\else\begin{annote} "
  153. X          annote
  154. X          * " \end{annote}\fi " *
  155. X        }
  156. X      if$
  157. X}
  158. X
  159. XFUNCTION {fin.entry}
  160. X{ add.period$
  161. X  write$
  162. X  newline$
  163. X  annotebib.format.commentaire write$
  164. X  annotebib.format.annote write$
  165. X}
  166. X
  167. XFUNCTION {new.block}
  168. X{ output.state before.all =
  169. X    'skip$
  170. X    { after.block 'output.state := }
  171. X  if$
  172. X}
  173. X
  174. XFUNCTION {new.sentence}
  175. X{ output.state after.block =
  176. X    'skip$
  177. X    { output.state before.all =
  178. X        'skip$
  179. X        { after.sentence 'output.state := }
  180. X      if$
  181. X    }
  182. X  if$
  183. X}
  184. X
  185. XFUNCTION {not}
  186. X{   { #0 }
  187. X    { #1 }
  188. X  if$
  189. X}
  190. X
  191. XFUNCTION {and}
  192. X{   'skip$
  193. X    { pop$ #0 }
  194. X  if$
  195. X}
  196. X
  197. XFUNCTION {or}
  198. X{   { pop$ #1 }
  199. X    'skip$
  200. X  if$
  201. X}
  202. X
  203. XFUNCTION {new.block.checka}
  204. X{ empty$
  205. X    'skip$
  206. X    'new.block
  207. X  if$
  208. X}
  209. X
  210. XFUNCTION {new.block.checkb}
  211. X{ empty$
  212. X  swap$ empty$
  213. X  and
  214. X    'skip$
  215. X    'new.block
  216. X  if$
  217. X}
  218. X
  219. XFUNCTION {new.sentence.checka}
  220. X{ empty$
  221. X    'skip$
  222. X    'new.sentence
  223. X  if$
  224. X}
  225. X
  226. XFUNCTION {new.sentence.checkb}
  227. X{ empty$
  228. X  swap$ empty$
  229. X  and
  230. X    'skip$
  231. X    'new.sentence
  232. X  if$
  233. X}
  234. X
  235. XFUNCTION {field.or.null}
  236. X{ duplicate$ empty$
  237. X    { pop$ "" }
  238. X    'skip$
  239. X  if$
  240. X}
  241. X
  242. XFUNCTION {emphasize}
  243. X{ duplicate$ empty$
  244. X    { pop$ "" }
  245. X    { "{\em " swap$ * "}" * }
  246. X  if$
  247. X}
  248. X
  249. XINTEGERS { nameptr namesleft numnames }
  250. X
  251. XFUNCTION {format.names}
  252. X{ 's :=
  253. X  #1 'nameptr :=
  254. X  s num.names$ 'numnames :=
  255. X  numnames 'namesleft :=
  256. X    { namesleft #0 > }
  257. X    { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
  258. X      nameptr #1 >
  259. X        { namesleft #1 >
  260. X            { ", " * t * }
  261. X            { numnames #2 >
  262. X                { "," * }
  263. X                'skip$
  264. X              if$
  265. X              t "others" =
  266. X                { " et~al." * }
  267. X                { " and " * t * }
  268. X              if$
  269. X            }
  270. X          if$
  271. X        }
  272. X        't
  273. X      if$
  274. X      nameptr #1 + 'nameptr :=
  275. X      namesleft #1 - 'namesleft :=
  276. X    }
  277. X  while$
  278. X}
  279. X
  280. XFUNCTION {format.authors}
  281. X{ author empty$
  282. X    { "" }
  283. X    { author format.names }
  284. X  if$
  285. X}
  286. X
  287. XFUNCTION {format.editors}
  288. X{ editor empty$
  289. X    { "" }
  290. X    { editor format.names
  291. X      editor num.names$ #1 >
  292. X        { ", editors" * }
  293. X        { ", editor" * }
  294. X      if$
  295. X    }
  296. X  if$
  297. X}
  298. X
  299. XFUNCTION {format.title}
  300. X{ title empty$
  301. X    { "" }
  302. X    { title "t" change.case$ }
  303. X  if$
  304. X}
  305. X
  306. XFUNCTION {n.dashify}
  307. X{ 't :=
  308. X  ""
  309. X    { t empty$ not }
  310. X    { t #1 #1 substring$ "-" =
  311. X        { t #1 #2 substring$ "--" = not
  312. X            { "--" *
  313. X              t #2 global.max$ substring$ 't :=
  314. X            }
  315. X            {   { t #1 #1 substring$ "-" = }
  316. X                { "-" *
  317. X                  t #2 global.max$ substring$ 't :=
  318. X                }
  319. X              while$
  320. X            }
  321. X          if$
  322. X        }
  323. X        { t #1 #1 substring$ *
  324. X          t #2 global.max$ substring$ 't :=
  325. X        }
  326. X      if$
  327. X    }
  328. X  while$
  329. X}
  330. X
  331. XFUNCTION {format.date}
  332. X{ year empty$
  333. X    { month empty$
  334. X        { "" }
  335. X        { "there's a month but no year in " cite$ * warning$
  336. X          month
  337. X        }
  338. X      if$
  339. X    }
  340. X    { month empty$
  341. X        'year
  342. X        { month " " * year * }
  343. X      if$
  344. X    }
  345. X  if$
  346. X}
  347. X
  348. XFUNCTION {format.btitle}
  349. X{ title emphasize
  350. X}
  351. X
  352. XFUNCTION {tie.or.space.connect}
  353. X{ duplicate$ text.length$ #3 <
  354. X    { "~" }
  355. X    { " " }
  356. X  if$
  357. X  swap$ * *
  358. X}
  359. X
  360. XFUNCTION {either.or.check}
  361. X{ empty$
  362. X    'pop$
  363. X    { "can't use both " swap$ * " fields in " * cite$ * warning$ }
  364. X  if$
  365. X}
  366. X
  367. XFUNCTION {format.bvolume}
  368. X{ volume empty$
  369. X    { "" }
  370. X    { "volume" volume tie.or.space.connect
  371. X      series empty$
  372. X        'skip$
  373. X        { " of " * series emphasize * }
  374. X      if$
  375. X      "volume and number" number either.or.check
  376. X    }
  377. X  if$
  378. X}
  379. X
  380. XFUNCTION {format.number.series}
  381. X{ volume empty$
  382. X    { number empty$
  383. X        { series field.or.null }
  384. X        { output.state mid.sentence =
  385. X            { "number" }
  386. X            { "Number" }
  387. X          if$
  388. X          number tie.or.space.connect
  389. X          series empty$
  390. X            { "there's a number but no series in " cite$ * warning$ }
  391. X            { " in " * series * }
  392. X          if$
  393. X        }
  394. X      if$
  395. X    }
  396. X    { "" }
  397. X  if$
  398. X}
  399. X
  400. XFUNCTION {format.edition}
  401. X{ edition empty$
  402. X    { "" }
  403. X    { output.state mid.sentence =
  404. X        { edition "l" change.case$ " edition" * }
  405. X        { edition "t" change.case$ " edition" * }
  406. X      if$
  407. X    }
  408. X  if$
  409. X}
  410. X
  411. XINTEGERS { multiresult }
  412. X
  413. XFUNCTION {multi.page.check}
  414. X{ 't :=
  415. X  #0 'multiresult :=
  416. X    { multiresult not
  417. X      t empty$ not
  418. X      and
  419. X    }
  420. X    { t #1 #1 substring$
  421. X      duplicate$ "-" =
  422. X      swap$ duplicate$ "," =
  423. X      swap$ "+" =
  424. X      or or
  425. X        { #1 'multiresult := }
  426. X        { t #2 global.max$ substring$ 't := }
  427. X      if$
  428. X    }
  429. X  while$
  430. X  multiresult
  431. X}
  432. X
  433. XFUNCTION {format.pages}
  434. X{ pages empty$
  435. X    { "" }
  436. X    { pages multi.page.check
  437. X        { "pages" pages n.dashify tie.or.space.connect }
  438. X        { "page" pages tie.or.space.connect }
  439. X      if$
  440. X    }
  441. X  if$
  442. X}
  443. X
  444. XFUNCTION {format.vol.num.pages}
  445. X{ volume field.or.null
  446. X  number empty$
  447. X    'skip$
  448. X    { "(" number * ")" * *
  449. X      volume empty$
  450. X        { "there's a number but no volume in " cite$ * warning$ }
  451. X        'skip$
  452. X      if$
  453. X    }
  454. X  if$
  455. X  pages empty$
  456. X    'skip$
  457. X    { duplicate$ empty$
  458. X        { pop$ format.pages }
  459. X        { ":" * pages n.dashify * }
  460. X      if$
  461. X    }
  462. X  if$
  463. X}
  464. X
  465. XFUNCTION {format.chapter.pages}
  466. X{ chapter empty$
  467. X    'format.pages
  468. X    { type empty$
  469. X        { "chapter" }
  470. X        { type "l" change.case$ }
  471. X      if$
  472. X      chapter tie.or.space.connect
  473. X      pages empty$
  474. X        'skip$
  475. X        { ", " * format.pages * }
  476. X      if$
  477. X    }
  478. X  if$
  479. X}
  480. X
  481. XFUNCTION {format.in.ed.booktitle}
  482. X{ booktitle empty$
  483. X    { "" }
  484. X    { editor empty$
  485. X        { "In " booktitle emphasize * }
  486. X        { "In " format.editors * ", " * booktitle emphasize * }
  487. X      if$
  488. X    }
  489. X  if$
  490. X}
  491. X
  492. XFUNCTION {empty.misc.check}
  493. X{ author empty$ title empty$ howpublished empty$
  494. X  month empty$ year empty$ note empty$
  495. X  and and and and and
  496. X  key empty$ not and
  497. X    { "all relevant fields are empty in " cite$ * warning$ }
  498. X    'skip$
  499. X  if$
  500. X}
  501. X
  502. XFUNCTION {format.thesis.type}
  503. X{ type empty$
  504. X    'skip$
  505. X    { pop$
  506. X      type "t" change.case$
  507. X    }
  508. X  if$
  509. X}
  510. X
  511. XFUNCTION {format.tr.number}
  512. X{ type empty$
  513. X    { "Technical Report" }
  514. X    'type
  515. X  if$
  516. X  number empty$
  517. X    { "t" change.case$ }
  518. X    { number tie.or.space.connect }
  519. X  if$
  520. X}
  521. X
  522. XFUNCTION {format.article.crossref}
  523. X{ key empty$
  524. X    { journal empty$
  525. X        { "need key or journal for " cite$ * " to crossref " * crossref *
  526. X          warning$
  527. X          ""
  528. X        }
  529. X        { "In {\em " journal * "\/}" * }
  530. X      if$
  531. X    }
  532. X    { "In " key * }
  533. X  if$
  534. X  " \cite{" * crossref * "}" *
  535. X}
  536. X
  537. XFUNCTION {format.crossref.editor}
  538. X{ editor #1 "{vv~}{ll}" format.name$
  539. X  editor num.names$ duplicate$
  540. X  #2 >
  541. X    { pop$ " et~al." * }
  542. X    { #2 <
  543. X        'skip$
  544. X        { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
  545. X            { " et~al." * }
  546. X            { " and " * editor #2 "{vv~}{ll}" format.name$ * }
  547. X          if$
  548. X        }
  549. X      if$
  550. X    }
  551. X  if$
  552. X}
  553. X
  554. XFUNCTION {format.book.crossref}
  555. X{ volume empty$
  556. X    { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
  557. X      "In "
  558. X    }
  559. X    { "Volume" volume tie.or.space.connect
  560. X      " of " *
  561. X    }
  562. X  if$
  563. X  editor empty$
  564. X  editor field.or.null author field.or.null =
  565. X  or
  566. X    { key empty$
  567. X        { series empty$
  568. X            { "need editor, key, or series for " cite$ * " to crossref " *
  569. X              crossref * warning$
  570. X              "" *
  571. X            }
  572. X            { "{\em " * series * "\/}" * }
  573. X          if$
  574. X        }
  575. X        { key * }
  576. X      if$
  577. X    }
  578. X    { format.crossref.editor * }
  579. X  if$
  580. X  " \cite{" * crossref * "}" *
  581. X}
  582. X
  583. XFUNCTION {format.incoll.inproc.crossref}
  584. X{ editor empty$
  585. X  editor field.or.null author field.or.null =
  586. X  or
  587. X    { key empty$
  588. X        { booktitle empty$
  589. X            { "need editor, key, or booktitle for " cite$ * " to crossref " *
  590. X              crossref * warning$
  591. X              ""
  592. X            }
  593. X            { "In {\em " booktitle * "\/}" * }
  594. X          if$
  595. X        }
  596. X        { "In " key * }
  597. X      if$
  598. X    }
  599. X    { "In " format.crossref.editor * }
  600. X  if$
  601. X  " \cite{" * crossref * "}" *
  602. X}
  603. X
  604. XFUNCTION {article}
  605. X{ output.bibitem
  606. X  format.authors "author" output.check
  607. X  new.block
  608. X  format.title "title" output.check
  609. X  new.block
  610. X  crossref missing$
  611. X    { journal emphasize "journal" output.check
  612. X      format.vol.num.pages output
  613. X      format.date "year" output.check
  614. X    }
  615. X    { format.article.crossref output.nonnull
  616. X      format.pages output
  617. X    }
  618. X  if$
  619. X  new.block
  620. X  note output
  621. X  fin.entry
  622. X}
  623. X
  624. XFUNCTION {book}
  625. X{ output.bibitem
  626. X  author empty$
  627. X    { format.editors "author and editor" output.check }
  628. X    { format.authors output.nonnull
  629. X      crossref missing$
  630. X        { "author and editor" editor either.or.check }
  631. X        'skip$
  632. X      if$
  633. X    }
  634. X  if$
  635. X  new.block
  636. X  format.btitle "title" output.check
  637. X  crossref missing$
  638. X    { format.bvolume output
  639. X      new.block
  640. X      format.number.series output
  641. X      new.sentence
  642. X      publisher "publisher" output.check
  643. X      address output
  644. X    }
  645. X    { new.block
  646. X      format.book.crossref output.nonnull
  647. X    }
  648. X  if$
  649. X  format.edition output
  650. X  format.date "year" output.check
  651. X  new.block
  652. X  note output
  653. X  fin.entry
  654. X}
  655. X
  656. XFUNCTION {booklet}
  657. X{ output.bibitem
  658. X  format.authors output
  659. X  new.block
  660. X  format.title "title" output.check
  661. X  howpublished address new.block.checkb
  662. X  howpublished output
  663. X  address output
  664. X  format.date output
  665. X  new.block
  666. X  note output
  667. X  fin.entry
  668. X}
  669. X
  670. XFUNCTION {inbook}
  671. X{ output.bibitem
  672. X  author empty$
  673. X    { format.editors "author and editor" output.check }
  674. X    { format.authors output.nonnull
  675. X      crossref missing$
  676. X        { "author and editor" editor either.or.check }
  677. X        'skip$
  678. X      if$
  679. X    }
  680. X  if$
  681. X  new.block
  682. X  format.btitle "title" output.check
  683. X  crossref missing$
  684. X    { format.bvolume output
  685. X      format.chapter.pages "chapter and pages" output.check
  686. X      new.block
  687. X      format.number.series output
  688. X      new.sentence
  689. X      publisher "publisher" output.check
  690. X      address output
  691. X    }
  692. X    { format.chapter.pages "chapter and pages" output.check
  693. X      new.block
  694. X      format.book.crossref output.nonnull
  695. X    }
  696. X  if$
  697. X  format.edition output
  698. X  format.date "year" output.check
  699. X  new.block
  700. X  note output
  701. X  fin.entry
  702. X}
  703. X
  704. XFUNCTION {incollection}
  705. X{ output.bibitem
  706. X  format.authors "author" output.check
  707. X  new.block
  708. X  format.title "title" output.check
  709. X  new.block
  710. X  crossref missing$
  711. X    { format.in.ed.booktitle "booktitle" output.check
  712. X      format.bvolume output
  713. X      format.number.series output
  714. X      format.chapter.pages output
  715. X      new.sentence
  716. X      publisher "publisher" output.check
  717. X      address output
  718. X      format.edition output
  719. X      format.date "year" output.check
  720. X    }
  721. X    { format.incoll.inproc.crossref output.nonnull
  722. X      format.chapter.pages output
  723. X    }
  724. X  if$
  725. X  new.block
  726. X  note output
  727. X  fin.entry
  728. X}
  729. X
  730. XFUNCTION {inproceedings}
  731. X{ output.bibitem
  732. X  format.authors "author" output.check
  733. X  new.block
  734. X  format.title "title" output.check
  735. X  new.block
  736. X  crossref missing$
  737. X    { format.in.ed.booktitle "booktitle" output.check
  738. X      format.bvolume output
  739. X      format.number.series output
  740. X      format.pages output
  741. X      address empty$
  742. X        { organization publisher new.sentence.checkb
  743. X          organization output
  744. X          publisher output
  745. X          format.date "year" output.check
  746. X        }
  747. X        { address output.nonnull
  748. X          format.date "year" output.check
  749. X          new.sentence
  750. X          organization output
  751. X          publisher output
  752. X        }
  753. X      if$
  754. X    }
  755. X    { format.incoll.inproc.crossref output.nonnull
  756. X      format.pages output
  757. X    }
  758. X  if$
  759. X  new.block
  760. X  note output
  761. X  fin.entry
  762. X}
  763. X
  764. XFUNCTION {conference} { inproceedings }
  765. X
  766. XFUNCTION {manual}
  767. X{ output.bibitem
  768. X  author empty$
  769. X    { organization empty$
  770. X        'skip$
  771. X        { organization output.nonnull
  772. X          address output
  773. X        }
  774. X      if$
  775. X    }
  776. X    { format.authors output.nonnull }
  777. X  if$
  778. X  new.block
  779. X  format.btitle "title" output.check
  780. X  author empty$
  781. X    { organization empty$
  782. X        { address new.block.checka
  783. X          address output
  784. X        }
  785. X        'skip$
  786. X      if$
  787. X    }
  788. X    { organization address new.block.checkb
  789. X      organization output
  790. X      address output
  791. X    }
  792. X  if$
  793. X  format.edition output
  794. X  format.date output
  795. X  new.block
  796. X  note output
  797. X  fin.entry
  798. X}
  799. X
  800. XFUNCTION {mastersthesis}
  801. X{ output.bibitem
  802. X  format.authors "author" output.check
  803. X  new.block
  804. X  format.title "title" output.check
  805. X  new.block
  806. X  "Master's thesis" format.thesis.type output.nonnull
  807. X  school "school" output.check
  808. X  address output
  809. X  format.date "year" output.check
  810. X  new.block
  811. X  note output
  812. X  fin.entry
  813. X}
  814. X
  815. XFUNCTION {misc}
  816. X{ output.bibitem
  817. X  format.authors output
  818. X  title howpublished new.block.checkb
  819. X  format.title output
  820. X  howpublished new.block.checka
  821. X  howpublished output
  822. X  format.date output
  823. X  new.block
  824. X  note output
  825. X  fin.entry
  826. X  empty.misc.check
  827. X}
  828. X
  829. XFUNCTION {phdthesis}
  830. X{ output.bibitem
  831. X  format.authors "author" output.check
  832. X  new.block
  833. X  format.btitle "title" output.check
  834. X  new.block
  835. X  "PhD thesis" format.thesis.type output.nonnull
  836. X  school "school" output.check
  837. X  address output
  838. X  format.date "year" output.check
  839. X  new.block
  840. X  note output
  841. X  fin.entry
  842. X}
  843. X
  844. XFUNCTION {proceedings}
  845. X{ output.bibitem
  846. X  editor empty$
  847. X    { organization output }
  848. X    { format.editors output.nonnull }
  849. X  if$
  850. X  new.block
  851. X  format.btitle "title" output.check
  852. X  format.bvolume output
  853. X  format.number.series output
  854. X  address empty$
  855. X    { editor empty$
  856. X        { publisher new.sentence.checka }
  857. X        { organization publisher new.sentence.checkb
  858. X          organization output
  859. X        }
  860. X      if$
  861. X      publisher output
  862. X      format.date "year" output.check
  863. X    }
  864. X    { address output.nonnull
  865. X      format.date "year" output.check
  866. X      new.sentence
  867. X      editor empty$
  868. X        'skip$
  869. X        { organization output }
  870. X      if$
  871. X      publisher output
  872. X    }
  873. X  if$
  874. X  new.block
  875. X  note output
  876. X  fin.entry
  877. X}
  878. X
  879. XFUNCTION {techreport}
  880. X{ output.bibitem
  881. X  format.authors "author" output.check
  882. X  new.block
  883. X  format.title "title" output.check
  884. X  new.block
  885. X  format.tr.number output.nonnull
  886. X  institution "institution" output.check
  887. X  address output
  888. X  format.date "year" output.check
  889. X  new.block
  890. X  note output
  891. X  fin.entry
  892. X}
  893. X
  894. XFUNCTION {unpublished}
  895. X{ output.bibitem
  896. X  format.authors "author" output.check
  897. X  new.block
  898. X  format.title "title" output.check
  899. X  new.block
  900. X  note "note" output.check
  901. X  format.date output
  902. X  fin.entry
  903. X}
  904. X
  905. XFUNCTION {default.type} { misc }
  906. X
  907. XMACRO {jan} {"January"}
  908. X
  909. XMACRO {feb} {"February"}
  910. X
  911. XMACRO {mar} {"March"}
  912. X
  913. XMACRO {apr} {"April"}
  914. X
  915. XMACRO {may} {"May"}
  916. X
  917. XMACRO {jun} {"June"}
  918. X
  919. XMACRO {jul} {"July"}
  920. X
  921. XMACRO {aug} {"August"}
  922. X
  923. XMACRO {sep} {"September"}
  924. X
  925. XMACRO {oct} {"October"}
  926. X
  927. XMACRO {nov} {"November"}
  928. X
  929. XMACRO {dec} {"December"}
  930. X
  931. XMACRO {acmcs} {"ACM Computing Surveys"}
  932. X
  933. XMACRO {acta} {"Acta Informatica"}
  934. X
  935. XMACRO {cacm} {"Communications of the ACM"}
  936. X
  937. XMACRO {ibmjrd} {"IBM Journal of Research and Development"}
  938. X
  939. XMACRO {ibmsj} {"IBM Systems Journal"}
  940. X
  941. XMACRO {ieeese} {"IEEE Transactions on Software Engineering"}
  942. X
  943. XMACRO {ieeetc} {"IEEE Transactions on Computers"}
  944. X
  945. XMACRO {ieeetcad}
  946. X {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
  947. X
  948. XMACRO {ipl} {"Information Processing Letters"}
  949. X
  950. XMACRO {jacm} {"Journal of the ACM"}
  951. X
  952. XMACRO {jcss} {"Journal of Computer and System Sciences"}
  953. X
  954. XMACRO {scp} {"Science of Computer Programming"}
  955. X
  956. XMACRO {sicomp} {"SIAM Journal on Computing"}
  957. X
  958. XMACRO {tocs} {"ACM Transactions on Computer Systems"}
  959. X
  960. XMACRO {tods} {"ACM Transactions on Database Systems"}
  961. X
  962. XMACRO {tog} {"ACM Transactions on Graphics"}
  963. X
  964. XMACRO {toms} {"ACM Transactions on Mathematical Software"}
  965. X
  966. XMACRO {toois} {"ACM Transactions on Office Information Systems"}
  967. X
  968. XMACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
  969. X
  970. XMACRO {tcs} {"Theoretical Computer Science"}
  971. X
  972. XREAD
  973. X
  974. XFUNCTION {sortify}
  975. X{ purify$
  976. X  "l" change.case$
  977. X}
  978. X
  979. XINTEGERS { len }
  980. X
  981. XFUNCTION {chop.word}
  982. X{ 's :=
  983. X  'len :=
  984. X  s #1 len substring$ =
  985. X    { s len #1 + global.max$ substring$ }
  986. X    's
  987. X  if$
  988. X}
  989. X
  990. XFUNCTION {sort.format.names}
  991. X{ 's :=
  992. X  #1 'nameptr :=
  993. X  ""
  994. X  s num.names$ 'numnames :=
  995. X  numnames 'namesleft :=
  996. X    { namesleft #0 > }
  997. X    { nameptr #1 >
  998. X        { "   " * }
  999. X        'skip$
  1000. X      if$
  1001. X      s nameptr "{vv{ } }{ll{ }}{  ff{ }}{  jj{ }}" format.name$ 't :=
  1002. X      nameptr numnames = t "others" = and
  1003. X        { "et al" * }
  1004. X        { t sortify * }
  1005. X      if$
  1006. X      nameptr #1 + 'nameptr :=
  1007. X      namesleft #1 - 'namesleft :=
  1008. X    }
  1009. X  while$
  1010. X}
  1011. X
  1012. XFUNCTION {sort.format.title}
  1013. X{ 't :=
  1014. X  "A " #2
  1015. X    "An " #3
  1016. X      "The " #4 t chop.word
  1017. X    chop.word
  1018. X  chop.word
  1019. X  sortify
  1020. X  #1 global.max$ substring$
  1021. X}
  1022. X
  1023. XFUNCTION {author.sort}
  1024. X{ author empty$
  1025. X    { key empty$
  1026. X        { "to sort, need author or key in " cite$ * warning$
  1027. X          ""
  1028. X        }
  1029. X        { key sortify }
  1030. X      if$
  1031. X    }
  1032. X    { author sort.format.names }
  1033. X  if$
  1034. X}
  1035. X
  1036. XFUNCTION {author.editor.sort}
  1037. X{ author empty$
  1038. X    { editor empty$
  1039. X        { key empty$
  1040. X            { "to sort, need author, editor, or key in " cite$ * warning$
  1041. X              ""
  1042. X            }
  1043. X            { key sortify }
  1044. X          if$
  1045. X        }
  1046. X        { editor sort.format.names }
  1047. X      if$
  1048. X    }
  1049. X    { author sort.format.names }
  1050. X  if$
  1051. X}
  1052. X
  1053. XFUNCTION {author.organization.sort}
  1054. X{ author empty$
  1055. X    { organization empty$
  1056. X        { key empty$
  1057. X            { "to sort, need author, organization, or key in " cite$ * warning$
  1058. X              ""
  1059. X            }
  1060. X            { key sortify }
  1061. X          if$
  1062. X        }
  1063. X        { "The " #4 organization chop.word sortify }
  1064. X      if$
  1065. X    }
  1066. X    { author sort.format.names }
  1067. X  if$
  1068. X}
  1069. X
  1070. XFUNCTION {editor.organization.sort}
  1071. X{ editor empty$
  1072. X    { organization empty$
  1073. X        { key empty$
  1074. X            { "to sort, need editor, organization, or key in " cite$ * warning$
  1075. X              ""
  1076. X            }
  1077. X            { key sortify }
  1078. X          if$
  1079. X        }
  1080. X        { "The " #4 organization chop.word sortify }
  1081. X      if$
  1082. X    }
  1083. X    { editor sort.format.names }
  1084. X  if$
  1085. X}
  1086. X
  1087. XFUNCTION {presort}
  1088. X{ type$ "book" =
  1089. X  type$ "inbook" =
  1090. X  or
  1091. X    'author.editor.sort
  1092. X    { type$ "proceedings" =
  1093. X        'editor.organization.sort
  1094. X        { type$ "manual" =
  1095. X            'author.organization.sort
  1096. X            'author.sort
  1097. X          if$
  1098. X        }
  1099. X      if$
  1100. X    }
  1101. X  if$
  1102. X  "    "
  1103. X  *
  1104. X  year field.or.null sortify
  1105. X  *
  1106. X  "    "
  1107. X  *
  1108. X  title field.or.null
  1109. X  sort.format.title
  1110. X  *
  1111. X  #1 entry.max$ substring$
  1112. X  'sort.key$ :=
  1113. X}
  1114. X
  1115. XITERATE {presort}
  1116. X
  1117. XSORT
  1118. X
  1119. XSTRINGS { longest.label }
  1120. X
  1121. XINTEGERS { number.label longest.label.width }
  1122. X
  1123. XFUNCTION {initialize.longest.label}
  1124. X{ "" 'longest.label :=
  1125. X  #1 'number.label :=
  1126. X  #0 'longest.label.width :=
  1127. X}
  1128. X
  1129. XFUNCTION {longest.label.pass}
  1130. X{ number.label int.to.str$ 'label :=
  1131. X  number.label #1 + 'number.label :=
  1132. X  label width$ longest.label.width >
  1133. X    { label 'longest.label :=
  1134. X      label width$ 'longest.label.width :=
  1135. X    }
  1136. X    'skip$
  1137. X  if$
  1138. X}
  1139. X
  1140. XEXECUTE {initialize.longest.label}
  1141. X
  1142. XITERATE {longest.label.pass}
  1143. X
  1144. XFUNCTION {begin.bib}
  1145. X{ preamble$ empty$
  1146. X    'skip$
  1147. X    { preamble$ write$ newline$ }
  1148. X  if$
  1149. X  "\begin{thebibliography}{"  longest.label  * "}" * write$ newline$
  1150. X}
  1151. X
  1152. XEXECUTE {begin.bib}
  1153. X
  1154. XEXECUTE {init.state.consts}
  1155. X
  1156. XITERATE {call.type$}
  1157. X
  1158. XFUNCTION {end.bib}
  1159. X{ newline$
  1160. X  "\end{thebibliography}" write$ newline$
  1161. X}
  1162. X
  1163. XEXECUTE {end.bib}
  1164. END_OF_FILE
  1165. if test 21696 -ne `wc -c <'plain.bst'`; then
  1166.     echo shar: \"'plain.bst'\" unpacked with wrong size!
  1167. fi
  1168. # end of 'plain.bst'
  1169. fi
  1170. if test -f 'unsrt.bst' -a "${1}" != "-c" ; then 
  1171.   echo shar: Will not clobber existing file \"'unsrt.bst'\"
  1172. else
  1173. echo shar: Extracting \"'unsrt.bst'\" \(19113 characters\)
  1174. sed "s/^X//" >'unsrt.bst' <<'END_OF_FILE'
  1175. X% Style file modified on Tue Jun  8 12:31:19 1993 with `annotebib.el' v1.5.1
  1176. X%                     by Yves.Arrouye <arrouye@cosmos>
  1177. X%                     to support the `annote' annotation field.
  1178. X% Style file modified on Tue Jun  8 12:31:19 1993 with `annotebib.el' v1.5.1
  1179. X%                     by Yves.Arrouye <arrouye@cosmos>
  1180. X%                     to support the `commentaire' annotation field.
  1181. X
  1182. X% This bibliography style was made `annote'-compatible by "annotebib.el".
  1183. X% It can be used for both annotated and non-annotated bibliographies listing
  1184. X% (`annote' package by Yves Arrouye <arrouye@imag.imag.fr>).
  1185. X
  1186. X% BibTeX standard bibliography style `unsrt'
  1187. X        % version 0.99a for BibTeX versions 0.99a or later, LaTeX version 2.09.
  1188. X        % Copyright (C) 1985, all rights reserved.
  1189. X        % Copying of this file is authorized only if either
  1190. X        % (1) you make absolutely no changes to your copy, including name, or
  1191. X        % (2) if you do make changes, you name it something other than
  1192. X        % btxbst.doc, plain.bst, unsrt.bst, alpha.bst, and abbrv.bst.
  1193. X        % This restriction helps ensure that all standard styles are identical.
  1194. X        % The file btxbst.doc has the documentation for this style.
  1195. X
  1196. XENTRY
  1197. X  { annote
  1198. X    commentaire
  1199. X    address
  1200. X    author
  1201. X    booktitle
  1202. X    chapter
  1203. X    edition
  1204. X    editor
  1205. X    howpublished
  1206. X    institution
  1207. X    journal
  1208. X    key
  1209. X    month
  1210. X    note
  1211. X    number
  1212. X    organization
  1213. X    pages
  1214. X    publisher
  1215. X    school
  1216. X    series
  1217. X    title
  1218. X    type
  1219. X    volume
  1220. X    year
  1221. X  }
  1222. X  {}
  1223. X  { label }
  1224. X
  1225. XINTEGERS { output.state before.all mid.sentence after.sentence after.block }
  1226. X
  1227. XFUNCTION {init.state.consts}
  1228. X{ #0 'before.all :=
  1229. X  #1 'mid.sentence :=
  1230. X  #2 'after.sentence :=
  1231. X  #3 'after.block :=
  1232. X}
  1233. X
  1234. XSTRINGS { s t }
  1235. X
  1236. XFUNCTION {output.nonnull}
  1237. X{ 's :=
  1238. X  output.state mid.sentence =
  1239. X    { ", " * write$ }
  1240. X    { output.state after.block =
  1241. X        { add.period$ write$
  1242. X          newline$
  1243. X          "\newblock " write$
  1244. X        }
  1245. X        { output.state before.all =
  1246. X            'write$
  1247. X            { add.period$ " " * write$ }
  1248. X          if$
  1249. X        }
  1250. X      if$
  1251. X      mid.sentence 'output.state :=
  1252. X    }
  1253. X  if$
  1254. X  s
  1255. X}
  1256. X
  1257. XFUNCTION {output}
  1258. X{ duplicate$ empty$
  1259. X    'pop$
  1260. X    'output.nonnull
  1261. X  if$
  1262. X}
  1263. X
  1264. XFUNCTION {output.check}
  1265. X{ 't :=
  1266. X  duplicate$ empty$
  1267. X    { pop$ "empty " t * " in " * cite$ * warning$ }
  1268. X    'output.nonnull
  1269. X  if$
  1270. X}
  1271. X
  1272. XFUNCTION {output.bibitem}
  1273. X{ newline$
  1274. X  "\bibitem{" write$
  1275. X  cite$ write$
  1276. X  "}" write$
  1277. X  newline$
  1278. X  ""
  1279. X  before.all 'output.state :=
  1280. X}
  1281. X
  1282. XFUNCTION {annotebib.format.commentaire}
  1283. X{ commentaire empty$
  1284. X        { "" }
  1285. X        { "\ifx\commentaire\undefined\else\begin{commentaire} "
  1286. X          commentaire
  1287. X          * " \end{commentaire}\fi " *
  1288. X        }
  1289. X      if$
  1290. X}
  1291. X
  1292. XFUNCTION {annotebib.format.annote}
  1293. X{ annote empty$
  1294. X        { "" }
  1295. X        { "\ifx\annote\undefined\else\begin{annote} "
  1296. X          annote
  1297. X          * " \end{annote}\fi " *
  1298. X        }
  1299. X      if$
  1300. X}
  1301. X
  1302. XFUNCTION {fin.entry}
  1303. X{ add.period$
  1304. X  write$
  1305. X  newline$
  1306. X  annotebib.format.commentaire write$
  1307. X  annotebib.format.annote write$
  1308. X}
  1309. X
  1310. XFUNCTION {new.block}
  1311. X{ output.state before.all =
  1312. X    'skip$
  1313. X    { after.block 'output.state := }
  1314. X  if$
  1315. X}
  1316. X
  1317. XFUNCTION {new.sentence}
  1318. X{ output.state after.block =
  1319. X    'skip$
  1320. X    { output.state before.all =
  1321. X        'skip$
  1322. X        { after.sentence 'output.state := }
  1323. X      if$
  1324. X    }
  1325. X  if$
  1326. X}
  1327. X
  1328. XFUNCTION {not}
  1329. X{   { #0 }
  1330. X    { #1 }
  1331. X  if$
  1332. X}
  1333. X
  1334. XFUNCTION {and}
  1335. X{   'skip$
  1336. X    { pop$ #0 }
  1337. X  if$
  1338. X}
  1339. X
  1340. XFUNCTION {or}
  1341. X{   { pop$ #1 }
  1342. X    'skip$
  1343. X  if$
  1344. X}
  1345. X
  1346. XFUNCTION {new.block.checka}
  1347. X{ empty$
  1348. X    'skip$
  1349. X    'new.block
  1350. X  if$
  1351. X}
  1352. X
  1353. XFUNCTION {new.block.checkb}
  1354. X{ empty$
  1355. X  swap$ empty$
  1356. X  and
  1357. X    'skip$
  1358. X    'new.block
  1359. X  if$
  1360. X}
  1361. X
  1362. XFUNCTION {new.sentence.checka}
  1363. X{ empty$
  1364. X    'skip$
  1365. X    'new.sentence
  1366. X  if$
  1367. X}
  1368. X
  1369. XFUNCTION {new.sentence.checkb}
  1370. X{ empty$
  1371. X  swap$ empty$
  1372. X  and
  1373. X    'skip$
  1374. X    'new.sentence
  1375. X  if$
  1376. X}
  1377. X
  1378. XFUNCTION {field.or.null}
  1379. X{ duplicate$ empty$
  1380. X    { pop$ "" }
  1381. X    'skip$
  1382. X  if$
  1383. X}
  1384. X
  1385. XFUNCTION {emphasize}
  1386. X{ duplicate$ empty$
  1387. X    { pop$ "" }
  1388. X    { "{\em " swap$ * "}" * }
  1389. X  if$
  1390. X}
  1391. X
  1392. XINTEGERS { nameptr namesleft numnames }
  1393. X
  1394. XFUNCTION {format.names}
  1395. X{ 's :=
  1396. X  #1 'nameptr :=
  1397. X  s num.names$ 'numnames :=
  1398. X  numnames 'namesleft :=
  1399. X    { namesleft #0 > }
  1400. X    { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
  1401. X      nameptr #1 >
  1402. X        { namesleft #1 >
  1403. X            { ", " * t * }
  1404. X            { numnames #2 >
  1405. X                { "," * }
  1406. X                'skip$
  1407. X              if$
  1408. X              t "others" =
  1409. X                { " et~al." * }
  1410. X                { " and " * t * }
  1411. X              if$
  1412. X            }
  1413. X          if$
  1414. X        }
  1415. X        't
  1416. X      if$
  1417. X      nameptr #1 + 'nameptr :=
  1418. X      namesleft #1 - 'namesleft :=
  1419. X    }
  1420. X  while$
  1421. X}
  1422. X
  1423. XFUNCTION {format.authors}
  1424. X{ author empty$
  1425. X    { "" }
  1426. X    { author format.names }
  1427. X  if$
  1428. X}
  1429. X
  1430. XFUNCTION {format.editors}
  1431. X{ editor empty$
  1432. X    { "" }
  1433. X    { editor format.names
  1434. X      editor num.names$ #1 >
  1435. X        { ", editors" * }
  1436. X        { ", editor" * }
  1437. X      if$
  1438. X    }
  1439. X  if$
  1440. X}
  1441. X
  1442. XFUNCTION {format.title}
  1443. X{ title empty$
  1444. X    { "" }
  1445. X    { title "t" change.case$ }
  1446. X  if$
  1447. X}
  1448. X
  1449. XFUNCTION {n.dashify}
  1450. X{ 't :=
  1451. X  ""
  1452. X    { t empty$ not }
  1453. X    { t #1 #1 substring$ "-" =
  1454. X        { t #1 #2 substring$ "--" = not
  1455. X            { "--" *
  1456. X              t #2 global.max$ substring$ 't :=
  1457. X            }
  1458. X            {   { t #1 #1 substring$ "-" = }
  1459. X                { "-" *
  1460. X                  t #2 global.max$ substring$ 't :=
  1461. X                }
  1462. X              while$
  1463. X            }
  1464. X          if$
  1465. X        }
  1466. X        { t #1 #1 substring$ *
  1467. X          t #2 global.max$ substring$ 't :=
  1468. X        }
  1469. X      if$
  1470. X    }
  1471. X  while$
  1472. X}
  1473. X
  1474. XFUNCTION {format.date}
  1475. X{ year empty$
  1476. X    { month empty$
  1477. X        { "" }
  1478. X        { "there's a month but no year in " cite$ * warning$
  1479. X          month
  1480. X        }
  1481. X      if$
  1482. X    }
  1483. X    { month empty$
  1484. X        'year
  1485. X        { month " " * year * }
  1486. X      if$
  1487. X    }
  1488. X  if$
  1489. X}
  1490. X
  1491. XFUNCTION {format.btitle}
  1492. X{ title emphasize
  1493. X}
  1494. X
  1495. XFUNCTION {tie.or.space.connect}
  1496. X{ duplicate$ text.length$ #3 <
  1497. X    { "~" }
  1498. X    { " " }
  1499. X  if$
  1500. X  swap$ * *
  1501. X}
  1502. X
  1503. XFUNCTION {either.or.check}
  1504. X{ empty$
  1505. X    'pop$
  1506. X    { "can't use both " swap$ * " fields in " * cite$ * warning$ }
  1507. X  if$
  1508. X}
  1509. X
  1510. XFUNCTION {format.bvolume}
  1511. X{ volume empty$
  1512. X    { "" }
  1513. X    { "volume" volume tie.or.space.connect
  1514. X      series empty$
  1515. X        'skip$
  1516. X        { " of " * series emphasize * }
  1517. X      if$
  1518. X      "volume and number" number either.or.check
  1519. X    }
  1520. X  if$
  1521. X}
  1522. X
  1523. XFUNCTION {format.number.series}
  1524. X{ volume empty$
  1525. X    { number empty$
  1526. X        { series field.or.null }
  1527. X        { output.state mid.sentence =
  1528. X            { "number" }
  1529. X            { "Number" }
  1530. X          if$
  1531. X          number tie.or.space.connect
  1532. X          series empty$
  1533. X            { "there's a number but no series in " cite$ * warning$ }
  1534. X            { " in " * series * }
  1535. X          if$
  1536. X        }
  1537. X      if$
  1538. X    }
  1539. X    { "" }
  1540. X  if$
  1541. X}
  1542. X
  1543. XFUNCTION {format.edition}
  1544. X{ edition empty$
  1545. X    { "" }
  1546. X    { output.state mid.sentence =
  1547. X        { edition "l" change.case$ " edition" * }
  1548. X        { edition "t" change.case$ " edition" * }
  1549. X      if$
  1550. X    }
  1551. X  if$
  1552. X}
  1553. X
  1554. XINTEGERS { multiresult }
  1555. X
  1556. XFUNCTION {multi.page.check}
  1557. X{ 't :=
  1558. X  #0 'multiresult :=
  1559. X    { multiresult not
  1560. X      t empty$ not
  1561. X      and
  1562. X    }
  1563. X    { t #1 #1 substring$
  1564. X      duplicate$ "-" =
  1565. X      swap$ duplicate$ "," =
  1566. X      swap$ "+" =
  1567. X      or or
  1568. X        { #1 'multiresult := }
  1569. X        { t #2 global.max$ substring$ 't := }
  1570. X      if$
  1571. X    }
  1572. X  while$
  1573. X  multiresult
  1574. X}
  1575. X
  1576. XFUNCTION {format.pages}
  1577. X{ pages empty$
  1578. X    { "" }
  1579. X    { pages multi.page.check
  1580. X        { "pages" pages n.dashify tie.or.space.connect }
  1581. X        { "page" pages tie.or.space.connect }
  1582. X      if$
  1583. X    }
  1584. X  if$
  1585. X}
  1586. X
  1587. XFUNCTION {format.vol.num.pages}
  1588. X{ volume field.or.null
  1589. X  number empty$
  1590. X    'skip$
  1591. X    { "(" number * ")" * *
  1592. X      volume empty$
  1593. X        { "there's a number but no volume in " cite$ * warning$ }
  1594. X        'skip$
  1595. X      if$
  1596. X    }
  1597. X  if$
  1598. X  pages empty$
  1599. X    'skip$
  1600. X    { duplicate$ empty$
  1601. X        { pop$ format.pages }
  1602. X        { ":" * pages n.dashify * }
  1603. X      if$
  1604. X    }
  1605. X  if$
  1606. X}
  1607. X
  1608. XFUNCTION {format.chapter.pages}
  1609. X{ chapter empty$
  1610. X    'format.pages
  1611. X    { type empty$
  1612. X        { "chapter" }
  1613. X        { type "l" change.case$ }
  1614. X      if$
  1615. X      chapter tie.or.space.connect
  1616. X      pages empty$
  1617. X        'skip$
  1618. X        { ", " * format.pages * }
  1619. X      if$
  1620. X    }
  1621. X  if$
  1622. X}
  1623. X
  1624. XFUNCTION {format.in.ed.booktitle}
  1625. X{ booktitle empty$
  1626. X    { "" }
  1627. X    { editor empty$
  1628. X        { "In " booktitle emphasize * }
  1629. X        { "In " format.editors * ", " * booktitle emphasize * }
  1630. X      if$
  1631. X    }
  1632. X  if$
  1633. X}
  1634. X
  1635. XFUNCTION {empty.misc.check}
  1636. X{ author empty$ title empty$ howpublished empty$
  1637. X  month empty$ year empty$ note empty$
  1638. X  and and and and and
  1639. X    { "all relevant fields are empty in " cite$ * warning$ }
  1640. X    'skip$
  1641. X  if$
  1642. X}
  1643. X
  1644. XFUNCTION {format.thesis.type}
  1645. X{ type empty$
  1646. X    'skip$
  1647. X    { pop$
  1648. X      type "t" change.case$
  1649. X    }
  1650. X  if$
  1651. X}
  1652. X
  1653. XFUNCTION {format.tr.number}
  1654. X{ type empty$
  1655. X    { "Technical Report" }
  1656. X    'type
  1657. X  if$
  1658. X  number empty$
  1659. X    { "t" change.case$ }
  1660. X    { number tie.or.space.connect }
  1661. X  if$
  1662. X}
  1663. X
  1664. XFUNCTION {format.article.crossref}
  1665. X{ key empty$
  1666. X    { journal empty$
  1667. X        { "need key or journal for " cite$ * " to crossref " * crossref *
  1668. X          warning$
  1669. X          ""
  1670. X        }
  1671. X        { "In {\em " journal * "\/}" * }
  1672. X      if$
  1673. X    }
  1674. X    { "In " key * }
  1675. X  if$
  1676. X  " \cite{" * crossref * "}" *
  1677. X}
  1678. X
  1679. XFUNCTION {format.crossref.editor}
  1680. X{ editor #1 "{vv~}{ll}" format.name$
  1681. X  editor num.names$ duplicate$
  1682. X  #2 >
  1683. X    { pop$ " et~al." * }
  1684. X    { #2 <
  1685. X        'skip$
  1686. X        { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
  1687. X            { " et~al." * }
  1688. X            { " and " * editor #2 "{vv~}{ll}" format.name$ * }
  1689. X          if$
  1690. X        }
  1691. X      if$
  1692. X    }
  1693. X  if$
  1694. X}
  1695. X
  1696. XFUNCTION {format.book.crossref}
  1697. X{ volume empty$
  1698. X    { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
  1699. X      "In "
  1700. X    }
  1701. X    { "Volume" volume tie.or.space.connect
  1702. X      " of " *
  1703. X    }
  1704. X  if$
  1705. X  editor empty$
  1706. X  editor field.or.null author field.or.null =
  1707. X  or
  1708. X    { key empty$
  1709. X        { series empty$
  1710. X            { "need editor, key, or series for " cite$ * " to crossref " *
  1711. X              crossref * warning$
  1712. X              "" *
  1713. X            }
  1714. X            { "{\em " * series * "\/}" * }
  1715. X          if$
  1716. X        }
  1717. X        { key * }
  1718. X      if$
  1719. X    }
  1720. X    { format.crossref.editor * }
  1721. X  if$
  1722. X  " \cite{" * crossref * "}" *
  1723. X}
  1724. X
  1725. XFUNCTION {format.incoll.inproc.crossref}
  1726. X{ editor empty$
  1727. X  editor field.or.null author field.or.null =
  1728. X  or
  1729. X    { key empty$
  1730. X        { booktitle empty$
  1731. X            { "need editor, key, or booktitle for " cite$ * " to crossref " *
  1732. X              crossref * warning$
  1733. X              ""
  1734. X            }
  1735. X            { "In {\em " booktitle * "\/}" * }
  1736. X          if$
  1737. X        }
  1738. X        { "In " key * }
  1739. X      if$
  1740. X    }
  1741. X    { "In " format.crossref.editor * }
  1742. X  if$
  1743. X  " \cite{" * crossref * "}" *
  1744. X}
  1745. X
  1746. XFUNCTION {article}
  1747. X{ output.bibitem
  1748. X  format.authors "author" output.check
  1749. X  new.block
  1750. X  format.title "title" output.check
  1751. X  new.block
  1752. X  crossref missing$
  1753. X    { journal emphasize "journal" output.check
  1754. X      format.vol.num.pages output
  1755. X      format.date "year" output.check
  1756. X    }
  1757. X    { format.article.crossref output.nonnull
  1758. X      format.pages output
  1759. X    }
  1760. X  if$
  1761. X  new.block
  1762. X  note output
  1763. X  fin.entry
  1764. X}
  1765. X
  1766. XFUNCTION {book}
  1767. X{ output.bibitem
  1768. X  author empty$
  1769. X    { format.editors "author and editor" output.check }
  1770. X    { format.authors output.nonnull
  1771. X      crossref missing$
  1772. X        { "author and editor" editor either.or.check }
  1773. X        'skip$
  1774. X      if$
  1775. X    }
  1776. X  if$
  1777. X  new.block
  1778. X  format.btitle "title" output.check
  1779. X  crossref missing$
  1780. X    { format.bvolume output
  1781. X      new.block
  1782. X      format.number.series output
  1783. X      new.sentence
  1784. X      publisher "publisher" output.check
  1785. X      address output
  1786. X    }
  1787. X    { new.block
  1788. X      format.book.crossref output.nonnull
  1789. X    }
  1790. X  if$
  1791. X  format.edition output
  1792. X  format.date "year" output.check
  1793. X  new.block
  1794. X  note output
  1795. X  fin.entry
  1796. X}
  1797. X
  1798. XFUNCTION {booklet}
  1799. X{ output.bibitem
  1800. X  format.authors output
  1801. X  new.block
  1802. X  format.title "title" output.check
  1803. X  howpublished address new.block.checkb
  1804. X  howpublished output
  1805. X  address output
  1806. X  format.date output
  1807. X  new.block
  1808. X  note output
  1809. X  fin.entry
  1810. X}
  1811. X
  1812. XFUNCTION {inbook}
  1813. X{ output.bibitem
  1814. X  author empty$
  1815. X    { format.editors "author and editor" output.check }
  1816. X    { format.authors output.nonnull
  1817. X      crossref missing$
  1818. X        { "author and editor" editor either.or.check }
  1819. X        'skip$
  1820. X      if$
  1821. X    }
  1822. X  if$
  1823. X  new.block
  1824. X  format.btitle "title" output.check
  1825. X  crossref missing$
  1826. X    { format.bvolume output
  1827. X      format.chapter.pages "chapter and pages" output.check
  1828. X      new.block
  1829. X      format.number.series output
  1830. X      new.sentence
  1831. X      publisher "publisher" output.check
  1832. X      address output
  1833. X    }
  1834. X    { format.chapter.pages "chapter and pages" output.check
  1835. X      new.block
  1836. X      format.book.crossref output.nonnull
  1837. X    }
  1838. X  if$
  1839. X  format.edition output
  1840. X  format.date "year" output.check
  1841. X  new.block
  1842. X  note output
  1843. X  fin.entry
  1844. X}
  1845. X
  1846. XFUNCTION {incollection}
  1847. X{ output.bibitem
  1848. X  format.authors "author" output.check
  1849. X  new.block
  1850. X  format.title "title" output.check
  1851. X  new.block
  1852. X  crossref missing$
  1853. X    { format.in.ed.booktitle "booktitle" output.check
  1854. X      format.bvolume output
  1855. X      format.number.series output
  1856. X      format.chapter.pages output
  1857. X      new.sentence
  1858. X      publisher "publisher" output.check
  1859. X      address output
  1860. X      format.edition output
  1861. X      format.date "year" output.check
  1862. X    }
  1863. X    { format.incoll.inproc.crossref output.nonnull
  1864. X      format.chapter.pages output
  1865. X    }
  1866. X  if$
  1867. X  new.block
  1868. X  note output
  1869. X  fin.entry
  1870. X}
  1871. X
  1872. XFUNCTION {inproceedings}
  1873. X{ output.bibitem
  1874. X  format.authors "author" output.check
  1875. X  new.block
  1876. X  format.title "title" output.check
  1877. X  new.block
  1878. X  crossref missing$
  1879. X    { format.in.ed.booktitle "booktitle" output.check
  1880. X      format.bvolume output
  1881. X      format.number.series output
  1882. X      format.pages output
  1883. X      address empty$
  1884. X        { organization publisher new.sentence.checkb
  1885. X          organization output
  1886. X          publisher output
  1887. X          format.date "year" output.check
  1888. X        }
  1889. X        { address output.nonnull
  1890. X          format.date "year" output.check
  1891. X          new.sentence
  1892. X          organization output
  1893. X          publisher output
  1894. X        }
  1895. X      if$
  1896. X    }
  1897. X    { format.incoll.inproc.crossref output.nonnull
  1898. X      format.pages output
  1899. X    }
  1900. X  if$
  1901. X  new.block
  1902. X  note output
  1903. X  fin.entry
  1904. X}
  1905. X
  1906. XFUNCTION {conference} { inproceedings }
  1907. X
  1908. XFUNCTION {manual}
  1909. X{ output.bibitem
  1910. X  author empty$
  1911. X    { organization empty$
  1912. X        'skip$
  1913. X        { organization output.nonnull
  1914. X          address output
  1915. X        }
  1916. X      if$
  1917. X    }
  1918. X    { format.authors output.nonnull }
  1919. X  if$
  1920. X  new.block
  1921. X  format.btitle "title" output.check
  1922. X  author empty$
  1923. X    { organization empty$
  1924. X        { address new.block.checka
  1925. X          address output
  1926. X        }
  1927. X        'skip$
  1928. X      if$
  1929. X    }
  1930. X    { organization address new.block.checkb
  1931. X      organization output
  1932. X      address output
  1933. X    }
  1934. X  if$
  1935. X  format.edition output
  1936. X  format.date output
  1937. X  new.block
  1938. X  note output
  1939. X  fin.entry
  1940. X}
  1941. X
  1942. XFUNCTION {mastersthesis}
  1943. X{ output.bibitem
  1944. X  format.authors "author" output.check
  1945. X  new.block
  1946. X  format.title "title" output.check
  1947. X  new.block
  1948. X  "Master's thesis" format.thesis.type output.nonnull
  1949. X  school "school" output.check
  1950. X  address output
  1951. X  format.date "year" output.check
  1952. X  new.block
  1953. X  note output
  1954. X  fin.entry
  1955. X}
  1956. X
  1957. XFUNCTION {misc}
  1958. X{ output.bibitem
  1959. X  format.authors output
  1960. X  title howpublished new.block.checkb
  1961. X  format.title output
  1962. X  howpublished new.block.checka
  1963. X  howpublished output
  1964. X  format.date output
  1965. X  new.block
  1966. X  note output
  1967. X  fin.entry
  1968. X  empty.misc.check
  1969. X}
  1970. X
  1971. XFUNCTION {phdthesis}
  1972. X{ output.bibitem
  1973. X  format.authors "author" output.check
  1974. X  new.block
  1975. X  format.btitle "title" output.check
  1976. X  new.block
  1977. X  "PhD thesis" format.thesis.type output.nonnull
  1978. X  school "school" output.check
  1979. X  address output
  1980. X  format.date "year" output.check
  1981. X  new.block
  1982. X  note output
  1983. X  fin.entry
  1984. X}
  1985. X
  1986. XFUNCTION {proceedings}
  1987. X{ output.bibitem
  1988. X  editor empty$
  1989. X    { organization output }
  1990. X    { format.editors output.nonnull }
  1991. X  if$
  1992. X  new.block
  1993. X  format.btitle "title" output.check
  1994. X  format.bvolume output
  1995. X  format.number.series output
  1996. X  address empty$
  1997. X    { editor empty$
  1998. X        { publisher new.sentence.checka }
  1999. X        { organization publisher new.sentence.checkb
  2000. X          organization output
  2001. X        }
  2002. X      if$
  2003. X      publisher output
  2004. X      format.date "year" output.check
  2005. X    }
  2006. X    { address output.nonnull
  2007. X      format.date "year" output.check
  2008. X      new.sentence
  2009. X      editor empty$
  2010. X        'skip$
  2011. X        { organization output }
  2012. X      if$
  2013. X      publisher output
  2014. X    }
  2015. X  if$
  2016. X  new.block
  2017. X  note output
  2018. X  fin.entry
  2019. X}
  2020. X
  2021. XFUNCTION {techreport}
  2022. X{ output.bibitem
  2023. X  format.authors "author" output.check
  2024. X  new.block
  2025. X  format.title "title" output.check
  2026. X  new.block
  2027. X  format.tr.number output.nonnull
  2028. X  institution "institution" output.check
  2029. X  address output
  2030. X  format.date "year" output.check
  2031. X  new.block
  2032. X  note output
  2033. X  fin.entry
  2034. X}
  2035. X
  2036. XFUNCTION {unpublished}
  2037. X{ output.bibitem
  2038. X  format.authors "author" output.check
  2039. X  new.block
  2040. X  format.title "title" output.check
  2041. X  new.block
  2042. X  note "note" output.check
  2043. X  format.date output
  2044. X  fin.entry
  2045. X}
  2046. X
  2047. XFUNCTION {default.type} { misc }
  2048. X
  2049. XMACRO {jan} {"January"}
  2050. X
  2051. XMACRO {feb} {"February"}
  2052. X
  2053. XMACRO {mar} {"March"}
  2054. X
  2055. XMACRO {apr} {"April"}
  2056. X
  2057. XMACRO {may} {"May"}
  2058. X
  2059. XMACRO {jun} {"June"}
  2060. X
  2061. XMACRO {jul} {"July"}
  2062. X
  2063. XMACRO {aug} {"August"}
  2064. X
  2065. XMACRO {sep} {"September"}
  2066. X
  2067. XMACRO {oct} {"October"}
  2068. X
  2069. XMACRO {nov} {"November"}
  2070. X
  2071. XMACRO {dec} {"December"}
  2072. X
  2073. XMACRO {acmcs} {"ACM Computing Surveys"}
  2074. X
  2075. XMACRO {acta} {"Acta Informatica"}
  2076. X
  2077. XMACRO {cacm} {"Communications of the ACM"}
  2078. X
  2079. XMACRO {ibmjrd} {"IBM Journal of Research and Development"}
  2080. X
  2081. XMACRO {ibmsj} {"IBM Systems Journal"}
  2082. X
  2083. XMACRO {ieeese} {"IEEE Transactions on Software Engineering"}
  2084. X
  2085. XMACRO {ieeetc} {"IEEE Transactions on Computers"}
  2086. X
  2087. XMACRO {ieeetcad}
  2088. X {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
  2089. X
  2090. XMACRO {ipl} {"Information Processing Letters"}
  2091. X
  2092. XMACRO {jacm} {"Journal of the ACM"}
  2093. X
  2094. XMACRO {jcss} {"Journal of Computer and System Sciences"}
  2095. X
  2096. XMACRO {scp} {"Science of Computer Programming"}
  2097. X
  2098. XMACRO {sicomp} {"SIAM Journal on Computing"}
  2099. X
  2100. XMACRO {tocs} {"ACM Transactions on Computer Systems"}
  2101. X
  2102. XMACRO {tods} {"ACM Transactions on Database Systems"}
  2103. X
  2104. XMACRO {tog} {"ACM Transactions on Graphics"}
  2105. X
  2106. XMACRO {toms} {"ACM Transactions on Mathematical Software"}
  2107. X
  2108. XMACRO {toois} {"ACM Transactions on Office Information Systems"}
  2109. X
  2110. XMACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
  2111. X
  2112. XMACRO {tcs} {"Theoretical Computer Science"}
  2113. X
  2114. XREAD
  2115. X
  2116. XSTRINGS { longest.label }
  2117. X
  2118. XINTEGERS { number.label longest.label.width }
  2119. X
  2120. XFUNCTION {initialize.longest.label}
  2121. X{ "" 'longest.label :=
  2122. X  #1 'number.label :=
  2123. X  #0 'longest.label.width :=
  2124. X}
  2125. X
  2126. XFUNCTION {longest.label.pass}
  2127. X{ number.label int.to.str$ 'label :=
  2128. X  number.label #1 + 'number.label :=
  2129. X  label width$ longest.label.width >
  2130. X    { label 'longest.label :=
  2131. X      label width$ 'longest.label.width :=
  2132. X    }
  2133. X    'skip$
  2134. X  if$
  2135. X}
  2136. X
  2137. XEXECUTE {initialize.longest.label}
  2138. X
  2139. XITERATE {longest.label.pass}
  2140. X
  2141. XFUNCTION {begin.bib}
  2142. X{ preamble$ empty$
  2143. X    'skip$
  2144. X    { preamble$ write$ newline$ }
  2145. X  if$
  2146. X  "\begin{thebibliography}{"  longest.label  * "}" * write$ newline$
  2147. X}
  2148. X
  2149. XEXECUTE {begin.bib}
  2150. X
  2151. XEXECUTE {init.state.consts}
  2152. X
  2153. XITERATE {call.type$}
  2154. X
  2155. XFUNCTION {end.bib}
  2156. X{ newline$
  2157. X  "\end{thebibliography}" write$ newline$
  2158. X}
  2159. X
  2160. XEXECUTE {end.bib}
  2161. END_OF_FILE
  2162. if test 19113 -ne `wc -c <'unsrt.bst'`; then
  2163.     echo shar: \"'unsrt.bst'\" unpacked with wrong size!
  2164. fi
  2165. # end of 'unsrt.bst'
  2166. fi
  2167. if test -f 'apalike.bst' -a "${1}" != "-c" ; then 
  2168.   echo shar: Will not clobber existing file \"'apalike.bst'\"
  2169. else
  2170. echo shar: Extracting \"'apalike.bst'\" \(22921 characters\)
  2171. sed "s/^X//" >'apalike.bst' <<'END_OF_FILE'
  2172. X% Style file modified on Tue Jun  8 12:31:04 1993 with `annotebib.el' v1.5.1
  2173. X%                     by Yves.Arrouye <arrouye@cosmos>
  2174. X%                     to support the `annote' annotation field.
  2175. X% Style file modified on Tue Jun  8 12:31:04 1993 with `annotebib.el' v1.5.1
  2176. X%                     by Yves.Arrouye <arrouye@cosmos>
  2177. X%                     to support the `commentaire' annotation field.
  2178. X
  2179. X% This bibliography style was made `annote'-compatible by "annotebib.el".
  2180. X% It can be used for both annotated and non-annotated bibliographies listing
  2181. X% (`annote' package by Yves Arrouye <arrouye@imag.imag.fr>).
  2182. X
  2183. X% BibTeX `apalike' bibliography style (24-Jan-88 version)
  2184. X% Adapted from the `alpha' style, version 0.99a; for BibTeX version 0.99a.
  2185. X% Copyright (C) 1988, all rights reserved.
  2186. X% Copying of this file is allowed, provided that if you make any changes at all
  2187. X% you name it something other than `apalike.bst'.
  2188. X% This restriction helps ensure that all copies are identical.
  2189. X% Differences between this style and `alpha' are generally heralded by a `%'.
  2190. X% The file btxbst.doc has the documentation for alpha.bst.
  2191. X%
  2192. X% This style should be used with the `apalike' LaTeX style (apalike.sty).
  2193. X% \cite's come out like "(Jones, 1986)" in the text but there are no labels
  2194. X% in the bibliography, and something like "(1986)" comes out immediately
  2195. X% after the author.  Author (and editor) names appear as last name, comma,
  2196. X% initials.  A `year' field is required for every entry, and so is either
  2197. X% an author (or in some cases, an editor) field or a key field.
  2198. X%
  2199. X% Editorial note:
  2200. X% Many journals require a style like `apalike', but I strongly, strongly,
  2201. X% strongly recommend that you not use it if you have a choice---use something
  2202. X% like `plain' instead.  Mary-Claire van Leunen (A Handbook for Scholars,
  2203. X% Knopf, 1979) argues convincingly that a style like `plain' encourages better
  2204. X% writing than one like `apalike'.  Furthermore the strongest arguments for
  2205. X% using an author-date style like `apalike'---that it's "the most practical"
  2206. X% (The Chicago Manual of Style, University of Chicago Press, thirteenth
  2207. X% edition, 1982, pages 400--401)---fall flat on their face with the new
  2208. X% computer-typesetting technology.  For instance page 401 anachronistically
  2209. X% states "The chief disadvantage of [a style like `plain'] is that additions
  2210. X% or deletions cannot be made after the manuscript is typed without changing
  2211. X% numbers in both text references and list."  LaTeX sidesteps the disadvantage.
  2212. X%
  2213. X% History:
  2214. X%   15-sep-86    (SK,OP)    Original version, by Susan King and Oren Patashnik.
  2215. X%   10-nov-86    (OP)    Truncated the sort.key$ string to the correct length
  2216. X%            in bib.sort.order to eliminate error message.
  2217. X%   24-jan-88    (OP)    Updated for BibTeX version 0.99a, from alpha.bst 0.99a;
  2218. X%            apalike now sorts by author, then year, then title;
  2219. X%            THIS `apalike' VERSION DOES NOT WORK WITH BIBTEX 0.98i.
  2220. X
  2221. XENTRY
  2222. X  { annote
  2223. X    commentaire
  2224. X    address
  2225. X    author
  2226. X    booktitle
  2227. X    chapter
  2228. X    edition
  2229. X    editor
  2230. X    howpublished
  2231. X    institution
  2232. X    journal
  2233. X    key
  2234. X%    month        not used in apalike
  2235. X    note
  2236. X    number
  2237. X    organization
  2238. X    pages
  2239. X    publisher
  2240. X    school
  2241. X    series
  2242. X    title
  2243. X    type
  2244. X    volume
  2245. X    year
  2246. X  }
  2247. X  {}
  2248. X  { label extra.label sort.label }
  2249. X
  2250. XINTEGERS { output.state before.all mid.sentence after.sentence after.block }
  2251. X
  2252. XFUNCTION {init.state.consts}
  2253. X{ #0 'before.all :=
  2254. X  #1 'mid.sentence :=
  2255. X  #2 'after.sentence :=
  2256. X  #3 'after.block :=
  2257. X}
  2258. X
  2259. XSTRINGS { s t }
  2260. X
  2261. XFUNCTION {output.nonnull}
  2262. X{ 's :=
  2263. X  output.state mid.sentence =
  2264. X    { ", " * write$ }
  2265. X    { output.state after.block =
  2266. X    { add.period$ write$
  2267. X      newline$
  2268. X      "\newblock " write$
  2269. X    }
  2270. X    { output.state before.all =
  2271. X        'write$
  2272. X        { add.period$ " " * write$ }
  2273. X      if$
  2274. X    }
  2275. X      if$
  2276. X      mid.sentence 'output.state :=
  2277. X    }
  2278. X  if$
  2279. X  s
  2280. X}
  2281. X
  2282. XFUNCTION {output}
  2283. X{ duplicate$ empty$
  2284. X    'pop$
  2285. X    'output.nonnull
  2286. X  if$
  2287. X}
  2288. X
  2289. XFUNCTION {output.check}
  2290. X{ 't :=
  2291. X  duplicate$ empty$
  2292. X    { pop$ "empty " t * " in " * cite$ * warning$ }
  2293. X    'output.nonnull
  2294. X  if$
  2295. X}
  2296. X
  2297. X%                    apalike needs this function because
  2298. X%                    the year has special punctuation;
  2299. X%                    apalike ignores the month
  2300. XFUNCTION {output.year.check}
  2301. X{ year empty$
  2302. X    { "empty year in " cite$ * warning$ }
  2303. X    { write$
  2304. X      " (" year * extra.label * ")" *
  2305. X      mid.sentence 'output.state :=
  2306. X    }
  2307. X  if$
  2308. X}
  2309. X
  2310. XFUNCTION {output.bibitem}
  2311. X{ newline$
  2312. X  "\bibitem[" write$
  2313. X  label write$
  2314. X  "]{" write$
  2315. X  cite$ write$
  2316. X  "}" write$
  2317. X  newline$
  2318. X  ""
  2319. X  before.all 'output.state :=
  2320. X}
  2321. X
  2322. XFUNCTION {annotebib.format.commentaire}
  2323. X{ commentaire empty$
  2324. X        { "" }
  2325. X        { "\ifx\commentaire\undefined\else\begin{commentaire} "
  2326. X          commentaire
  2327. X          * " \end{commentaire}\fi " *
  2328. X        }
  2329. X      if$
  2330. X}
  2331. X
  2332. XFUNCTION {annotebib.format.annote}
  2333. X{ annote empty$
  2334. X        { "" }
  2335. X        { "\ifx\annote\undefined\else\begin{annote} "
  2336. X          annote
  2337. X          * " \end{annote}\fi " *
  2338. X        }
  2339. X      if$
  2340. X}
  2341. X
  2342. XFUNCTION {fin.entry}
  2343. X{ add.period$
  2344. X  write$
  2345. X  newline$
  2346. X  annotebib.format.commentaire write$
  2347. X  annotebib.format.annote write$
  2348. X}
  2349. X
  2350. XFUNCTION {new.block}
  2351. X{ output.state before.all =
  2352. X    'skip$
  2353. X    { after.block 'output.state := }
  2354. X  if$
  2355. X}
  2356. X
  2357. XFUNCTION {new.sentence}
  2358. X{ output.state after.block =
  2359. X    'skip$
  2360. X    { output.state before.all =
  2361. X    'skip$
  2362. X    { after.sentence 'output.state := }
  2363. X      if$
  2364. X    }
  2365. X  if$
  2366. X}
  2367. X
  2368. XFUNCTION {not}
  2369. X{   { #0 }
  2370. X    { #1 }
  2371. X  if$
  2372. X}
  2373. X
  2374. XFUNCTION {and}
  2375. X{   'skip$
  2376. X    { pop$ #0 }
  2377. X  if$
  2378. X}
  2379. X
  2380. XFUNCTION {or}
  2381. X{   { pop$ #1 }
  2382. X    'skip$
  2383. X  if$
  2384. X}
  2385. X
  2386. XFUNCTION {new.block.checkb}
  2387. X{ empty$
  2388. X  swap$ empty$
  2389. X  and
  2390. X    'skip$
  2391. X    'new.block
  2392. X  if$
  2393. X}
  2394. X
  2395. XFUNCTION {field.or.null}
  2396. X{ duplicate$ empty$
  2397. X    { pop$ "" }
  2398. X    'skip$
  2399. X  if$
  2400. X}
  2401. X
  2402. XFUNCTION {emphasize}
  2403. X{ duplicate$ empty$
  2404. X    { pop$ "" }
  2405. X    { "{\em " swap$ * "}" * }
  2406. X  if$
  2407. X}
  2408. X
  2409. XINTEGERS { nameptr namesleft numnames }
  2410. X
  2411. XFUNCTION {format.names}
  2412. X{ 's :=
  2413. X  #1 'nameptr :=
  2414. X  s num.names$ 'numnames :=
  2415. X  numnames 'namesleft :=
  2416. X    { namesleft #0 > }
  2417. X    { s nameptr "{vv~}{ll}{, jj}{, f.}" format.name$ 't :=   % last name first
  2418. X      nameptr #1 >
  2419. X    { namesleft #1 >
  2420. X        { ", " * t * }
  2421. X        { numnames #2 >
  2422. X        { "," * }
  2423. X        'skip$
  2424. X          if$
  2425. X          t "others" =
  2426. X        { " et~al." * }
  2427. X        { " and " * t * }
  2428. X          if$
  2429. X        }
  2430. X      if$
  2431. X    }
  2432. X    't
  2433. X      if$
  2434. X      nameptr #1 + 'nameptr :=
  2435. X      namesleft #1 - 'namesleft :=
  2436. X    }
  2437. X  while$
  2438. X}
  2439. X
  2440. XFUNCTION {format.authors}
  2441. X{ author empty$
  2442. X    { "" }
  2443. X    { author format.names }
  2444. X  if$
  2445. X}
  2446. X
  2447. XFUNCTION {format.key}            % this function is just for apalike
  2448. X{ empty$
  2449. X    { key field.or.null }
  2450. X    { "" }
  2451. X  if$
  2452. X}
  2453. X
  2454. XFUNCTION {format.editors}
  2455. X{ editor empty$
  2456. X    { "" }
  2457. X    { editor format.names
  2458. X      editor num.names$ #1 >
  2459. X    { ", editors" * }
  2460. X    { ", editor" * }
  2461. X      if$
  2462. X    }
  2463. X  if$
  2464. X}
  2465. X
  2466. XFUNCTION {format.title}
  2467. X{ title empty$
  2468. X    { "" }
  2469. X    { title "t" change.case$ }
  2470. X  if$
  2471. X}
  2472. X
  2473. XFUNCTION {n.dashify}
  2474. X{ 't :=
  2475. X  ""
  2476. X    { t empty$ not }
  2477. X    { t #1 #1 substring$ "-" =
  2478. X    { t #1 #2 substring$ "--" = not
  2479. X        { "--" *
  2480. X          t #2 global.max$ substring$ 't :=
  2481. X        }
  2482. X        {   { t #1 #1 substring$ "-" = }
  2483. X        { "-" *
  2484. X          t #2 global.max$ substring$ 't :=
  2485. X        }
  2486. X          while$
  2487. X        }
  2488. X      if$
  2489. X    }
  2490. X    { t #1 #1 substring$ *
  2491. X      t #2 global.max$ substring$ 't :=
  2492. X    }
  2493. X      if$
  2494. X    }
  2495. X  while$
  2496. X}
  2497. X
  2498. XFUNCTION {format.btitle}
  2499. X{ title emphasize
  2500. X}
  2501. X
  2502. XFUNCTION {tie.or.space.connect}
  2503. X{ duplicate$ text.length$ #3 <
  2504. X    { "~" }
  2505. X    { " " }
  2506. X  if$
  2507. X  swap$ * *
  2508. X}
  2509. X
  2510. XFUNCTION {either.or.check}
  2511. X{ empty$
  2512. X    'pop$
  2513. X    { "can't use both " swap$ * " fields in " * cite$ * warning$ }
  2514. X  if$
  2515. X}
  2516. X
  2517. XFUNCTION {format.bvolume}
  2518. X{ volume empty$
  2519. X    { "" }
  2520. X    { "volume" volume tie.or.space.connect
  2521. X      series empty$
  2522. X    'skip$
  2523. X    { " of " * series emphasize * }
  2524. X      if$
  2525. X      "volume and number" number either.or.check
  2526. X    }
  2527. X  if$
  2528. X}
  2529. X
  2530. XFUNCTION {format.number.series}
  2531. X{ volume empty$
  2532. X    { number empty$
  2533. X    { series field.or.null }
  2534. X    { output.state mid.sentence =
  2535. X        { "number" }
  2536. X        { "Number" }
  2537. X      if$
  2538. X      number tie.or.space.connect
  2539. X      series empty$
  2540. X        { "there's a number but no series in " cite$ * warning$ }
  2541. X        { " in " * series * }
  2542. X      if$
  2543. X    }
  2544. X      if$
  2545. X    }
  2546. X    { "" }
  2547. X  if$
  2548. X}
  2549. X
  2550. XFUNCTION {format.edition}
  2551. X{ edition empty$
  2552. X    { "" }
  2553. X    { output.state mid.sentence =
  2554. X    { edition "l" change.case$ " edition" * }
  2555. X    { edition "t" change.case$ " edition" * }
  2556. X      if$
  2557. X    }
  2558. X  if$
  2559. X}
  2560. X
  2561. XINTEGERS { multiresult }
  2562. X
  2563. XFUNCTION {multi.page.check}
  2564. X{ 't :=
  2565. X  #0 'multiresult :=
  2566. X    { multiresult not
  2567. X      t empty$ not
  2568. X      and
  2569. X    }
  2570. X    { t #1 #1 substring$
  2571. X      duplicate$ "-" =
  2572. X      swap$ duplicate$ "," =
  2573. X      swap$ "+" =
  2574. X      or or
  2575. X    { #1 'multiresult := }
  2576. X    { t #2 global.max$ substring$ 't := }
  2577. X      if$
  2578. X    }
  2579. X  while$
  2580. X  multiresult
  2581. X}
  2582. X
  2583. XFUNCTION {format.pages}
  2584. X{ pages empty$
  2585. X    { "" }
  2586. X    { pages multi.page.check
  2587. X    { "pages" pages n.dashify tie.or.space.connect }
  2588. X    { "page" pages tie.or.space.connect }
  2589. X      if$
  2590. X    }
  2591. X  if$
  2592. X}
  2593. X
  2594. XFUNCTION {format.vol.num.pages}
  2595. X{ volume field.or.null
  2596. X  number empty$
  2597. X    'skip$
  2598. X    { "(" number * ")" * *
  2599. X      volume empty$
  2600. X    { "there's a number but no volume in " cite$ * warning$ }
  2601. X    'skip$
  2602. X      if$
  2603. X    }
  2604. X  if$
  2605. X  pages empty$
  2606. X    'skip$
  2607. X    { duplicate$ empty$
  2608. X    { pop$ format.pages }
  2609. X    { ":" * pages n.dashify * }
  2610. X      if$
  2611. X    }
  2612. X  if$
  2613. X}
  2614. X
  2615. XFUNCTION {format.chapter.pages}
  2616. X{ chapter empty$
  2617. X    'format.pages
  2618. X    { type empty$
  2619. X    { "chapter" }
  2620. X    { type "l" change.case$ }
  2621. X      if$
  2622. X      chapter tie.or.space.connect
  2623. X      pages empty$
  2624. X    'skip$
  2625. X    { ", " * format.pages * }
  2626. X      if$
  2627. X    }
  2628. X  if$
  2629. X}
  2630. X
  2631. XFUNCTION {format.in.ed.booktitle}
  2632. X{ booktitle empty$
  2633. X    { "" }
  2634. X    { editor empty$
  2635. X    { "In " booktitle emphasize * }
  2636. X    { "In " format.editors * ", " * booktitle emphasize * }
  2637. X      if$
  2638. X    }
  2639. X  if$
  2640. X}
  2641. X
  2642. XFUNCTION {format.thesis.type}
  2643. X{ type empty$
  2644. X    'skip$
  2645. X    { pop$
  2646. X      type "t" change.case$
  2647. X    }
  2648. X  if$
  2649. X}
  2650. X
  2651. XFUNCTION {format.tr.number}
  2652. X{ type empty$
  2653. X    { "Technical Report" }
  2654. X    'type
  2655. X  if$
  2656. X  number empty$
  2657. X    { "t" change.case$ }
  2658. X    { number tie.or.space.connect }
  2659. X  if$
  2660. X}
  2661. X
  2662. XFUNCTION {format.article.crossref}
  2663. X{ "In"                            % this is for apalike
  2664. X  " \cite{" * crossref * "}" *
  2665. X}
  2666. X
  2667. XFUNCTION {format.book.crossref}
  2668. X{ volume empty$
  2669. X    { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
  2670. X      "In "
  2671. X    }
  2672. X    { "Volume" volume tie.or.space.connect
  2673. X      " of " *
  2674. X    }
  2675. X  if$
  2676. X  "\cite{" * crossref * "}" *                % this is for apalike
  2677. X}
  2678. X
  2679. XFUNCTION {format.incoll.inproc.crossref}
  2680. X{ "In"                            % this is for apalike
  2681. X  " \cite{" * crossref * "}" *
  2682. X}
  2683. X
  2684. XFUNCTION {article}
  2685. X{ output.bibitem
  2686. X  format.authors "author" output.check
  2687. X  author format.key output                % special for
  2688. X  output.year.check                    % apalike
  2689. X  new.block
  2690. X  format.title "title" output.check
  2691. X  new.block
  2692. X  crossref missing$
  2693. X    { journal emphasize "journal" output.check
  2694. X      format.vol.num.pages output
  2695. X    }
  2696. X    { format.article.crossref output.nonnull
  2697. X      format.pages output
  2698. X    }
  2699. X  if$
  2700. X  new.block
  2701. X  note output
  2702. X  fin.entry
  2703. X}
  2704. X
  2705. XFUNCTION {book}
  2706. X{ output.bibitem
  2707. X  author empty$
  2708. X    { format.editors "author and editor" output.check
  2709. X      editor format.key output
  2710. X    }
  2711. X    { format.authors output.nonnull
  2712. X      crossref missing$
  2713. X    { "author and editor" editor either.or.check }
  2714. X    'skip$
  2715. X      if$
  2716. X    }
  2717. X  if$
  2718. X  output.year.check                % special for apalike
  2719. X  new.block
  2720. X  format.btitle "title" output.check
  2721. X  crossref missing$
  2722. X    { format.bvolume output
  2723. X      new.block
  2724. X      format.number.series output
  2725. X      new.sentence
  2726. X      publisher "publisher" output.check
  2727. X      address output
  2728. X    }
  2729. X    { new.block
  2730. X      format.book.crossref output.nonnull
  2731. X    }
  2732. X  if$
  2733. X  format.edition output
  2734. X  new.block
  2735. X  note output
  2736. X  fin.entry
  2737. X}
  2738. X
  2739. XFUNCTION {booklet}
  2740. X{ output.bibitem
  2741. X  format.authors output
  2742. X  author format.key output                % special for
  2743. X  output.year.check                    % apalike
  2744. X  new.block
  2745. X  format.title "title" output.check
  2746. X  new.block
  2747. X  howpublished output
  2748. X  address output
  2749. X  new.block
  2750. X  note output
  2751. X  fin.entry
  2752. X}
  2753. X
  2754. XFUNCTION {inbook}
  2755. X{ output.bibitem
  2756. X  author empty$
  2757. X    { format.editors "author and editor" output.check
  2758. X      editor format.key output
  2759. X    }
  2760. X    { format.authors output.nonnull
  2761. X      crossref missing$
  2762. X    { "author and editor" editor either.or.check }
  2763. X    'skip$
  2764. X      if$
  2765. X    }
  2766. X  if$
  2767. X  output.year.check                % special for apalike
  2768. X  new.block
  2769. X  format.btitle "title" output.check
  2770. X  crossref missing$
  2771. X    { format.bvolume output
  2772. X      format.chapter.pages "chapter and pages" output.check
  2773. X      new.block
  2774. X      format.number.series output
  2775. X      new.sentence
  2776. X      publisher "publisher" output.check
  2777. X      address output
  2778. X    }
  2779. X    { format.chapter.pages "chapter and pages" output.check
  2780. X      new.block
  2781. X      format.book.crossref output.nonnull
  2782. X    }
  2783. X  if$
  2784. X  format.edition output
  2785. X  new.block
  2786. X  note output
  2787. X  fin.entry
  2788. X}
  2789. X
  2790. XFUNCTION {incollection}
  2791. X{ output.bibitem
  2792. X  format.authors "author" output.check
  2793. X  author format.key output                % special for
  2794. X  output.year.check                    % apalike
  2795. X  new.block
  2796. X  format.title "title" output.check
  2797. X  new.block
  2798. X  crossref missing$
  2799. X    { format.in.ed.booktitle "booktitle" output.check
  2800. X      format.bvolume output
  2801. X      format.number.series output
  2802. X      format.chapter.pages output
  2803. X      new.sentence
  2804. X      publisher "publisher" output.check
  2805. X      address output
  2806. X      format.edition output
  2807. X    }
  2808. X    { format.incoll.inproc.crossref output.nonnull
  2809. X      format.chapter.pages output
  2810. X    }
  2811. X  if$
  2812. X  new.block
  2813. X  note output
  2814. X  fin.entry
  2815. X}
  2816. X
  2817. XFUNCTION {inproceedings}
  2818. X{ output.bibitem
  2819. X  format.authors "author" output.check
  2820. X  author format.key output                % special for
  2821. X  output.year.check                    % apalike
  2822. X  new.block
  2823. X  format.title "title" output.check
  2824. X  new.block
  2825. X  crossref missing$
  2826. X    { format.in.ed.booktitle "booktitle" output.check
  2827. X      format.bvolume output
  2828. X      format.number.series output
  2829. X      format.pages output
  2830. X      address output                    % for apalike
  2831. X      new.sentence                    % there's no year
  2832. X      organization output                % here so things
  2833. X      publisher output                    % are simpler
  2834. X    }
  2835. X    { format.incoll.inproc.crossref output.nonnull
  2836. X      format.pages output
  2837. X    }
  2838. X  if$
  2839. X  new.block
  2840. X  note output
  2841. X  fin.entry
  2842. X}
  2843. X
  2844. XFUNCTION {conference} { inproceedings }
  2845. X
  2846. XFUNCTION {manual}
  2847. X{ output.bibitem
  2848. X  format.authors output
  2849. X  author format.key output                % special for
  2850. X  output.year.check                    % apalike
  2851. X  new.block
  2852. X  format.btitle "title" output.check
  2853. X  organization address new.block.checkb
  2854. X  organization output
  2855. X  address output
  2856. X  format.edition output
  2857. X  new.block
  2858. X  note output
  2859. X  fin.entry
  2860. X}
  2861. X
  2862. XFUNCTION {mastersthesis}
  2863. X{ output.bibitem
  2864. X  format.authors "author" output.check
  2865. X  author format.key output                % special for
  2866. X  output.year.check                    % apalike
  2867. X  new.block
  2868. X  format.title "title" output.check
  2869. X  new.block
  2870. X  "Master's thesis" format.thesis.type output.nonnull
  2871. X  school "school" output.check
  2872. X  address output
  2873. X  new.block
  2874. X  note output
  2875. X  fin.entry
  2876. X}
  2877. X
  2878. XFUNCTION {misc}
  2879. X{ output.bibitem
  2880. X  format.authors output
  2881. X  author format.key output                % special for
  2882. X  output.year.check                    % apalike
  2883. X  new.block
  2884. X  format.title output
  2885. X  new.block
  2886. X  howpublished output
  2887. X  new.block
  2888. X  note output
  2889. X  fin.entry
  2890. X}
  2891. X
  2892. XFUNCTION {phdthesis}
  2893. X{ output.bibitem
  2894. X  format.authors "author" output.check
  2895. X  author format.key output                % special for
  2896. X  output.year.check                    % apalike
  2897. X  new.block
  2898. X  format.btitle "title" output.check
  2899. X  new.block
  2900. X  "PhD thesis" format.thesis.type output.nonnull
  2901. X  school "school" output.check
  2902. X  address output
  2903. X  new.block
  2904. X  note output
  2905. X  fin.entry
  2906. X}
  2907. X
  2908. XFUNCTION {proceedings}
  2909. X{ output.bibitem
  2910. X  format.editors output
  2911. X  editor format.key output                % special for
  2912. X  output.year.check                    % apalike
  2913. X  new.block
  2914. X  format.btitle "title" output.check
  2915. X  format.bvolume output
  2916. X  format.number.series output
  2917. X  address output                % for apalike
  2918. X  new.sentence                    % we always output
  2919. X  organization output                % a nonempty organization
  2920. X  publisher output                % here
  2921. X  new.block
  2922. X  note output
  2923. X  fin.entry
  2924. X}
  2925. X
  2926. XFUNCTION {techreport}
  2927. X{ output.bibitem
  2928. X  format.authors "author" output.check
  2929. X  author format.key output                % special for
  2930. X  output.year.check                    % apalike
  2931. X  new.block
  2932. X  format.title "title" output.check
  2933. X  new.block
  2934. X  format.tr.number output.nonnull
  2935. X  institution "institution" output.check
  2936. X  address output
  2937. X  new.block
  2938. X  note output
  2939. X  fin.entry
  2940. X}
  2941. X
  2942. XFUNCTION {unpublished}
  2943. X{ output.bibitem
  2944. X  format.authors "author" output.check
  2945. X  author format.key output                % special for
  2946. X  output.year.check                    % apalike
  2947. X  new.block
  2948. X  format.title "title" output.check
  2949. X  new.block
  2950. X  note "note" output.check
  2951. X  fin.entry
  2952. X}
  2953. X
  2954. XFUNCTION {default.type} { misc }
  2955. X
  2956. XMACRO {jan} {"January"}
  2957. X
  2958. XMACRO {feb} {"February"}
  2959. X
  2960. XMACRO {mar} {"March"}
  2961. X
  2962. XMACRO {apr} {"April"}
  2963. X
  2964. XMACRO {may} {"May"}
  2965. X
  2966. XMACRO {jun} {"June"}
  2967. X
  2968. XMACRO {jul} {"July"}
  2969. X
  2970. XMACRO {aug} {"August"}
  2971. X
  2972. XMACRO {sep} {"September"}
  2973. X
  2974. XMACRO {oct} {"October"}
  2975. X
  2976. XMACRO {nov} {"November"}
  2977. X
  2978. XMACRO {dec} {"December"}
  2979. X
  2980. XMACRO {acmcs} {"ACM Computing Surveys"}
  2981. X
  2982. XMACRO {acta} {"Acta Informatica"}
  2983. X
  2984. XMACRO {cacm} {"Communications of the ACM"}
  2985. X
  2986. XMACRO {ibmjrd} {"IBM Journal of Research and Development"}
  2987. X
  2988. XMACRO {ibmsj} {"IBM Systems Journal"}
  2989. X
  2990. XMACRO {ieeese} {"IEEE Transactions on Software Engineering"}
  2991. X
  2992. XMACRO {ieeetc} {"IEEE Transactions on Computers"}
  2993. X
  2994. XMACRO {ieeetcad}
  2995. X {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
  2996. X
  2997. XMACRO {ipl} {"Information Processing Letters"}
  2998. X
  2999. XMACRO {jacm} {"Journal of the ACM"}
  3000. X
  3001. XMACRO {jcss} {"Journal of Computer and System Sciences"}
  3002. X
  3003. XMACRO {scp} {"Science of Computer Programming"}
  3004. X
  3005. XMACRO {sicomp} {"SIAM Journal on Computing"}
  3006. X
  3007. XMACRO {tocs} {"ACM Transactions on Computer Systems"}
  3008. X
  3009. XMACRO {tods} {"ACM Transactions on Database Systems"}
  3010. X
  3011. XMACRO {tog} {"ACM Transactions on Graphics"}
  3012. X
  3013. XMACRO {toms} {"ACM Transactions on Mathematical Software"}
  3014. X
  3015. XMACRO {toois} {"ACM Transactions on Office Information Systems"}
  3016. X
  3017. XMACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
  3018. X
  3019. XMACRO {tcs} {"Theoretical Computer Science"}
  3020. X
  3021. XREAD
  3022. X
  3023. XFUNCTION {sortify}
  3024. X{ purify$
  3025. X  "l" change.case$
  3026. X}
  3027. X
  3028. XINTEGERS { len }
  3029. X
  3030. XFUNCTION {chop.word}
  3031. X{ 's :=
  3032. X  'len :=
  3033. X  s #1 len substring$ =
  3034. X    { s len #1 + global.max$ substring$ }
  3035. X    's
  3036. X  if$
  3037. X}
  3038. X
  3039. X%            There are three apalike cases: one person (Jones),
  3040. X%            two (Jones and de~Bruijn), and more (Jones et~al.).
  3041. X%            This function is much like format.crossref.editors.
  3042. X%
  3043. XFUNCTION {format.lab.names}
  3044. X{ 's :=
  3045. X  s #1 "{vv~}{ll}" format.name$
  3046. X  s num.names$ duplicate$
  3047. X  #2 >
  3048. X    { pop$ " et~al." * }
  3049. X    { #2 <
  3050. X    'skip$
  3051. X    { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
  3052. X        { " et~al." * }
  3053. X        { " and " * s #2 "{vv~}{ll}" format.name$ * }
  3054. X      if$
  3055. X    }
  3056. X      if$
  3057. X    }
  3058. X  if$
  3059. X}
  3060. X
  3061. XFUNCTION {author.key.label}
  3062. X{ author empty$
  3063. X    { key empty$
  3064. X    { cite$ #1 #3 substring$ }
  3065. X    'key                    % apalike uses the whole key
  3066. X      if$
  3067. X    }
  3068. X    { author format.lab.names }
  3069. X  if$
  3070. X}
  3071. X
  3072. XFUNCTION {author.editor.key.label}
  3073. X{ author empty$
  3074. X    { editor empty$
  3075. X    { key empty$
  3076. X        { cite$ #1 #3 substring$ }
  3077. X        'key                % apalike uses the whole key
  3078. X      if$
  3079. X    }
  3080. X    { editor format.lab.names }
  3081. X      if$
  3082. X    }
  3083. X    { author format.lab.names }
  3084. X  if$
  3085. X}
  3086. X
  3087. XFUNCTION {editor.key.label}
  3088. X{ editor empty$
  3089. X    { key empty$
  3090. X    { cite$ #1 #3 substring$ }
  3091. X    'key            % apalike uses the whole key, no organization
  3092. X      if$
  3093. X    }
  3094. X    { editor format.lab.names }
  3095. X  if$
  3096. X}
  3097. X
  3098. XFUNCTION {calc.label}
  3099. X{ type$ "book" =
  3100. X  type$ "inbook" =
  3101. X  or
  3102. X    'author.editor.key.label
  3103. X    { type$ "proceedings" =
  3104. X    'editor.key.label            % apalike ignores organization
  3105. X    'author.key.label            % for labeling and sorting
  3106. X      if$
  3107. X    }
  3108. X  if$
  3109. X  ", "                            % these three lines are
  3110. X  *                            % for apalike, which
  3111. X  year field.or.null purify$ #-1 #4 substring$        % uses all four digits
  3112. X  *
  3113. X  'label :=
  3114. X}
  3115. X
  3116. XFUNCTION {sort.format.names}
  3117. X{ 's :=
  3118. X  #1 'nameptr :=
  3119. X  ""
  3120. X  s num.names$ 'numnames :=
  3121. X  numnames 'namesleft :=
  3122. X    { namesleft #0 > }
  3123. X    { nameptr #1 >
  3124. X    { "   " * }
  3125. X    'skip$
  3126. X      if$                        % apalike uses initials
  3127. X      s nameptr "{vv{ } }{ll{ }}{  f{ }}{  jj{ }}" format.name$ 't := % <= here
  3128. X      nameptr numnames = t "others" = and
  3129. X    { "et al" * }
  3130. X    { t sortify * }
  3131. X      if$
  3132. X      nameptr #1 + 'nameptr :=
  3133. X      namesleft #1 - 'namesleft :=
  3134. X    }
  3135. X  while$
  3136. X}
  3137. X
  3138. XFUNCTION {sort.format.title}
  3139. X{ 't :=
  3140. X  "A " #2
  3141. X    "An " #3
  3142. X      "The " #4 t chop.word
  3143. X    chop.word
  3144. X  chop.word
  3145. X  sortify
  3146. X  #1 global.max$ substring$
  3147. X}
  3148. X
  3149. XFUNCTION {author.sort}
  3150. X{ author empty$
  3151. X    { key empty$
  3152. X    { "to sort, need author or key in " cite$ * warning$
  3153. X      ""
  3154. X    }
  3155. X    { key sortify }
  3156. X      if$
  3157. X    }
  3158. X    { author sort.format.names }
  3159. X  if$
  3160. X}
  3161. X
  3162. XFUNCTION {author.editor.sort}
  3163. X{ author empty$
  3164. X    { editor empty$
  3165. X    { key empty$
  3166. X        { "to sort, need author, editor, or key in " cite$ * warning$
  3167. X          ""
  3168. X        }
  3169. X        { key sortify }
  3170. X      if$
  3171. X    }
  3172. X    { editor sort.format.names }
  3173. X      if$
  3174. X    }
  3175. X    { author sort.format.names }
  3176. X  if$
  3177. X}
  3178. X
  3179. XFUNCTION {editor.sort}
  3180. X{ editor empty$
  3181. X    { key empty$
  3182. X    { "to sort, need editor or key in " cite$ * warning$
  3183. X      ""
  3184. X    }
  3185. X    { key sortify }
  3186. X      if$
  3187. X    }
  3188. X    { editor sort.format.names }
  3189. X  if$
  3190. X}
  3191. X
  3192. X%            apalike uses two sorting passes; the first one sets the
  3193. X%            labels so that the `a's, `b's, etc. can be computed;
  3194. X%            the second pass puts the references in "correct" order.
  3195. X%            The presort function is for the first pass. It computes
  3196. X%            label, sort.label, and title, and then concatenates.
  3197. XFUNCTION {presort}
  3198. X{ calc.label
  3199. X  label sortify
  3200. X  "    "
  3201. X  *
  3202. X  type$ "book" =
  3203. X  type$ "inbook" =
  3204. X  or
  3205. X    'author.editor.sort
  3206. X    { type$ "proceedings" =
  3207. X    'editor.sort
  3208. X    'author.sort
  3209. X      if$
  3210. X    }
  3211. X  if$
  3212. X  #1 entry.max$ substring$    % for
  3213. X  'sort.label :=        % apalike
  3214. X  sort.label            % style
  3215. X  *
  3216. X  "    "
  3217. X  *
  3218. X  title field.or.null
  3219. X  sort.format.title
  3220. X  *
  3221. X  #1 entry.max$ substring$
  3222. X  'sort.key$ :=
  3223. X}
  3224. X
  3225. XITERATE {presort}
  3226. X
  3227. XSORT        % by label, sort.label, title---for final label calculation
  3228. X
  3229. XSTRINGS { last.label next.extra }    % apalike labels are only for the text;
  3230. X
  3231. XINTEGERS { last.extra.num }        % there are none in the bibliography
  3232. X
  3233. XFUNCTION {initialize.extra.label.stuff}    % and hence there is no `longest.label'
  3234. X{ #0 int.to.chr$ 'last.label :=
  3235. X  "" 'next.extra :=
  3236. X  #0 'last.extra.num :=
  3237. X}
  3238. X
  3239. XFUNCTION {forward.pass}
  3240. X{ last.label label =
  3241. X    { last.extra.num #1 + 'last.extra.num :=
  3242. X      last.extra.num int.to.chr$ 'extra.label :=
  3243. X    }
  3244. X    { "a" chr.to.int$ 'last.extra.num :=
  3245. X      "" 'extra.label :=
  3246. X      label 'last.label :=
  3247. X    }
  3248. X  if$
  3249. X}
  3250. X
  3251. XFUNCTION {reverse.pass}
  3252. X{ next.extra "b" =
  3253. X    { "a" 'extra.label := }
  3254. X    'skip$
  3255. X  if$
  3256. X  label extra.label * 'label :=
  3257. X  extra.label 'next.extra :=
  3258. X}
  3259. X
  3260. XEXECUTE {initialize.extra.label.stuff}
  3261. X
  3262. XITERATE {forward.pass}
  3263. X
  3264. XREVERSE {reverse.pass}
  3265. X
  3266. X%                Now that the label is right we sort for real,
  3267. X%                on sort.label then year then title.  This is
  3268. X%                for the second sorting pass.
  3269. XFUNCTION {bib.sort.order}
  3270. X{ sort.label
  3271. X  "    "
  3272. X  *
  3273. X  year field.or.null sortify
  3274. X  *
  3275. X  "    "
  3276. X  *
  3277. X  title field.or.null
  3278. X  sort.format.title
  3279. X  *
  3280. X  #1 entry.max$ substring$
  3281. X  'sort.key$ :=
  3282. X}
  3283. X
  3284. XITERATE {bib.sort.order}
  3285. X
  3286. XSORT        % by sort.label, year, title---giving final bibliography order
  3287. X
  3288. XFUNCTION {begin.bib}
  3289. X{ preamble$ empty$                % no \etalchar in apalike
  3290. X    'skip$
  3291. X    { preamble$ write$ newline$ }
  3292. X  if$
  3293. X  "\begin{thebibliography}{}" write$ newline$        % no labels in apalike
  3294. X}
  3295. X
  3296. XEXECUTE {begin.bib}
  3297. X
  3298. XEXECUTE {init.state.consts}
  3299. X
  3300. XITERATE {call.type$}
  3301. X
  3302. XFUNCTION {end.bib}
  3303. X{ newline$
  3304. X  "\end{thebibliography}" write$ newline$
  3305. X}
  3306. X
  3307. XEXECUTE {end.bib}
  3308. END_OF_FILE
  3309. if test 22921 -ne `wc -c <'apalike.bst'`; then
  3310.     echo shar: \"'apalike.bst'\" unpacked with wrong size!
  3311. fi
  3312. # end of 'apalike.bst'
  3313. fi
  3314. echo shar: End of shell archive.
  3315. exit 0
  3316.  
  3317. exit 0 # Just in case...
  3318.