home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume37 / annote / part01 < prev    next >
Encoding:
Text File  |  1993-05-15  |  59.4 KB  |  2,738 lines

  1. Newsgroups: comp.sources.misc
  2. From: arrouye@cosmos.imag.fr (Yves Arrouye)
  3. Subject: v37i057:  annote - BibTeX styles supporting annotations, Part01/03
  4. Message-ID: <csm-v37i057=annote.201417@sparky.IMD.Sterling.COM>
  5. X-Md4-Signature: c9bc19ed26c0436641cf854b5736b44b
  6. Date: Sun, 16 May 1993 01:14:33 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: arrouye@cosmos.imag.fr (Yves Arrouye)
  10. Posting-number: Volume 37, Issue 57
  11. Archive-name: annote/part01
  12. Environment: LaTex
  13.  
  14. Announcing the `annote' package for BibTeX styles supporting annotations.
  15.  
  16. The package is intended to facilitate the use of annotated bibliographies
  17. by enabling one to modify ``normal'' BibTeX styles in order to support
  18. an `annote' field (like is available in Bibcard). The advantages of
  19. this package over existing annotated bibliographies are twofold: users can
  20. easily customize the annotation layout, and existing BibTeX styles can
  21. be automatically modified in order to support the `annote' package.
  22.  
  23. Styles for BibTeX may be developped using the conventions of this
  24. package, or existing style files may be converted to these
  25. conventions. Automatic conversion of the files is available through
  26. two interactive Emacs functions.
  27.   
  28. The `annotated' BibTeX styles support listing the bibliographies in
  29. annotated or non-annotated forms without any further modifications;
  30. instead, the user can include a style file defining his preferred
  31. layout of annotations and use it on her bibliography. This layout is
  32. easily modified by using a simple LaTeX \renewcommand.
  33.  
  34. This release contains the `annote' package and some example BibTeX
  35. styles, including the ones bundled with the LaTeX distribution (i.e.
  36. `plain.bst', `alpha.bst', `unsrt.bst' and `abbrv.bst'); these BibTeX
  37. styles were all modified to support `annote', some by hand when
  38. annotebib.el wasn't wrote, the other with annotebib.el.
  39.  
  40. Simple documentation is in the `annote.README' file.
  41.  
  42. Yves Arrouye <arrouye@imag.imag.fr>
  43. May, 1993
  44. -------------------------------------------------------------------
  45. #! /bin/sh
  46. # This is a shell archive.  Remove anything before this line, then feed it
  47. # into a shell via "sh file" or similar.  To overwrite existing files,
  48. # type "sh file -c".
  49. # Contents:  README alpha.bst annotebib.el plain.bst
  50. # Wrapped by kent@sparky on Sat May 15 20:06:12 1993
  51. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
  52. echo If this archive is complete, you will see the following message:
  53. echo '          "shar: End of archive 1 (of 3)."'
  54. if test -f 'README' -a "${1}" != "-c" ; then 
  55.   echo shar: Will not clobber existing file \"'README'\"
  56. else
  57.   echo shar: Extracting \"'README'\" \(1868 characters\)
  58.   sed "s/^X//" >'README' <<'END_OF_FILE'
  59. XThis is the ``annote'' package, which provides a simple and convenient
  60. Xway to add support for annotated bibliographies to LaTeX.
  61. X
  62. XThis package provides you with:
  63. X
  64. X  1. A generic way to add annotation capacities to your BibTeX styles.
  65. X
  66. X  2. An automated way of modifying your existing files.
  67. X
  68. X  3. A style of annotations which can be redefined by the user.
  69. X
  70. X
  71. XTo make the package work, one has to make the following steps:
  72. X
  73. X  1. Change the .bst files to add support for annotation. This is done
  74. X     by adding the annote field in the ENTRY list, adding the
  75. X     format.annote function to the style file, and changing the
  76. X     fin.entry (or the corresponding entry-closing function) by adding
  77. X     a call to format.annote at the end of the function, followed by a
  78. X     write$ call.
  79. X       See the "annotebib.add" file for the source of the modifications.
  80. X
  81. X     * This step can be automated on most bibliography styles with the
  82. X     use of the `annotebib.el' functions. It is the preferred (and
  83. X     painless) way to make such modifications.
  84. X
  85. X  2. Install "annote.sty" in one of your LaTeX directories (one which
  86. X     is listed in the TEXINPUTS environment variable).
  87. X
  88. X  3. Use it! Just add annote to your \documentstyle options when you
  89. X     need it, or define the annote environment in your document, or
  90. X     make that definition (the one you prefer, of course) a new .sty
  91. X     file...
  92. X
  93. X       For example, to have annotations printed as quotations in
  94. X     emphasized typeface, just say
  95. X
  96. X      \newenvironment{annote}{\begin{quotation}\em}{\end{quotation}}
  97. X
  98. X     in your document, before the \bibliography statement.
  99. X
  100. X  NOTE. The modifications here use the "annote" field of the .bib
  101. X        file, which can be easily edited with BibCard (menu "View",
  102. X        item "Annotation..."), but one can easily change that field.
  103. X
  104. X
  105. XYves Arrouye (arrouye@imag.imag.fr)
  106. XMay 12, 1993
  107. X
  108. END_OF_FILE
  109.   if test 1868 -ne `wc -c <'README'`; then
  110.     echo shar: \"'README'\" unpacked with wrong size!
  111.   fi
  112.   # end of 'README'
  113. fi
  114. if test -f 'alpha.bst' -a "${1}" != "-c" ; then 
  115.   echo shar: Will not clobber existing file \"'alpha.bst'\"
  116. else
  117.   echo shar: Extracting \"'alpha.bst'\" \(24397 characters\)
  118.   sed "s/^X//" >'alpha.bst' <<'END_OF_FILE'
  119. X% Style file modified on Wed May 12 20:53:22 1993
  120. X%                     by Yves.Arrouye <arrouye@cosmos>
  121. X
  122. X% This bibliography style was made annote-compatible by annotebib.el v1.0
  123. X% It can be used for both annotated and non-annotated bibliographies listing
  124. X% (annote package by Yves Arrouye <arrouye@imag.imag.fr>)
  125. X
  126. X% BibTeX standard bibliography style `alpha'
  127. X        % version 0.99a for BibTeX versions 0.99a or later, LaTeX version 2.09.
  128. X        % Copyright (C) 1985, all rights reserved.
  129. X        % Copying of this file is authorized only if either
  130. X        % (1) you make absolutely no changes to your copy, including name, or
  131. X        % (2) if you do make changes, you name it something other than
  132. X        % btxbst.doc, plain.bst, unsrt.bst, alpha.bst, and abbrv.bst.
  133. X        % This restriction helps ensure that all standard styles are identical.
  134. X        % The file btxbst.doc has the documentation for this style.
  135. X
  136. XENTRY
  137. X  { annote
  138. X    address
  139. X    author
  140. X    booktitle
  141. X    chapter
  142. X    edition
  143. X    editor
  144. X    howpublished
  145. X    institution
  146. X    journal
  147. X    key
  148. X    month
  149. X    note
  150. X    number
  151. X    organization
  152. X    pages
  153. X    publisher
  154. X    school
  155. X    series
  156. X    title
  157. X    type
  158. X    volume
  159. X    year
  160. X  }
  161. X  {}
  162. X  { label extra.label sort.label }
  163. X
  164. XINTEGERS { output.state before.all mid.sentence after.sentence after.block }
  165. X
  166. XFUNCTION {init.state.consts}
  167. X{ #0 'before.all :=
  168. X  #1 'mid.sentence :=
  169. X  #2 'after.sentence :=
  170. X  #3 'after.block :=
  171. X}
  172. X
  173. XSTRINGS { s t }
  174. X
  175. XFUNCTION {output.nonnull}
  176. X{ 's :=
  177. X  output.state mid.sentence =
  178. X    { ", " * write$ }
  179. X    { output.state after.block =
  180. X        { add.period$ write$
  181. X          newline$
  182. X          "\newblock " write$
  183. X        }
  184. X        { output.state before.all =
  185. X            'write$
  186. X            { add.period$ " " * write$ }
  187. X          if$
  188. X        }
  189. X      if$
  190. X      mid.sentence 'output.state :=
  191. X    }
  192. X  if$
  193. X  s
  194. X}
  195. X
  196. XFUNCTION {output}
  197. X{ duplicate$ empty$
  198. X    'pop$
  199. X    'output.nonnull
  200. X  if$
  201. X}
  202. X
  203. XFUNCTION {output.check}
  204. X{ 't :=
  205. X  duplicate$ empty$
  206. X    { pop$ "empty " t * " in " * cite$ * warning$ }
  207. X    'output.nonnull
  208. X  if$
  209. X}
  210. X
  211. XFUNCTION {output.bibitem}
  212. X{ newline$
  213. X  "\bibitem[" write$
  214. X  label write$
  215. X  "]{" write$
  216. X  cite$ write$
  217. X  "}" write$
  218. X  newline$
  219. X  ""
  220. X  before.all 'output.state :=
  221. X}
  222. X
  223. XFUNCTION {format.annote}
  224. X{ annote empty$
  225. X        { "" }
  226. X        { "\ifx\annote\undefined\else\begin{annote} "
  227. X          annote
  228. X          * " \end{annote}\fi " *
  229. X        }
  230. X      if$
  231. X}
  232. X
  233. XFUNCTION {fin.entry}
  234. X{ add.period$
  235. X  write$
  236. X  newline$
  237. X  format.annote write$
  238. X}
  239. X
  240. XFUNCTION {new.block}
  241. X{ output.state before.all =
  242. X    'skip$
  243. X    { after.block 'output.state := }
  244. X  if$
  245. X}
  246. X
  247. XFUNCTION {new.sentence}
  248. X{ output.state after.block =
  249. X    'skip$
  250. X    { output.state before.all =
  251. X        'skip$
  252. X        { after.sentence 'output.state := }
  253. X      if$
  254. X    }
  255. X  if$
  256. X}
  257. X
  258. XFUNCTION {not}
  259. X{   { #0 }
  260. X    { #1 }
  261. X  if$
  262. X}
  263. X
  264. XFUNCTION {and}
  265. X{   'skip$
  266. X    { pop$ #0 }
  267. X  if$
  268. X}
  269. X
  270. XFUNCTION {or}
  271. X{   { pop$ #1 }
  272. X    'skip$
  273. X  if$
  274. X}
  275. X
  276. XFUNCTION {new.block.checka}
  277. X{ empty$
  278. X    'skip$
  279. X    'new.block
  280. X  if$
  281. X}
  282. X
  283. XFUNCTION {new.block.checkb}
  284. X{ empty$
  285. X  swap$ empty$
  286. X  and
  287. X    'skip$
  288. X    'new.block
  289. X  if$
  290. X}
  291. X
  292. XFUNCTION {new.sentence.checka}
  293. X{ empty$
  294. X    'skip$
  295. X    'new.sentence
  296. X  if$
  297. X}
  298. X
  299. XFUNCTION {new.sentence.checkb}
  300. X{ empty$
  301. X  swap$ empty$
  302. X  and
  303. X    'skip$
  304. X    'new.sentence
  305. X  if$
  306. X}
  307. X
  308. XFUNCTION {field.or.null}
  309. X{ duplicate$ empty$
  310. X    { pop$ "" }
  311. X    'skip$
  312. X  if$
  313. X}
  314. X
  315. XFUNCTION {emphasize}
  316. X{ duplicate$ empty$
  317. X    { pop$ "" }
  318. X    { "{\em " swap$ * "}" * }
  319. X  if$
  320. X}
  321. X
  322. XINTEGERS { nameptr namesleft numnames }
  323. X
  324. XFUNCTION {format.names}
  325. X{ 's :=
  326. X  #1 'nameptr :=
  327. X  s num.names$ 'numnames :=
  328. X  numnames 'namesleft :=
  329. X    { namesleft #0 > }
  330. X    { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
  331. X      nameptr #1 >
  332. X        { namesleft #1 >
  333. X            { ", " * t * }
  334. X            { numnames #2 >
  335. X                { "," * }
  336. X                'skip$
  337. X              if$
  338. X              t "others" =
  339. X                { " et~al." * }
  340. X                { " and " * t * }
  341. X              if$
  342. X            }
  343. X          if$
  344. X        }
  345. X        't
  346. X      if$
  347. X      nameptr #1 + 'nameptr :=
  348. X      namesleft #1 - 'namesleft :=
  349. X    }
  350. X  while$
  351. X}
  352. X
  353. XFUNCTION {format.authors}
  354. X{ author empty$
  355. X    { "" }
  356. X    { author format.names }
  357. X  if$
  358. X}
  359. X
  360. XFUNCTION {format.editors}
  361. X{ editor empty$
  362. X    { "" }
  363. X    { editor format.names
  364. X      editor num.names$ #1 >
  365. X        { ", editors" * }
  366. X        { ", editor" * }
  367. X      if$
  368. X    }
  369. X  if$
  370. X}
  371. X
  372. XFUNCTION {format.title}
  373. X{ title empty$
  374. X    { "" }
  375. X    { title "t" change.case$ }
  376. X  if$
  377. X}
  378. X
  379. XFUNCTION {n.dashify}
  380. X{ 't :=
  381. X  ""
  382. X    { t empty$ not }
  383. X    { t #1 #1 substring$ "-" =
  384. X        { t #1 #2 substring$ "--" = not
  385. X            { "--" *
  386. X              t #2 global.max$ substring$ 't :=
  387. X            }
  388. X            {   { t #1 #1 substring$ "-" = }
  389. X                { "-" *
  390. X                  t #2 global.max$ substring$ 't :=
  391. X                }
  392. X              while$
  393. X            }
  394. X          if$
  395. X        }
  396. X        { t #1 #1 substring$ *
  397. X          t #2 global.max$ substring$ 't :=
  398. X        }
  399. X      if$
  400. X    }
  401. X  while$
  402. X}
  403. X
  404. XFUNCTION {format.date}
  405. X{ year empty$
  406. X    { month empty$
  407. X        { "" }
  408. X        { "there's a month but no year in " cite$ * warning$
  409. X          month
  410. X        }
  411. X      if$
  412. X    }
  413. X    { month empty$
  414. X        'year
  415. X        { month " " * year * }
  416. X      if$
  417. X    }
  418. X  if$
  419. X}
  420. X
  421. XFUNCTION {format.btitle}
  422. X{ title emphasize
  423. X}
  424. X
  425. XFUNCTION {tie.or.space.connect}
  426. X{ duplicate$ text.length$ #3 <
  427. X    { "~" }
  428. X    { " " }
  429. X  if$
  430. X  swap$ * *
  431. X}
  432. X
  433. XFUNCTION {either.or.check}
  434. X{ empty$
  435. X    'pop$
  436. X    { "can't use both " swap$ * " fields in " * cite$ * warning$ }
  437. X  if$
  438. X}
  439. X
  440. XFUNCTION {format.bvolume}
  441. X{ volume empty$
  442. X    { "" }
  443. X    { "volume" volume tie.or.space.connect
  444. X      series empty$
  445. X        'skip$
  446. X        { " of " * series emphasize * }
  447. X      if$
  448. X      "volume and number" number either.or.check
  449. X    }
  450. X  if$
  451. X}
  452. X
  453. XFUNCTION {format.number.series}
  454. X{ volume empty$
  455. X    { number empty$
  456. X        { series field.or.null }
  457. X        { output.state mid.sentence =
  458. X            { "number" }
  459. X            { "Number" }
  460. X          if$
  461. X          number tie.or.space.connect
  462. X          series empty$
  463. X            { "there's a number but no series in " cite$ * warning$ }
  464. X            { " in " * series * }
  465. X          if$
  466. X        }
  467. X      if$
  468. X    }
  469. X    { "" }
  470. X  if$
  471. X}
  472. X
  473. XFUNCTION {format.edition}
  474. X{ edition empty$
  475. X    { "" }
  476. X    { output.state mid.sentence =
  477. X        { edition "l" change.case$ " edition" * }
  478. X        { edition "t" change.case$ " edition" * }
  479. X      if$
  480. X    }
  481. X  if$
  482. X}
  483. X
  484. XINTEGERS { multiresult }
  485. X
  486. XFUNCTION {multi.page.check}
  487. X{ 't :=
  488. X  #0 'multiresult :=
  489. X    { multiresult not
  490. X      t empty$ not
  491. X      and
  492. X    }
  493. X    { t #1 #1 substring$
  494. X      duplicate$ "-" =
  495. X      swap$ duplicate$ "," =
  496. X      swap$ "+" =
  497. X      or or
  498. X        { #1 'multiresult := }
  499. X        { t #2 global.max$ substring$ 't := }
  500. X      if$
  501. X    }
  502. X  while$
  503. X  multiresult
  504. X}
  505. X
  506. XFUNCTION {format.pages}
  507. X{ pages empty$
  508. X    { "" }
  509. X    { pages multi.page.check
  510. X        { "pages" pages n.dashify tie.or.space.connect }
  511. X        { "page" pages tie.or.space.connect }
  512. X      if$
  513. X    }
  514. X  if$
  515. X}
  516. X
  517. XFUNCTION {format.vol.num.pages}
  518. X{ volume field.or.null
  519. X  number empty$
  520. X    'skip$
  521. X    { "(" number * ")" * *
  522. X      volume empty$
  523. X        { "there's a number but no volume in " cite$ * warning$ }
  524. X        'skip$
  525. X      if$
  526. X    }
  527. X  if$
  528. X  pages empty$
  529. X    'skip$
  530. X    { duplicate$ empty$
  531. X        { pop$ format.pages }
  532. X        { ":" * pages n.dashify * }
  533. X      if$
  534. X    }
  535. X  if$
  536. X}
  537. X
  538. XFUNCTION {format.chapter.pages}
  539. X{ chapter empty$
  540. X    'format.pages
  541. X    { type empty$
  542. X        { "chapter" }
  543. X        { type "l" change.case$ }
  544. X      if$
  545. X      chapter tie.or.space.connect
  546. X      pages empty$
  547. X        'skip$
  548. X        { ", " * format.pages * }
  549. X      if$
  550. X    }
  551. X  if$
  552. X}
  553. X
  554. XFUNCTION {format.in.ed.booktitle}
  555. X{ booktitle empty$
  556. X    { "" }
  557. X    { editor empty$
  558. X        { "In " booktitle emphasize * }
  559. X        { "In " format.editors * ", " * booktitle emphasize * }
  560. X      if$
  561. X    }
  562. X  if$
  563. X}
  564. X
  565. XFUNCTION {empty.misc.check}
  566. X{ author empty$ title empty$ howpublished empty$
  567. X  month empty$ year empty$ note empty$
  568. X  and and and and and
  569. X  key empty$ not and
  570. X    { "all relevant fields are empty in " cite$ * warning$ }
  571. X    'skip$
  572. X  if$
  573. X}
  574. X
  575. XFUNCTION {format.thesis.type}
  576. X{ type empty$
  577. X    'skip$
  578. X    { pop$
  579. X      type "t" change.case$
  580. X    }
  581. X  if$
  582. X}
  583. X
  584. XFUNCTION {format.tr.number}
  585. X{ type empty$
  586. X    { "Technical Report" }
  587. X    'type
  588. X  if$
  589. X  number empty$
  590. X    { "t" change.case$ }
  591. X    { number tie.or.space.connect }
  592. X  if$
  593. X}
  594. X
  595. XFUNCTION {format.article.crossref}
  596. X{ key empty$
  597. X    { journal empty$
  598. X        { "need key or journal for " cite$ * " to crossref " * crossref *
  599. X          warning$
  600. X          ""
  601. X        }
  602. X        { "In {\em " journal * "\/}" * }
  603. X      if$
  604. X    }
  605. X    { "In " key * }
  606. X  if$
  607. X  " \cite{" * crossref * "}" *
  608. X}
  609. X
  610. XFUNCTION {format.crossref.editor}
  611. X{ editor #1 "{vv~}{ll}" format.name$
  612. X  editor num.names$ duplicate$
  613. X  #2 >
  614. X    { pop$ " et~al." * }
  615. X    { #2 <
  616. X        'skip$
  617. X        { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
  618. X            { " et~al." * }
  619. X            { " and " * editor #2 "{vv~}{ll}" format.name$ * }
  620. X          if$
  621. X        }
  622. X      if$
  623. X    }
  624. X  if$
  625. X}
  626. X
  627. XFUNCTION {format.book.crossref}
  628. X{ volume empty$
  629. X    { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
  630. X      "In "
  631. X    }
  632. X    { "Volume" volume tie.or.space.connect
  633. X      " of " *
  634. X    }
  635. X  if$
  636. X  editor empty$
  637. X  editor field.or.null author field.or.null =
  638. X  or
  639. X    { key empty$
  640. X        { series empty$
  641. X            { "need editor, key, or series for " cite$ * " to crossref " *
  642. X              crossref * warning$
  643. X              "" *
  644. X            }
  645. X            { "{\em " * series * "\/}" * }
  646. X          if$
  647. X        }
  648. X        { key * }
  649. X      if$
  650. X    }
  651. X    { format.crossref.editor * }
  652. X  if$
  653. X  " \cite{" * crossref * "}" *
  654. X}
  655. X
  656. XFUNCTION {format.incoll.inproc.crossref}
  657. X{ editor empty$
  658. X  editor field.or.null author field.or.null =
  659. X  or
  660. X    { key empty$
  661. X        { booktitle empty$
  662. X            { "need editor, key, or booktitle for " cite$ * " to crossref " *
  663. X              crossref * warning$
  664. X              ""
  665. X            }
  666. X            { "In {\em " booktitle * "\/}" * }
  667. X          if$
  668. X        }
  669. X        { "In " key * }
  670. X      if$
  671. X    }
  672. X    { "In " format.crossref.editor * }
  673. X  if$
  674. X  " \cite{" * crossref * "}" *
  675. X}
  676. X
  677. XFUNCTION {article}
  678. X{ output.bibitem
  679. X  format.authors "author" output.check
  680. X  new.block
  681. X  format.title "title" output.check
  682. X  new.block
  683. X  crossref missing$
  684. X    { journal emphasize "journal" output.check
  685. X      format.vol.num.pages output
  686. X      format.date "year" output.check
  687. X    }
  688. X    { format.article.crossref output.nonnull
  689. X      format.pages output
  690. X    }
  691. X  if$
  692. X  new.block
  693. X  note output
  694. X  fin.entry
  695. X}
  696. X
  697. XFUNCTION {book}
  698. X{ output.bibitem
  699. X  author empty$
  700. X    { format.editors "author and editor" output.check }
  701. X    { format.authors output.nonnull
  702. X      crossref missing$
  703. X        { "author and editor" editor either.or.check }
  704. X        'skip$
  705. X      if$
  706. X    }
  707. X  if$
  708. X  new.block
  709. X  format.btitle "title" output.check
  710. X  crossref missing$
  711. X    { format.bvolume output
  712. X      new.block
  713. X      format.number.series output
  714. X      new.sentence
  715. X      publisher "publisher" output.check
  716. X      address output
  717. X    }
  718. X    { new.block
  719. X      format.book.crossref output.nonnull
  720. X    }
  721. X  if$
  722. X  format.edition output
  723. X  format.date "year" output.check
  724. X  new.block
  725. X  note output
  726. X  fin.entry
  727. X}
  728. X
  729. XFUNCTION {booklet}
  730. X{ output.bibitem
  731. X  format.authors output
  732. X  new.block
  733. X  format.title "title" output.check
  734. X  howpublished address new.block.checkb
  735. X  howpublished output
  736. X  address output
  737. X  format.date output
  738. X  new.block
  739. X  note output
  740. X  fin.entry
  741. X}
  742. X
  743. XFUNCTION {inbook}
  744. X{ output.bibitem
  745. X  author empty$
  746. X    { format.editors "author and editor" output.check }
  747. X    { format.authors output.nonnull
  748. X      crossref missing$
  749. X        { "author and editor" editor either.or.check }
  750. X        'skip$
  751. X      if$
  752. X    }
  753. X  if$
  754. X  new.block
  755. X  format.btitle "title" output.check
  756. X  crossref missing$
  757. X    { format.bvolume output
  758. X      format.chapter.pages "chapter and pages" output.check
  759. X      new.block
  760. X      format.number.series output
  761. X      new.sentence
  762. X      publisher "publisher" output.check
  763. X      address output
  764. X    }
  765. X    { format.chapter.pages "chapter and pages" output.check
  766. X      new.block
  767. X      format.book.crossref output.nonnull
  768. X    }
  769. X  if$
  770. X  format.edition output
  771. X  format.date "year" output.check
  772. X  new.block
  773. X  note output
  774. X  fin.entry
  775. X}
  776. X
  777. XFUNCTION {incollection}
  778. X{ output.bibitem
  779. X  format.authors "author" output.check
  780. X  new.block
  781. X  format.title "title" output.check
  782. X  new.block
  783. X  crossref missing$
  784. X    { format.in.ed.booktitle "booktitle" output.check
  785. X      format.bvolume output
  786. X      format.number.series output
  787. X      format.chapter.pages output
  788. X      new.sentence
  789. X      publisher "publisher" output.check
  790. X      address output
  791. X      format.edition output
  792. X      format.date "year" output.check
  793. X    }
  794. X    { format.incoll.inproc.crossref output.nonnull
  795. X      format.chapter.pages output
  796. X    }
  797. X  if$
  798. X  new.block
  799. X  note output
  800. X  fin.entry
  801. X}
  802. X
  803. XFUNCTION {inproceedings}
  804. X{ output.bibitem
  805. X  format.authors "author" output.check
  806. X  new.block
  807. X  format.title "title" output.check
  808. X  new.block
  809. X  crossref missing$
  810. X    { format.in.ed.booktitle "booktitle" output.check
  811. X      format.bvolume output
  812. X      format.number.series output
  813. X      format.pages output
  814. X      address empty$
  815. X        { organization publisher new.sentence.checkb
  816. X          organization output
  817. X          publisher output
  818. X          format.date "year" output.check
  819. X        }
  820. X        { address output.nonnull
  821. X          format.date "year" output.check
  822. X          new.sentence
  823. X          organization output
  824. X          publisher output
  825. X        }
  826. X      if$
  827. X    }
  828. X    { format.incoll.inproc.crossref output.nonnull
  829. X      format.pages output
  830. X    }
  831. X  if$
  832. X  new.block
  833. X  note output
  834. X  fin.entry
  835. X}
  836. X
  837. XFUNCTION {conference} { inproceedings }
  838. X
  839. XFUNCTION {manual}
  840. X{ output.bibitem
  841. X  author empty$
  842. X    { organization empty$
  843. X        'skip$
  844. X        { organization output.nonnull
  845. X          address output
  846. X        }
  847. X      if$
  848. X    }
  849. X    { format.authors output.nonnull }
  850. X  if$
  851. X  new.block
  852. X  format.btitle "title" output.check
  853. X  author empty$
  854. X    { organization empty$
  855. X        { address new.block.checka
  856. X          address output
  857. X        }
  858. X        'skip$
  859. X      if$
  860. X    }
  861. X    { organization address new.block.checkb
  862. X      organization output
  863. X      address output
  864. X    }
  865. X  if$
  866. X  format.edition output
  867. X  format.date output
  868. X  new.block
  869. X  note output
  870. X  fin.entry
  871. X}
  872. X
  873. XFUNCTION {mastersthesis}
  874. X{ output.bibitem
  875. X  format.authors "author" output.check
  876. X  new.block
  877. X  format.title "title" output.check
  878. X  new.block
  879. X  "Master's thesis" format.thesis.type output.nonnull
  880. X  school "school" output.check
  881. X  address output
  882. X  format.date "year" output.check
  883. X  new.block
  884. X  note output
  885. X  fin.entry
  886. X}
  887. X
  888. XFUNCTION {misc}
  889. X{ output.bibitem
  890. X  format.authors output
  891. X  title howpublished new.block.checkb
  892. X  format.title output
  893. X  howpublished new.block.checka
  894. X  howpublished output
  895. X  format.date output
  896. X  new.block
  897. X  note output
  898. X  fin.entry
  899. X  empty.misc.check
  900. X}
  901. X
  902. XFUNCTION {phdthesis}
  903. X{ output.bibitem
  904. X  format.authors "author" output.check
  905. X  new.block
  906. X  format.btitle "title" output.check
  907. X  new.block
  908. X  "PhD thesis" format.thesis.type output.nonnull
  909. X  school "school" output.check
  910. X  address output
  911. X  format.date "year" output.check
  912. X  new.block
  913. X  note output
  914. X  fin.entry
  915. X}
  916. X
  917. XFUNCTION {proceedings}
  918. X{ output.bibitem
  919. X  editor empty$
  920. X    { organization output }
  921. X    { format.editors output.nonnull }
  922. X  if$
  923. X  new.block
  924. X  format.btitle "title" output.check
  925. X  format.bvolume output
  926. X  format.number.series output
  927. X  address empty$
  928. X    { editor empty$
  929. X        { publisher new.sentence.checka }
  930. X        { organization publisher new.sentence.checkb
  931. X          organization output
  932. X        }
  933. X      if$
  934. X      publisher output
  935. X      format.date "year" output.check
  936. X    }
  937. X    { address output.nonnull
  938. X      format.date "year" output.check
  939. X      new.sentence
  940. X      editor empty$
  941. X        'skip$
  942. X        { organization output }
  943. X      if$
  944. X      publisher output
  945. X    }
  946. X  if$
  947. X  new.block
  948. X  note output
  949. X  fin.entry
  950. X}
  951. X
  952. XFUNCTION {techreport}
  953. X{ output.bibitem
  954. X  format.authors "author" output.check
  955. X  new.block
  956. X  format.title "title" output.check
  957. X  new.block
  958. X  format.tr.number output.nonnull
  959. X  institution "institution" output.check
  960. X  address output
  961. X  format.date "year" output.check
  962. X  new.block
  963. X  note output
  964. X  fin.entry
  965. X}
  966. X
  967. XFUNCTION {unpublished}
  968. X{ output.bibitem
  969. X  format.authors "author" output.check
  970. X  new.block
  971. X  format.title "title" output.check
  972. X  new.block
  973. X  note "note" output.check
  974. X  format.date output
  975. X  fin.entry
  976. X}
  977. X
  978. XFUNCTION {default.type} { misc }
  979. X
  980. XMACRO {jan} {"January"}
  981. X
  982. XMACRO {feb} {"February"}
  983. X
  984. XMACRO {mar} {"March"}
  985. X
  986. XMACRO {apr} {"April"}
  987. X
  988. XMACRO {may} {"May"}
  989. X
  990. XMACRO {jun} {"June"}
  991. X
  992. XMACRO {jul} {"July"}
  993. X
  994. XMACRO {aug} {"August"}
  995. X
  996. XMACRO {sep} {"September"}
  997. X
  998. XMACRO {oct} {"October"}
  999. X
  1000. XMACRO {nov} {"November"}
  1001. X
  1002. XMACRO {dec} {"December"}
  1003. X
  1004. XMACRO {acmcs} {"ACM Computing Surveys"}
  1005. X
  1006. XMACRO {acta} {"Acta Informatica"}
  1007. X
  1008. XMACRO {cacm} {"Communications of the ACM"}
  1009. X
  1010. XMACRO {ibmjrd} {"IBM Journal of Research and Development"}
  1011. X
  1012. XMACRO {ibmsj} {"IBM Systems Journal"}
  1013. X
  1014. XMACRO {ieeese} {"IEEE Transactions on Software Engineering"}
  1015. X
  1016. XMACRO {ieeetc} {"IEEE Transactions on Computers"}
  1017. X
  1018. XMACRO {ieeetcad}
  1019. X {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
  1020. X
  1021. XMACRO {ipl} {"Information Processing Letters"}
  1022. X
  1023. XMACRO {jacm} {"Journal of the ACM"}
  1024. X
  1025. XMACRO {jcss} {"Journal of Computer and System Sciences"}
  1026. X
  1027. XMACRO {scp} {"Science of Computer Programming"}
  1028. X
  1029. XMACRO {sicomp} {"SIAM Journal on Computing"}
  1030. X
  1031. XMACRO {tocs} {"ACM Transactions on Computer Systems"}
  1032. X
  1033. XMACRO {tods} {"ACM Transactions on Database Systems"}
  1034. X
  1035. XMACRO {tog} {"ACM Transactions on Graphics"}
  1036. X
  1037. XMACRO {toms} {"ACM Transactions on Mathematical Software"}
  1038. X
  1039. XMACRO {toois} {"ACM Transactions on Office Information Systems"}
  1040. X
  1041. XMACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
  1042. X
  1043. XMACRO {tcs} {"Theoretical Computer Science"}
  1044. X
  1045. XREAD
  1046. X
  1047. XFUNCTION {sortify}
  1048. X{ purify$
  1049. X  "l" change.case$
  1050. X}
  1051. X
  1052. XINTEGERS { len }
  1053. X
  1054. XFUNCTION {chop.word}
  1055. X{ 's :=
  1056. X  'len :=
  1057. X  s #1 len substring$ =
  1058. X    { s len #1 + global.max$ substring$ }
  1059. X    's
  1060. X  if$
  1061. X}
  1062. X
  1063. XINTEGERS { et.al.char.used }
  1064. X
  1065. XFUNCTION {initialize.et.al.char.used}
  1066. X{ #0 'et.al.char.used :=
  1067. X}
  1068. X
  1069. XEXECUTE {initialize.et.al.char.used}
  1070. X
  1071. XFUNCTION {format.lab.names}
  1072. X{ 's :=
  1073. X  s num.names$ 'numnames :=
  1074. X  numnames #1 >
  1075. X    { numnames #4 >
  1076. X        { #3 'namesleft := }
  1077. X        { numnames 'namesleft := }
  1078. X      if$
  1079. X      #1 'nameptr :=
  1080. X      ""
  1081. X        { namesleft #0 > }
  1082. X        { nameptr numnames =
  1083. X            { s nameptr "{ff }{vv }{ll}{ jj}" format.name$ "others" =
  1084. X                { "{\etalchar{+}}" *
  1085. X                  #1 'et.al.char.used :=
  1086. X                }
  1087. X                { s nameptr "{v{}}{l{}}" format.name$ * }
  1088. X              if$
  1089. X            }
  1090. X            { s nameptr "{v{}}{l{}}" format.name$ * }
  1091. X          if$
  1092. X          nameptr #1 + 'nameptr :=
  1093. X          namesleft #1 - 'namesleft :=
  1094. X        }
  1095. X      while$
  1096. X      numnames #4 >
  1097. X        { "{\etalchar{+}}" *
  1098. X          #1 'et.al.char.used :=
  1099. X        }
  1100. X        'skip$
  1101. X      if$
  1102. X    }
  1103. X    { s #1 "{v{}}{l{}}" format.name$
  1104. X      duplicate$ text.length$ #2 <
  1105. X        { pop$ s #1 "{ll}" format.name$ #3 text.prefix$ }
  1106. X        'skip$
  1107. X      if$
  1108. X    }
  1109. X  if$
  1110. X}
  1111. X
  1112. XFUNCTION {author.key.label}
  1113. X{ author empty$
  1114. X    { key empty$
  1115. X        { cite$ #1 #3 substring$ }
  1116. X        { key #3 text.prefix$ }
  1117. X      if$
  1118. X    }
  1119. X    { author format.lab.names }
  1120. X  if$
  1121. X}
  1122. X
  1123. XFUNCTION {author.editor.key.label}
  1124. X{ author empty$
  1125. X    { editor empty$
  1126. X        { key empty$
  1127. X            { cite$ #1 #3 substring$ }
  1128. X            { key #3 text.prefix$ }
  1129. X          if$
  1130. X        }
  1131. X        { editor format.lab.names }
  1132. X      if$
  1133. X    }
  1134. X    { author format.lab.names }
  1135. X  if$
  1136. X}
  1137. X
  1138. XFUNCTION {author.key.organization.label}
  1139. X{ author empty$
  1140. X    { key empty$
  1141. X        { organization empty$
  1142. X            { cite$ #1 #3 substring$ }
  1143. X            { "The " #4 organization chop.word #3 text.prefix$ }
  1144. X          if$
  1145. X        }
  1146. X        { key #3 text.prefix$ }
  1147. X      if$
  1148. X    }
  1149. X    { author format.lab.names }
  1150. X  if$
  1151. X}
  1152. X
  1153. XFUNCTION {editor.key.organization.label}
  1154. X{ editor empty$
  1155. X    { key empty$
  1156. X        { organization empty$
  1157. X            { cite$ #1 #3 substring$ }
  1158. X            { "The " #4 organization chop.word #3 text.prefix$ }
  1159. X          if$
  1160. X        }
  1161. X        { key #3 text.prefix$ }
  1162. X      if$
  1163. X    }
  1164. X    { editor format.lab.names }
  1165. X  if$
  1166. X}
  1167. X
  1168. XFUNCTION {calc.label}
  1169. X{ type$ "book" =
  1170. X  type$ "inbook" =
  1171. X  or
  1172. X    'author.editor.key.label
  1173. X    { type$ "proceedings" =
  1174. X        'editor.key.organization.label
  1175. X        { type$ "manual" =
  1176. X            'author.key.organization.label
  1177. X            'author.key.label
  1178. X          if$
  1179. X        }
  1180. X      if$
  1181. X    }
  1182. X  if$
  1183. X  duplicate$
  1184. X  year field.or.null purify$ #-1 #2 substring$
  1185. X  *
  1186. X  'label :=
  1187. X  year field.or.null purify$ #-1 #4 substring$
  1188. X  *
  1189. X  sortify 'sort.label :=
  1190. X}
  1191. X
  1192. XFUNCTION {sort.format.names}
  1193. X{ 's :=
  1194. X  #1 'nameptr :=
  1195. X  ""
  1196. X  s num.names$ 'numnames :=
  1197. X  numnames 'namesleft :=
  1198. X    { namesleft #0 > }
  1199. X    { nameptr #1 >
  1200. X        { "   " * }
  1201. X        'skip$
  1202. X      if$
  1203. X      s nameptr "{vv{ } }{ll{ }}{  ff{ }}{  jj{ }}" format.name$ 't :=
  1204. X      nameptr numnames = t "others" = and
  1205. X        { "et al" * }
  1206. X        { t sortify * }
  1207. X      if$
  1208. X      nameptr #1 + 'nameptr :=
  1209. X      namesleft #1 - 'namesleft :=
  1210. X    }
  1211. X  while$
  1212. X}
  1213. X
  1214. XFUNCTION {sort.format.title}
  1215. X{ 't :=
  1216. X  "A " #2
  1217. X    "An " #3
  1218. X      "The " #4 t chop.word
  1219. X    chop.word
  1220. X  chop.word
  1221. X  sortify
  1222. X  #1 global.max$ substring$
  1223. X}
  1224. X
  1225. XFUNCTION {author.sort}
  1226. X{ author empty$
  1227. X    { key empty$
  1228. X        { "to sort, need author or key in " cite$ * warning$
  1229. X          ""
  1230. X        }
  1231. X        { key sortify }
  1232. X      if$
  1233. X    }
  1234. X    { author sort.format.names }
  1235. X  if$
  1236. X}
  1237. X
  1238. XFUNCTION {author.editor.sort}
  1239. X{ author empty$
  1240. X    { editor empty$
  1241. X        { key empty$
  1242. X            { "to sort, need author, editor, or key in " cite$ * warning$
  1243. X              ""
  1244. X            }
  1245. X            { key sortify }
  1246. X          if$
  1247. X        }
  1248. X        { editor sort.format.names }
  1249. X      if$
  1250. X    }
  1251. X    { author sort.format.names }
  1252. X  if$
  1253. X}
  1254. X
  1255. XFUNCTION {author.organization.sort}
  1256. X{ author empty$
  1257. X    { organization empty$
  1258. X        { key empty$
  1259. X            { "to sort, need author, organization, or key in " cite$ * warning$
  1260. X              ""
  1261. X            }
  1262. X            { key sortify }
  1263. X          if$
  1264. X        }
  1265. X        { "The " #4 organization chop.word sortify }
  1266. X      if$
  1267. X    }
  1268. X    { author sort.format.names }
  1269. X  if$
  1270. X}
  1271. X
  1272. XFUNCTION {editor.organization.sort}
  1273. X{ editor empty$
  1274. X    { organization empty$
  1275. X        { key empty$
  1276. X            { "to sort, need editor, organization, or key in " cite$ * warning$
  1277. X              ""
  1278. X            }
  1279. X            { key sortify }
  1280. X          if$
  1281. X        }
  1282. X        { "The " #4 organization chop.word sortify }
  1283. X      if$
  1284. X    }
  1285. X    { editor sort.format.names }
  1286. X  if$
  1287. X}
  1288. X
  1289. XFUNCTION {presort}
  1290. X{ calc.label
  1291. X  sort.label
  1292. X  "    "
  1293. X  *
  1294. X  type$ "book" =
  1295. X  type$ "inbook" =
  1296. X  or
  1297. X    'author.editor.sort
  1298. X    { type$ "proceedings" =
  1299. X        'editor.organization.sort
  1300. X        { type$ "manual" =
  1301. X            'author.organization.sort
  1302. X            'author.sort
  1303. X          if$
  1304. X        }
  1305. X      if$
  1306. X    }
  1307. X  if$
  1308. X  *
  1309. X  "    "
  1310. X  *
  1311. X  year field.or.null sortify
  1312. X  *
  1313. X  "    "
  1314. X  *
  1315. X  title field.or.null
  1316. X  sort.format.title
  1317. X  *
  1318. X  #1 entry.max$ substring$
  1319. X  'sort.key$ :=
  1320. X}
  1321. X
  1322. XITERATE {presort}
  1323. X
  1324. XSORT
  1325. X
  1326. XSTRINGS { longest.label last.sort.label next.extra }
  1327. X
  1328. XINTEGERS { longest.label.width last.extra.num }
  1329. X
  1330. XFUNCTION {initialize.longest.label}
  1331. X{ "" 'longest.label :=
  1332. X  #0 int.to.chr$ 'last.sort.label :=
  1333. X  "" 'next.extra :=
  1334. X  #0 'longest.label.width :=
  1335. X  #0 'last.extra.num :=
  1336. X}
  1337. X
  1338. XFUNCTION {forward.pass}
  1339. X{ last.sort.label sort.label =
  1340. X    { last.extra.num #1 + 'last.extra.num :=
  1341. X      last.extra.num int.to.chr$ 'extra.label :=
  1342. X    }
  1343. X    { "a" chr.to.int$ 'last.extra.num :=
  1344. X      "" 'extra.label :=
  1345. X      sort.label 'last.sort.label :=
  1346. X    }
  1347. X  if$
  1348. X}
  1349. X
  1350. XFUNCTION {reverse.pass}
  1351. X{ next.extra "b" =
  1352. X    { "a" 'extra.label := }
  1353. X    'skip$
  1354. X  if$
  1355. X  label extra.label * 'label :=
  1356. X  label width$ longest.label.width >
  1357. X    { label 'longest.label :=
  1358. X      label width$ 'longest.label.width :=
  1359. X    }
  1360. X    'skip$
  1361. X  if$
  1362. X  extra.label 'next.extra :=
  1363. X}
  1364. X
  1365. XEXECUTE {initialize.longest.label}
  1366. X
  1367. XITERATE {forward.pass}
  1368. X
  1369. XREVERSE {reverse.pass}
  1370. X
  1371. XFUNCTION {begin.bib}
  1372. X{ et.al.char.used
  1373. X    { "\newcommand{\etalchar}[1]{$^{#1}$}" write$ newline$ }
  1374. X    'skip$
  1375. X  if$
  1376. X  preamble$ empty$
  1377. X    'skip$
  1378. X    { preamble$ write$ newline$ }
  1379. X  if$
  1380. X  "\begin{thebibliography}{"  longest.label  * "}" * write$ newline$
  1381. X}
  1382. X
  1383. XEXECUTE {begin.bib}
  1384. X
  1385. XEXECUTE {init.state.consts}
  1386. X
  1387. XITERATE {call.type$}
  1388. X
  1389. XFUNCTION {end.bib}
  1390. X{ newline$
  1391. X  "\end{thebibliography}" write$ newline$
  1392. X}
  1393. X
  1394. XEXECUTE {end.bib}
  1395. END_OF_FILE
  1396.   if test 24397 -ne `wc -c <'alpha.bst'`; then
  1397.     echo shar: \"'alpha.bst'\" unpacked with wrong size!
  1398.   fi
  1399.   # end of 'alpha.bst'
  1400. fi
  1401. if test -f 'annotebib.el' -a "${1}" != "-c" ; then 
  1402.   echo shar: Will not clobber existing file \"'annotebib.el'\"
  1403. else
  1404.   echo shar: Extracting \"'annotebib.el'\" \(6492 characters\)
  1405.   sed "s/^X//" >'annotebib.el' <<'END_OF_FILE'
  1406. X;;;; annotebib.el, v1.0
  1407. X;;;;
  1408. X;;;; Transform a bibliography style so that it is compatible with the
  1409. X;;;; conventions used by my `annote' package.
  1410. X;;;;
  1411. X;;;; Yves Arrouye (arrouye@imag.imag.fr), May 1993
  1412. X;;;;
  1413. X
  1414. X;;;; The functions follow the guidelines found in annotebib.add: they
  1415. X;;;; look for the ENTRY declaration, add the `annote' field, then look
  1416. X;;;; for the fin.entry FUNCTION and add the `format.annote' FUNCTION
  1417. X;;;; before it, then add a call to `format.annote' at the end of
  1418. X;;;; `fin.entry'.
  1419. X;;;;
  1420. X;;;; The modification is done in a separate buffer by default, then
  1421. X;;;; this buffer is copied into the original one. This means that the
  1422. X;;;; modification is undoable by a single undo, and that in case of
  1423. X;;;; errors the original file is not modified.
  1424. X
  1425. X;;;; If the transformation fails, you can either do it by hand
  1426. X;;;; (following directions in annotebib.add), or modify the regular
  1427. X;;;; expressions used to search for interesting information. The
  1428. X;;;; latter approach is best for multiple style files written with the
  1429. X;;;; same conventions/functions.
  1430. X
  1431. X;;; Regexps for recognizing things which interest us.
  1432. X
  1433. X(defvar annote-entry-regexp "ENTRY[^{]*{"
  1434. X  "*A regexp to find the ENTRY fields declaration. This regexp should
  1435. Xmatch up to the opening brace af the ENTRY declaration.")
  1436. X
  1437. X(defvar annote-fin-entry-regexp "FUNCTION[ \t]*{[ \t]*fin.entry[ \t]*}[^{]*"
  1438. X  "*A regexp to find the FUNCTION for ending entries. This regexp
  1439. Xshould match up to but not including the opening brace of the
  1440. Xfunction.")
  1441. X
  1442. X;;; Other customization
  1443. X
  1444. X(defvar annote-savefile-prefix ""
  1445. X  "* A string prefixed to a bibliography file name when saving it. An
  1446. Xempty string means to replace the file if in the same directory.")
  1447. X
  1448. X;;; Private variables
  1449. X
  1450. X(setq annote-version-string "v1.0")
  1451. X
  1452. X;;; Set up a syntax table. The syntax entries are borrowed from a
  1453. X;;; BibTeX mode, and the syntax entries for { and } were added for
  1454. X;;; security (if the mode the file was in has redefined those chars)
  1455. X
  1456. X(if (or (not (boundp 'bibtex-mode-syntax-table))
  1457. X    (null bibtex-mode-syntax-table))
  1458. X    (progn
  1459. X      (setq bibtex-mode-syntax-table (copy-syntax-table))
  1460. X      (modify-syntax-entry ?\$ "$$  ")
  1461. X      (modify-syntax-entry ?\% "<   ")
  1462. X      (modify-syntax-entry ?\f ">   ")
  1463. X      (modify-syntax-entry ?\n ">   ")
  1464. X      (modify-syntax-entry ?'  "w   ")
  1465. X      (modify-syntax-entry ?@  "w   ")
  1466. X      (modify-syntax-entry ?{  "(}")
  1467. X      (modify-syntax-entry ?}  "){")))
  1468. X
  1469. X;;; Annotation of a bibliography in a buffer. This is the basic
  1470. X;;; annotation primitive.
  1471. X
  1472. X(defun annote-buffer (&optional in-place noerror)
  1473. X  "Annote the bibliography style in the current buffer. If a non-nil argument
  1474. Xis given, the file is edited in place. Does nothing if the buffer
  1475. Xalready supports (or looks like it does support) annote'.
  1476. X
  1477. XReturn the success of the modification, or the list '(no-change) if already
  1478. Xsupporting `annote'."
  1479. X  (interactive "P")
  1480. X  (let ((success nil)
  1481. X    (old-syntax (syntax-table))
  1482. X    (tembuf (if (not in-place) (generate-new-buffer " annote temp")))
  1483. X    (bibbuf (current-buffer)))
  1484. X    (unwind-protect
  1485. X    (save-excursion
  1486. X      (if (search-forward "FUNCTION {format.annote}" (point-max) t)
  1487. X          (setq success '(no-change))
  1488. X        (if (not in-place)
  1489. X        (progn
  1490. X          (set-buffer tembuf)
  1491. X          (erase-buffer)
  1492. X          (insert-buffer-substring bibbuf)))
  1493. X        (set-syntax-table bibtex-mode-syntax-table)
  1494. X        (goto-char (point-min))
  1495. X        (insert "\
  1496. X% Style file modified on " (current-time-string) "\n\
  1497. X%                     by " (user-full-name)
  1498. X" <" (user-real-login-name) "@" (system-name) ">\n
  1499. X% This bibliography style was made annote-compatible by annotebib.el "
  1500. Xannote-version-string "\n\
  1501. X% It can be used for both annotated and non-annotated bibliographies \
  1502. Xlisting\n\
  1503. X% (annote package by Yves Arrouye <arrouye@imag.imag.fr>)\n\n")
  1504. X        (if (not (re-search-forward annote-entry-regexp (point-max) t))
  1505. X        (error "Cannot find ENTRY declaration")
  1506. X          (goto-char (match-end 0))
  1507. X          (insert " annote\n   ")
  1508. X          (if (not (re-search-forward annote-fin-entry-regexp
  1509. X                      (point-max) t))
  1510. X          (error "Cannot find FUNCTION for ending entries")
  1511. X        ;; found the fin.entry function
  1512. X        (setq success t)
  1513. X        (goto-char (1- (scan-lists (match-end 0) 1 0)))
  1514. X        (insert "  format.annote write$\n")
  1515. X        (goto-char (1- (match-beginning 0)))
  1516. X        (insert "\n\
  1517. XFUNCTION {format.annote}\n\
  1518. X{ annote empty$\n\
  1519. X        { \"\" }\n\
  1520. X        { \"\\ifx\\annote\\undefined\\else\\begin{annote} \"\n\
  1521. X          annote\n\
  1522. X          * \" \\end{annote}\\fi \" *\n\
  1523. X        }\n\
  1524. X      if$\n\
  1525. X}\n")
  1526. X        (if (not in-place)
  1527. X            (progn
  1528. X              (set-buffer bibbuf)
  1529. X              (erase-buffer)
  1530. X              (insert-buffer-substring tembuf)))))))
  1531. X      (set-syntax-table old-syntax)
  1532. X      (if tembuf (kill-buffer tembuf)))
  1533. X      success))
  1534. X
  1535. X;;; Annotation of a file.
  1536. X;;;
  1537. X;;; If not called interactively, and savefile is nil, then the original
  1538. X;;; file is modified.
  1539. X
  1540. X(defun annote-file (origfile &optional savefile)
  1541. X  "Annote a file. If called interactively, asks for an existing
  1542. Xfilename, then for the name of the annotated file. If this name is a
  1543. Xdirectory, then the name of the file will be the filename of the
  1544. Xoriginal file in this directory, unless the directories are the same,
  1545. Xin which case the original file will have the value of
  1546. Xannote-savefile-prefix prefixed to it.
  1547. X
  1548. XIf annote-buffer fails on the loaded file, it is not saved. Return
  1549. Xsuccess as got from annote-buffer."
  1550. X  (interactive"fBib file: \nFSave file: ")
  1551. X  (if savefile
  1552. X      ;; a savefile is specified
  1553. X      (progn
  1554. X    (if (string-match ".+\\(/+\\)$" savefile)
  1555. X        (setq savefile (substring savefile 0 (match-beginning 1))))
  1556. X    (if (file-directory-p savefile)
  1557. X        ;; the savefile is a directory
  1558. X        (progn
  1559. X          (setq savefile (concat savefile "/"))
  1560. X          (setq savefile
  1561. X            (concat savefile
  1562. X                (if (string-equal (file-name-directory origfile)
  1563. X                          savefile)
  1564. X                ;; same directory: append the contents of
  1565. X                ;; the annote-savefile-prefix variable
  1566. X                annote-savefile-prefix)
  1567. X                (file-name-nondirectory origfile)))))))
  1568. X  ;; now do the real job: load the file, modify it, and save it
  1569. X  (let ((success nil)
  1570. X    (tembuf (find-file-noselect origfile)))
  1571. X    (unwind-protect
  1572. X    (save-excursion
  1573. X      (set-buffer tembuf)
  1574. X      (if (setq success (annote-buffer t))
  1575. X          (progn
  1576. X        (if savefile
  1577. X            (set-visited-file-name savefile))
  1578. X        (if (buffer-modified-p)
  1579. X            (save-buffer)))))
  1580. X      (if (not success)
  1581. X      ;; don't save!
  1582. X      (progn
  1583. X        (set-buffer tembuf)
  1584. X        (set-buffer-modified-p nil))))
  1585. X    (kill-buffer tembuf)
  1586. X    success))
  1587. X
  1588. END_OF_FILE
  1589.   if test 6492 -ne `wc -c <'annotebib.el'`; then
  1590.     echo shar: \"'annotebib.el'\" unpacked with wrong size!
  1591.   fi
  1592.   # end of 'annotebib.el'
  1593. fi
  1594. if test -f 'plain.bst' -a "${1}" != "-c" ; then 
  1595.   echo shar: Will not clobber existing file \"'plain.bst'\"
  1596. else
  1597.   echo shar: Extracting \"'plain.bst'\" \(21104 characters\)
  1598.   sed "s/^X//" >'plain.bst' <<'END_OF_FILE'
  1599. X% Style file modified on Wed May 12 19:48:03 1993
  1600. X%                     by Yves Arrouye <arrouye@mistral>
  1601. X
  1602. X% This bibliography style was made annote-compatible by annotebib.el v1.0
  1603. X% It can be used for both annotated and non-annotated bibliographies listing
  1604. X% (annote package by Yves Arrouye <arrouye@imag.imag.fr>)
  1605. X
  1606. X% BibTeX standard bibliography style `plain'
  1607. X        % version 0.99a for BibTeX versions 0.99a or later, LaTeX version 2.09.
  1608. X        % Copyright (C) 1985, all rights reserved.
  1609. X        % Copying of this file is authorized only if either
  1610. X        % (1) you make absolutely no changes to your copy, including name, or
  1611. X        % (2) if you do make changes, you name it something other than
  1612. X        % btxbst.doc, plain.bst, unsrt.bst, alpha.bst, and abbrv.bst.
  1613. X        % This restriction helps ensure that all standard styles are identical.
  1614. X        % The file btxbst.doc has the documentation for this style.
  1615. X
  1616. XENTRY
  1617. X  { annote
  1618. X    address
  1619. X    author
  1620. X    booktitle
  1621. X    chapter
  1622. X    edition
  1623. X    editor
  1624. X    howpublished
  1625. X    institution
  1626. X    journal
  1627. X    key
  1628. X    month
  1629. X    note
  1630. X    number
  1631. X    organization
  1632. X    pages
  1633. X    publisher
  1634. X    school
  1635. X    series
  1636. X    title
  1637. X    type
  1638. X    volume
  1639. X    year
  1640. X  }
  1641. X  {}
  1642. X  { label }
  1643. X
  1644. XINTEGERS { output.state before.all mid.sentence after.sentence after.block }
  1645. X
  1646. XFUNCTION {init.state.consts}
  1647. X{ #0 'before.all :=
  1648. X  #1 'mid.sentence :=
  1649. X  #2 'after.sentence :=
  1650. X  #3 'after.block :=
  1651. X}
  1652. X
  1653. XSTRINGS { s t }
  1654. X
  1655. XFUNCTION {output.nonnull}
  1656. X{ 's :=
  1657. X  output.state mid.sentence =
  1658. X    { ", " * write$ }
  1659. X    { output.state after.block =
  1660. X        { add.period$ write$
  1661. X          newline$
  1662. X          "\newblock " write$
  1663. X        }
  1664. X        { output.state before.all =
  1665. X            'write$
  1666. X            { add.period$ " " * write$ }
  1667. X          if$
  1668. X        }
  1669. X      if$
  1670. X      mid.sentence 'output.state :=
  1671. X    }
  1672. X  if$
  1673. X  s
  1674. X}
  1675. X
  1676. XFUNCTION {output}
  1677. X{ duplicate$ empty$
  1678. X    'pop$
  1679. X    'output.nonnull
  1680. X  if$
  1681. X}
  1682. X
  1683. XFUNCTION {output.check}
  1684. X{ 't :=
  1685. X  duplicate$ empty$
  1686. X    { pop$ "empty " t * " in " * cite$ * warning$ }
  1687. X    'output.nonnull
  1688. X  if$
  1689. X}
  1690. X
  1691. XFUNCTION {output.bibitem}
  1692. X{ newline$
  1693. X  "\bibitem{" write$
  1694. X  cite$ write$
  1695. X  "}" write$
  1696. X  newline$
  1697. X  ""
  1698. X  before.all 'output.state :=
  1699. X}
  1700. X
  1701. XFUNCTION {format.annote}
  1702. X{ annote empty$
  1703. X        { "" }
  1704. X        { "\ifx\annote\undefined\else\begin{annote} "
  1705. X          annote
  1706. X          * " \end{annote}\fi " *
  1707. X        }
  1708. X      if$
  1709. X}
  1710. X
  1711. XFUNCTION {fin.entry}
  1712. X{ add.period$
  1713. X  write$
  1714. X  newline$
  1715. X  format.annote write$
  1716. X}
  1717. X
  1718. XFUNCTION {new.block}
  1719. X{ output.state before.all =
  1720. X    'skip$
  1721. X    { after.block 'output.state := }
  1722. X  if$
  1723. X}
  1724. X
  1725. XFUNCTION {new.sentence}
  1726. X{ output.state after.block =
  1727. X    'skip$
  1728. X    { output.state before.all =
  1729. X        'skip$
  1730. X        { after.sentence 'output.state := }
  1731. X      if$
  1732. X    }
  1733. X  if$
  1734. X}
  1735. X
  1736. XFUNCTION {not}
  1737. X{   { #0 }
  1738. X    { #1 }
  1739. X  if$
  1740. X}
  1741. X
  1742. XFUNCTION {and}
  1743. X{   'skip$
  1744. X    { pop$ #0 }
  1745. X  if$
  1746. X}
  1747. X
  1748. XFUNCTION {or}
  1749. X{   { pop$ #1 }
  1750. X    'skip$
  1751. X  if$
  1752. X}
  1753. X
  1754. XFUNCTION {new.block.checka}
  1755. X{ empty$
  1756. X    'skip$
  1757. X    'new.block
  1758. X  if$
  1759. X}
  1760. X
  1761. XFUNCTION {new.block.checkb}
  1762. X{ empty$
  1763. X  swap$ empty$
  1764. X  and
  1765. X    'skip$
  1766. X    'new.block
  1767. X  if$
  1768. X}
  1769. X
  1770. XFUNCTION {new.sentence.checka}
  1771. X{ empty$
  1772. X    'skip$
  1773. X    'new.sentence
  1774. X  if$
  1775. X}
  1776. X
  1777. XFUNCTION {new.sentence.checkb}
  1778. X{ empty$
  1779. X  swap$ empty$
  1780. X  and
  1781. X    'skip$
  1782. X    'new.sentence
  1783. X  if$
  1784. X}
  1785. X
  1786. XFUNCTION {field.or.null}
  1787. X{ duplicate$ empty$
  1788. X    { pop$ "" }
  1789. X    'skip$
  1790. X  if$
  1791. X}
  1792. X
  1793. XFUNCTION {emphasize}
  1794. X{ duplicate$ empty$
  1795. X    { pop$ "" }
  1796. X    { "{\em " swap$ * "}" * }
  1797. X  if$
  1798. X}
  1799. X
  1800. XINTEGERS { nameptr namesleft numnames }
  1801. X
  1802. XFUNCTION {format.names}
  1803. X{ 's :=
  1804. X  #1 'nameptr :=
  1805. X  s num.names$ 'numnames :=
  1806. X  numnames 'namesleft :=
  1807. X    { namesleft #0 > }
  1808. X    { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
  1809. X      nameptr #1 >
  1810. X        { namesleft #1 >
  1811. X            { ", " * t * }
  1812. X            { numnames #2 >
  1813. X                { "," * }
  1814. X                'skip$
  1815. X              if$
  1816. X              t "others" =
  1817. X                { " et~al." * }
  1818. X                { " and " * t * }
  1819. X              if$
  1820. X            }
  1821. X          if$
  1822. X        }
  1823. X        't
  1824. X      if$
  1825. X      nameptr #1 + 'nameptr :=
  1826. X      namesleft #1 - 'namesleft :=
  1827. X    }
  1828. X  while$
  1829. X}
  1830. X
  1831. XFUNCTION {format.authors}
  1832. X{ author empty$
  1833. X    { "" }
  1834. X    { author format.names }
  1835. X  if$
  1836. X}
  1837. X
  1838. XFUNCTION {format.editors}
  1839. X{ editor empty$
  1840. X    { "" }
  1841. X    { editor format.names
  1842. X      editor num.names$ #1 >
  1843. X        { ", editors" * }
  1844. X        { ", editor" * }
  1845. X      if$
  1846. X    }
  1847. X  if$
  1848. X}
  1849. X
  1850. XFUNCTION {format.title}
  1851. X{ title empty$
  1852. X    { "" }
  1853. X    { title "t" change.case$ }
  1854. X  if$
  1855. X}
  1856. X
  1857. XFUNCTION {n.dashify}
  1858. X{ 't :=
  1859. X  ""
  1860. X    { t empty$ not }
  1861. X    { t #1 #1 substring$ "-" =
  1862. X        { t #1 #2 substring$ "--" = not
  1863. X            { "--" *
  1864. X              t #2 global.max$ substring$ 't :=
  1865. X            }
  1866. X            {   { t #1 #1 substring$ "-" = }
  1867. X                { "-" *
  1868. X                  t #2 global.max$ substring$ 't :=
  1869. X                }
  1870. X              while$
  1871. X            }
  1872. X          if$
  1873. X        }
  1874. X        { t #1 #1 substring$ *
  1875. X          t #2 global.max$ substring$ 't :=
  1876. X        }
  1877. X      if$
  1878. X    }
  1879. X  while$
  1880. X}
  1881. X
  1882. XFUNCTION {format.date}
  1883. X{ year empty$
  1884. X    { month empty$
  1885. X        { "" }
  1886. X        { "there's a month but no year in " cite$ * warning$
  1887. X          month
  1888. X        }
  1889. X      if$
  1890. X    }
  1891. X    { month empty$
  1892. X        'year
  1893. X        { month " " * year * }
  1894. X      if$
  1895. X    }
  1896. X  if$
  1897. X}
  1898. X
  1899. XFUNCTION {format.btitle}
  1900. X{ title emphasize
  1901. X}
  1902. X
  1903. XFUNCTION {tie.or.space.connect}
  1904. X{ duplicate$ text.length$ #3 <
  1905. X    { "~" }
  1906. X    { " " }
  1907. X  if$
  1908. X  swap$ * *
  1909. X}
  1910. X
  1911. XFUNCTION {either.or.check}
  1912. X{ empty$
  1913. X    'pop$
  1914. X    { "can't use both " swap$ * " fields in " * cite$ * warning$ }
  1915. X  if$
  1916. X}
  1917. X
  1918. XFUNCTION {format.bvolume}
  1919. X{ volume empty$
  1920. X    { "" }
  1921. X    { "volume" volume tie.or.space.connect
  1922. X      series empty$
  1923. X        'skip$
  1924. X        { " of " * series emphasize * }
  1925. X      if$
  1926. X      "volume and number" number either.or.check
  1927. X    }
  1928. X  if$
  1929. X}
  1930. X
  1931. XFUNCTION {format.number.series}
  1932. X{ volume empty$
  1933. X    { number empty$
  1934. X        { series field.or.null }
  1935. X        { output.state mid.sentence =
  1936. X            { "number" }
  1937. X            { "Number" }
  1938. X          if$
  1939. X          number tie.or.space.connect
  1940. X          series empty$
  1941. X            { "there's a number but no series in " cite$ * warning$ }
  1942. X            { " in " * series * }
  1943. X          if$
  1944. X        }
  1945. X      if$
  1946. X    }
  1947. X    { "" }
  1948. X  if$
  1949. X}
  1950. X
  1951. XFUNCTION {format.edition}
  1952. X{ edition empty$
  1953. X    { "" }
  1954. X    { output.state mid.sentence =
  1955. X        { edition "l" change.case$ " edition" * }
  1956. X        { edition "t" change.case$ " edition" * }
  1957. X      if$
  1958. X    }
  1959. X  if$
  1960. X}
  1961. X
  1962. XINTEGERS { multiresult }
  1963. X
  1964. XFUNCTION {multi.page.check}
  1965. X{ 't :=
  1966. X  #0 'multiresult :=
  1967. X    { multiresult not
  1968. X      t empty$ not
  1969. X      and
  1970. X    }
  1971. X    { t #1 #1 substring$
  1972. X      duplicate$ "-" =
  1973. X      swap$ duplicate$ "," =
  1974. X      swap$ "+" =
  1975. X      or or
  1976. X        { #1 'multiresult := }
  1977. X        { t #2 global.max$ substring$ 't := }
  1978. X      if$
  1979. X    }
  1980. X  while$
  1981. X  multiresult
  1982. X}
  1983. X
  1984. XFUNCTION {format.pages}
  1985. X{ pages empty$
  1986. X    { "" }
  1987. X    { pages multi.page.check
  1988. X        { "pages" pages n.dashify tie.or.space.connect }
  1989. X        { "page" pages tie.or.space.connect }
  1990. X      if$
  1991. X    }
  1992. X  if$
  1993. X}
  1994. X
  1995. XFUNCTION {format.vol.num.pages}
  1996. X{ volume field.or.null
  1997. X  number empty$
  1998. X    'skip$
  1999. X    { "(" number * ")" * *
  2000. X      volume empty$
  2001. X        { "there's a number but no volume in " cite$ * warning$ }
  2002. X        'skip$
  2003. X      if$
  2004. X    }
  2005. X  if$
  2006. X  pages empty$
  2007. X    'skip$
  2008. X    { duplicate$ empty$
  2009. X        { pop$ format.pages }
  2010. X        { ":" * pages n.dashify * }
  2011. X      if$
  2012. X    }
  2013. X  if$
  2014. X}
  2015. X
  2016. XFUNCTION {format.chapter.pages}
  2017. X{ chapter empty$
  2018. X    'format.pages
  2019. X    { type empty$
  2020. X        { "chapter" }
  2021. X        { type "l" change.case$ }
  2022. X      if$
  2023. X      chapter tie.or.space.connect
  2024. X      pages empty$
  2025. X        'skip$
  2026. X        { ", " * format.pages * }
  2027. X      if$
  2028. X    }
  2029. X  if$
  2030. X}
  2031. X
  2032. XFUNCTION {format.in.ed.booktitle}
  2033. X{ booktitle empty$
  2034. X    { "" }
  2035. X    { editor empty$
  2036. X        { "In " booktitle emphasize * }
  2037. X        { "In " format.editors * ", " * booktitle emphasize * }
  2038. X      if$
  2039. X    }
  2040. X  if$
  2041. X}
  2042. X
  2043. XFUNCTION {empty.misc.check}
  2044. X{ author empty$ title empty$ howpublished empty$
  2045. X  month empty$ year empty$ note empty$
  2046. X  and and and and and
  2047. X  key empty$ not and
  2048. X    { "all relevant fields are empty in " cite$ * warning$ }
  2049. X    'skip$
  2050. X  if$
  2051. X}
  2052. X
  2053. XFUNCTION {format.thesis.type}
  2054. X{ type empty$
  2055. X    'skip$
  2056. X    { pop$
  2057. X      type "t" change.case$
  2058. X    }
  2059. X  if$
  2060. X}
  2061. X
  2062. XFUNCTION {format.tr.number}
  2063. X{ type empty$
  2064. X    { "Technical Report" }
  2065. X    'type
  2066. X  if$
  2067. X  number empty$
  2068. X    { "t" change.case$ }
  2069. X    { number tie.or.space.connect }
  2070. X  if$
  2071. X}
  2072. X
  2073. XFUNCTION {format.article.crossref}
  2074. X{ key empty$
  2075. X    { journal empty$
  2076. X        { "need key or journal for " cite$ * " to crossref " * crossref *
  2077. X          warning$
  2078. X          ""
  2079. X        }
  2080. X        { "In {\em " journal * "\/}" * }
  2081. X      if$
  2082. X    }
  2083. X    { "In " key * }
  2084. X  if$
  2085. X  " \cite{" * crossref * "}" *
  2086. X}
  2087. X
  2088. XFUNCTION {format.crossref.editor}
  2089. X{ editor #1 "{vv~}{ll}" format.name$
  2090. X  editor num.names$ duplicate$
  2091. X  #2 >
  2092. X    { pop$ " et~al." * }
  2093. X    { #2 <
  2094. X        'skip$
  2095. X        { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
  2096. X            { " et~al." * }
  2097. X            { " and " * editor #2 "{vv~}{ll}" format.name$ * }
  2098. X          if$
  2099. X        }
  2100. X      if$
  2101. X    }
  2102. X  if$
  2103. X}
  2104. X
  2105. XFUNCTION {format.book.crossref}
  2106. X{ volume empty$
  2107. X    { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
  2108. X      "In "
  2109. X    }
  2110. X    { "Volume" volume tie.or.space.connect
  2111. X      " of " *
  2112. X    }
  2113. X  if$
  2114. X  editor empty$
  2115. X  editor field.or.null author field.or.null =
  2116. X  or
  2117. X    { key empty$
  2118. X        { series empty$
  2119. X            { "need editor, key, or series for " cite$ * " to crossref " *
  2120. X              crossref * warning$
  2121. X              "" *
  2122. X            }
  2123. X            { "{\em " * series * "\/}" * }
  2124. X          if$
  2125. X        }
  2126. X        { key * }
  2127. X      if$
  2128. X    }
  2129. X    { format.crossref.editor * }
  2130. X  if$
  2131. X  " \cite{" * crossref * "}" *
  2132. X}
  2133. X
  2134. XFUNCTION {format.incoll.inproc.crossref}
  2135. X{ editor empty$
  2136. X  editor field.or.null author field.or.null =
  2137. X  or
  2138. X    { key empty$
  2139. X        { booktitle empty$
  2140. X            { "need editor, key, or booktitle for " cite$ * " to crossref " *
  2141. X              crossref * warning$
  2142. X              ""
  2143. X            }
  2144. X            { "In {\em " booktitle * "\/}" * }
  2145. X          if$
  2146. X        }
  2147. X        { "In " key * }
  2148. X      if$
  2149. X    }
  2150. X    { "In " format.crossref.editor * }
  2151. X  if$
  2152. X  " \cite{" * crossref * "}" *
  2153. X}
  2154. X
  2155. XFUNCTION {article}
  2156. X{ output.bibitem
  2157. X  format.authors "author" output.check
  2158. X  new.block
  2159. X  format.title "title" output.check
  2160. X  new.block
  2161. X  crossref missing$
  2162. X    { journal emphasize "journal" output.check
  2163. X      format.vol.num.pages output
  2164. X      format.date "year" output.check
  2165. X    }
  2166. X    { format.article.crossref output.nonnull
  2167. X      format.pages output
  2168. X    }
  2169. X  if$
  2170. X  new.block
  2171. X  note output
  2172. X  fin.entry
  2173. X}
  2174. X
  2175. XFUNCTION {book}
  2176. X{ output.bibitem
  2177. X  author empty$
  2178. X    { format.editors "author and editor" output.check }
  2179. X    { format.authors output.nonnull
  2180. X      crossref missing$
  2181. X        { "author and editor" editor either.or.check }
  2182. X        'skip$
  2183. X      if$
  2184. X    }
  2185. X  if$
  2186. X  new.block
  2187. X  format.btitle "title" output.check
  2188. X  crossref missing$
  2189. X    { format.bvolume output
  2190. X      new.block
  2191. X      format.number.series output
  2192. X      new.sentence
  2193. X      publisher "publisher" output.check
  2194. X      address output
  2195. X    }
  2196. X    { new.block
  2197. X      format.book.crossref output.nonnull
  2198. X    }
  2199. X  if$
  2200. X  format.edition output
  2201. X  format.date "year" output.check
  2202. X  new.block
  2203. X  note output
  2204. X  fin.entry
  2205. X}
  2206. X
  2207. XFUNCTION {booklet}
  2208. X{ output.bibitem
  2209. X  format.authors output
  2210. X  new.block
  2211. X  format.title "title" output.check
  2212. X  howpublished address new.block.checkb
  2213. X  howpublished output
  2214. X  address output
  2215. X  format.date output
  2216. X  new.block
  2217. X  note output
  2218. X  fin.entry
  2219. X}
  2220. X
  2221. XFUNCTION {inbook}
  2222. X{ output.bibitem
  2223. X  author empty$
  2224. X    { format.editors "author and editor" output.check }
  2225. X    { format.authors output.nonnull
  2226. X      crossref missing$
  2227. X        { "author and editor" editor either.or.check }
  2228. X        'skip$
  2229. X      if$
  2230. X    }
  2231. X  if$
  2232. X  new.block
  2233. X  format.btitle "title" output.check
  2234. X  crossref missing$
  2235. X    { format.bvolume output
  2236. X      format.chapter.pages "chapter and pages" output.check
  2237. X      new.block
  2238. X      format.number.series output
  2239. X      new.sentence
  2240. X      publisher "publisher" output.check
  2241. X      address output
  2242. X    }
  2243. X    { format.chapter.pages "chapter and pages" output.check
  2244. X      new.block
  2245. X      format.book.crossref output.nonnull
  2246. X    }
  2247. X  if$
  2248. X  format.edition output
  2249. X  format.date "year" output.check
  2250. X  new.block
  2251. X  note output
  2252. X  fin.entry
  2253. X}
  2254. X
  2255. XFUNCTION {incollection}
  2256. X{ output.bibitem
  2257. X  format.authors "author" output.check
  2258. X  new.block
  2259. X  format.title "title" output.check
  2260. X  new.block
  2261. X  crossref missing$
  2262. X    { format.in.ed.booktitle "booktitle" output.check
  2263. X      format.bvolume output
  2264. X      format.number.series output
  2265. X      format.chapter.pages output
  2266. X      new.sentence
  2267. X      publisher "publisher" output.check
  2268. X      address output
  2269. X      format.edition output
  2270. X      format.date "year" output.check
  2271. X    }
  2272. X    { format.incoll.inproc.crossref output.nonnull
  2273. X      format.chapter.pages output
  2274. X    }
  2275. X  if$
  2276. X  new.block
  2277. X  note output
  2278. X  fin.entry
  2279. X}
  2280. X
  2281. XFUNCTION {inproceedings}
  2282. X{ output.bibitem
  2283. X  format.authors "author" output.check
  2284. X  new.block
  2285. X  format.title "title" output.check
  2286. X  new.block
  2287. X  crossref missing$
  2288. X    { format.in.ed.booktitle "booktitle" output.check
  2289. X      format.bvolume output
  2290. X      format.number.series output
  2291. X      format.pages output
  2292. X      address empty$
  2293. X        { organization publisher new.sentence.checkb
  2294. X          organization output
  2295. X          publisher output
  2296. X          format.date "year" output.check
  2297. X        }
  2298. X        { address output.nonnull
  2299. X          format.date "year" output.check
  2300. X          new.sentence
  2301. X          organization output
  2302. X          publisher output
  2303. X        }
  2304. X      if$
  2305. X    }
  2306. X    { format.incoll.inproc.crossref output.nonnull
  2307. X      format.pages output
  2308. X    }
  2309. X  if$
  2310. X  new.block
  2311. X  note output
  2312. X  fin.entry
  2313. X}
  2314. X
  2315. XFUNCTION {conference} { inproceedings }
  2316. X
  2317. XFUNCTION {manual}
  2318. X{ output.bibitem
  2319. X  author empty$
  2320. X    { organization empty$
  2321. X        'skip$
  2322. X        { organization output.nonnull
  2323. X          address output
  2324. X        }
  2325. X      if$
  2326. X    }
  2327. X    { format.authors output.nonnull }
  2328. X  if$
  2329. X  new.block
  2330. X  format.btitle "title" output.check
  2331. X  author empty$
  2332. X    { organization empty$
  2333. X        { address new.block.checka
  2334. X          address output
  2335. X        }
  2336. X        'skip$
  2337. X      if$
  2338. X    }
  2339. X    { organization address new.block.checkb
  2340. X      organization output
  2341. X      address output
  2342. X    }
  2343. X  if$
  2344. X  format.edition output
  2345. X  format.date output
  2346. X  new.block
  2347. X  note output
  2348. X  fin.entry
  2349. X}
  2350. X
  2351. XFUNCTION {mastersthesis}
  2352. X{ output.bibitem
  2353. X  format.authors "author" output.check
  2354. X  new.block
  2355. X  format.title "title" output.check
  2356. X  new.block
  2357. X  "Master's thesis" format.thesis.type output.nonnull
  2358. X  school "school" output.check
  2359. X  address output
  2360. X  format.date "year" output.check
  2361. X  new.block
  2362. X  note output
  2363. X  fin.entry
  2364. X}
  2365. X
  2366. XFUNCTION {misc}
  2367. X{ output.bibitem
  2368. X  format.authors output
  2369. X  title howpublished new.block.checkb
  2370. X  format.title output
  2371. X  howpublished new.block.checka
  2372. X  howpublished output
  2373. X  format.date output
  2374. X  new.block
  2375. X  note output
  2376. X  fin.entry
  2377. X  empty.misc.check
  2378. X}
  2379. X
  2380. XFUNCTION {phdthesis}
  2381. X{ output.bibitem
  2382. X  format.authors "author" output.check
  2383. X  new.block
  2384. X  format.btitle "title" output.check
  2385. X  new.block
  2386. X  "PhD thesis" format.thesis.type output.nonnull
  2387. X  school "school" output.check
  2388. X  address output
  2389. X  format.date "year" output.check
  2390. X  new.block
  2391. X  note output
  2392. X  fin.entry
  2393. X}
  2394. X
  2395. XFUNCTION {proceedings}
  2396. X{ output.bibitem
  2397. X  editor empty$
  2398. X    { organization output }
  2399. X    { format.editors output.nonnull }
  2400. X  if$
  2401. X  new.block
  2402. X  format.btitle "title" output.check
  2403. X  format.bvolume output
  2404. X  format.number.series output
  2405. X  address empty$
  2406. X    { editor empty$
  2407. X        { publisher new.sentence.checka }
  2408. X        { organization publisher new.sentence.checkb
  2409. X          organization output
  2410. X        }
  2411. X      if$
  2412. X      publisher output
  2413. X      format.date "year" output.check
  2414. X    }
  2415. X    { address output.nonnull
  2416. X      format.date "year" output.check
  2417. X      new.sentence
  2418. X      editor empty$
  2419. X        'skip$
  2420. X        { organization output }
  2421. X      if$
  2422. X      publisher output
  2423. X    }
  2424. X  if$
  2425. X  new.block
  2426. X  note output
  2427. X  fin.entry
  2428. X}
  2429. X
  2430. XFUNCTION {techreport}
  2431. X{ output.bibitem
  2432. X  format.authors "author" output.check
  2433. X  new.block
  2434. X  format.title "title" output.check
  2435. X  new.block
  2436. X  format.tr.number output.nonnull
  2437. X  institution "institution" output.check
  2438. X  address output
  2439. X  format.date "year" output.check
  2440. X  new.block
  2441. X  note output
  2442. X  fin.entry
  2443. X}
  2444. X
  2445. XFUNCTION {unpublished}
  2446. X{ output.bibitem
  2447. X  format.authors "author" output.check
  2448. X  new.block
  2449. X  format.title "title" output.check
  2450. X  new.block
  2451. X  note "note" output.check
  2452. X  format.date output
  2453. X  fin.entry
  2454. X}
  2455. X
  2456. XFUNCTION {default.type} { misc }
  2457. X
  2458. XMACRO {jan} {"January"}
  2459. X
  2460. XMACRO {feb} {"February"}
  2461. X
  2462. XMACRO {mar} {"March"}
  2463. X
  2464. XMACRO {apr} {"April"}
  2465. X
  2466. XMACRO {may} {"May"}
  2467. X
  2468. XMACRO {jun} {"June"}
  2469. X
  2470. XMACRO {jul} {"July"}
  2471. X
  2472. XMACRO {aug} {"August"}
  2473. X
  2474. XMACRO {sep} {"September"}
  2475. X
  2476. XMACRO {oct} {"October"}
  2477. X
  2478. XMACRO {nov} {"November"}
  2479. X
  2480. XMACRO {dec} {"December"}
  2481. X
  2482. XMACRO {acmcs} {"ACM Computing Surveys"}
  2483. X
  2484. XMACRO {acta} {"Acta Informatica"}
  2485. X
  2486. XMACRO {cacm} {"Communications of the ACM"}
  2487. X
  2488. XMACRO {ibmjrd} {"IBM Journal of Research and Development"}
  2489. X
  2490. XMACRO {ibmsj} {"IBM Systems Journal"}
  2491. X
  2492. XMACRO {ieeese} {"IEEE Transactions on Software Engineering"}
  2493. X
  2494. XMACRO {ieeetc} {"IEEE Transactions on Computers"}
  2495. X
  2496. XMACRO {ieeetcad}
  2497. X {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
  2498. X
  2499. XMACRO {ipl} {"Information Processing Letters"}
  2500. X
  2501. XMACRO {jacm} {"Journal of the ACM"}
  2502. X
  2503. XMACRO {jcss} {"Journal of Computer and System Sciences"}
  2504. X
  2505. XMACRO {scp} {"Science of Computer Programming"}
  2506. X
  2507. XMACRO {sicomp} {"SIAM Journal on Computing"}
  2508. X
  2509. XMACRO {tocs} {"ACM Transactions on Computer Systems"}
  2510. X
  2511. XMACRO {tods} {"ACM Transactions on Database Systems"}
  2512. X
  2513. XMACRO {tog} {"ACM Transactions on Graphics"}
  2514. X
  2515. XMACRO {toms} {"ACM Transactions on Mathematical Software"}
  2516. X
  2517. XMACRO {toois} {"ACM Transactions on Office Information Systems"}
  2518. X
  2519. XMACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
  2520. X
  2521. XMACRO {tcs} {"Theoretical Computer Science"}
  2522. X
  2523. XREAD
  2524. X
  2525. XFUNCTION {sortify}
  2526. X{ purify$
  2527. X  "l" change.case$
  2528. X}
  2529. X
  2530. XINTEGERS { len }
  2531. X
  2532. XFUNCTION {chop.word}
  2533. X{ 's :=
  2534. X  'len :=
  2535. X  s #1 len substring$ =
  2536. X    { s len #1 + global.max$ substring$ }
  2537. X    's
  2538. X  if$
  2539. X}
  2540. X
  2541. XFUNCTION {sort.format.names}
  2542. X{ 's :=
  2543. X  #1 'nameptr :=
  2544. X  ""
  2545. X  s num.names$ 'numnames :=
  2546. X  numnames 'namesleft :=
  2547. X    { namesleft #0 > }
  2548. X    { nameptr #1 >
  2549. X        { "   " * }
  2550. X        'skip$
  2551. X      if$
  2552. X      s nameptr "{vv{ } }{ll{ }}{  ff{ }}{  jj{ }}" format.name$ 't :=
  2553. X      nameptr numnames = t "others" = and
  2554. X        { "et al" * }
  2555. X        { t sortify * }
  2556. X      if$
  2557. X      nameptr #1 + 'nameptr :=
  2558. X      namesleft #1 - 'namesleft :=
  2559. X    }
  2560. X  while$
  2561. X}
  2562. X
  2563. XFUNCTION {sort.format.title}
  2564. X{ 't :=
  2565. X  "A " #2
  2566. X    "An " #3
  2567. X      "The " #4 t chop.word
  2568. X    chop.word
  2569. X  chop.word
  2570. X  sortify
  2571. X  #1 global.max$ substring$
  2572. X}
  2573. X
  2574. XFUNCTION {author.sort}
  2575. X{ author empty$
  2576. X    { key empty$
  2577. X        { "to sort, need author or key in " cite$ * warning$
  2578. X          ""
  2579. X        }
  2580. X        { key sortify }
  2581. X      if$
  2582. X    }
  2583. X    { author sort.format.names }
  2584. X  if$
  2585. X}
  2586. X
  2587. XFUNCTION {author.editor.sort}
  2588. X{ author empty$
  2589. X    { editor empty$
  2590. X        { key empty$
  2591. X            { "to sort, need author, editor, or key in " cite$ * warning$
  2592. X              ""
  2593. X            }
  2594. X            { key sortify }
  2595. X          if$
  2596. X        }
  2597. X        { editor sort.format.names }
  2598. X      if$
  2599. X    }
  2600. X    { author sort.format.names }
  2601. X  if$
  2602. X}
  2603. X
  2604. XFUNCTION {author.organization.sort}
  2605. X{ author empty$
  2606. X    { organization empty$
  2607. X        { key empty$
  2608. X            { "to sort, need author, organization, or key in " cite$ * warning$
  2609. X              ""
  2610. X            }
  2611. X            { key sortify }
  2612. X          if$
  2613. X        }
  2614. X        { "The " #4 organization chop.word sortify }
  2615. X      if$
  2616. X    }
  2617. X    { author sort.format.names }
  2618. X  if$
  2619. X}
  2620. X
  2621. XFUNCTION {editor.organization.sort}
  2622. X{ editor empty$
  2623. X    { organization empty$
  2624. X        { key empty$
  2625. X            { "to sort, need editor, organization, or key in " cite$ * warning$
  2626. X              ""
  2627. X            }
  2628. X            { key sortify }
  2629. X          if$
  2630. X        }
  2631. X        { "The " #4 organization chop.word sortify }
  2632. X      if$
  2633. X    }
  2634. X    { editor sort.format.names }
  2635. X  if$
  2636. X}
  2637. X
  2638. XFUNCTION {presort}
  2639. X{ type$ "book" =
  2640. X  type$ "inbook" =
  2641. X  or
  2642. X    'author.editor.sort
  2643. X    { type$ "proceedings" =
  2644. X        'editor.organization.sort
  2645. X        { type$ "manual" =
  2646. X            'author.organization.sort
  2647. X            'author.sort
  2648. X          if$
  2649. X        }
  2650. X      if$
  2651. X    }
  2652. X  if$
  2653. X  "    "
  2654. X  *
  2655. X  year field.or.null sortify
  2656. X  *
  2657. X  "    "
  2658. X  *
  2659. X  title field.or.null
  2660. X  sort.format.title
  2661. X  *
  2662. X  #1 entry.max$ substring$
  2663. X  'sort.key$ :=
  2664. X}
  2665. X
  2666. XITERATE {presort}
  2667. X
  2668. XSORT
  2669. X
  2670. XSTRINGS { longest.label }
  2671. X
  2672. XINTEGERS { number.label longest.label.width }
  2673. X
  2674. XFUNCTION {initialize.longest.label}
  2675. X{ "" 'longest.label :=
  2676. X  #1 'number.label :=
  2677. X  #0 'longest.label.width :=
  2678. X}
  2679. X
  2680. XFUNCTION {longest.label.pass}
  2681. X{ number.label int.to.str$ 'label :=
  2682. X  number.label #1 + 'number.label :=
  2683. X  label width$ longest.label.width >
  2684. X    { label 'longest.label :=
  2685. X      label width$ 'longest.label.width :=
  2686. X    }
  2687. X    'skip$
  2688. X  if$
  2689. X}
  2690. X
  2691. XEXECUTE {initialize.longest.label}
  2692. X
  2693. XITERATE {longest.label.pass}
  2694. X
  2695. XFUNCTION {begin.bib}
  2696. X{ preamble$ empty$
  2697. X    'skip$
  2698. X    { preamble$ write$ newline$ }
  2699. X  if$
  2700. X  "\begin{thebibliography}{"  longest.label  * "}" * write$ newline$
  2701. X}
  2702. X
  2703. XEXECUTE {begin.bib}
  2704. X
  2705. XEXECUTE {init.state.consts}
  2706. X
  2707. XITERATE {call.type$}
  2708. X
  2709. XFUNCTION {end.bib}
  2710. X{ newline$
  2711. X  "\end{thebibliography}" write$ newline$
  2712. X}
  2713. X
  2714. XEXECUTE {end.bib}
  2715. END_OF_FILE
  2716.   if test 21104 -ne `wc -c <'plain.bst'`; then
  2717.     echo shar: \"'plain.bst'\" unpacked with wrong size!
  2718.   fi
  2719.   # end of 'plain.bst'
  2720. fi
  2721. echo shar: End of archive 1 \(of 3\).
  2722. cp /dev/null ark1isdone
  2723. MISSING=""
  2724. for I in 1 2 3 ; do
  2725.     if test ! -f ark${I}isdone ; then
  2726.     MISSING="${MISSING} ${I}"
  2727.     fi
  2728. done
  2729. if test "${MISSING}" = "" ; then
  2730.     echo You have unpacked all 3 archives.
  2731.     rm -f ark[1-9]isdone
  2732. else
  2733.     echo You still must unpack the following archives:
  2734.     echo "        " ${MISSING}
  2735. fi
  2736. exit 0
  2737. exit 0 # Just in case...
  2738.