home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / text / tex / 10871 < prev    next >
Encoding:
Internet Message Format  |  1992-09-03  |  67.8 KB

  1. Path: sparky!uunet!decwrl!bu.edu!dartvax!wildcat.dartmouth.edu!dfk
  2. From: dfk@wildcat.dartmouth.edu (David Kotz)
  3. Newsgroups: comp.text.tex
  4. Subject: some handy bibtex tools
  5. Summary: searching, printing, and exporting bibtex files
  6. Keywords: bibtex, shell script, printing bib files
  7. Message-ID: <1992Sep3.132414.2042@dartvax.dartmouth.edu>
  8. Date: 3 Sep 92 13:24:14 GMT
  9. Sender: news@dartvax.dartmouth.edu (The News Manager)
  10. Organization: Dartmouth College, Hanover, NH
  11. Lines: 3137
  12. Originator: dfk@wildcat.dartmouth.edu
  13.  
  14. September 3, 1992
  15.  
  16. This is a collection of BibTeX tools written (mostly) by David Kotz.
  17. I provide them as-is.  Use them as you please. Some slight
  18. modifications may be needed to pathnames embedded in the shell
  19. scripts, to find the library files they need (sed, awk, and bst
  20. files).
  21.  
  22. The programs are:
  23.        aux2bib - given an .aux file, make a portable .bib file to go
  24. with it. This is useful when you need to ship a tex file elsewhere
  25.  
  26.        bibify - this can be used to eliminate one pass of LaTeX in
  27. many cases: (latex, bibtex, bibify, latex), instead of (latex, bibtex,
  28. latex, latex). Handy for large documents. Does not work with multiple
  29. aux files.  
  30.  
  31.        bibkey - make a list of all entries that have the given
  32. keyword in their "keyword" field.
  33.  
  34.        cleantex - really a general tex script, this removes all the
  35. little files created by tex and latex as they run, leaving only the
  36. original files.
  37.  
  38.        looktex - makes a list of all entries that match a given regexp 
  39.  
  40.        makebib - makes an exportable .bib file from a given set of
  41. bib files and an optional list of citations. Handy for posting bib
  42. entries on the net! The portability comes from substituting @strings,
  43. and stripping "comment" fields if you like. Ignore the -d option.
  44.  
  45.        printbib - the most useful of all; this makes a dvi file from
  46. a .bib file for handy reference, sorted by cite key and including
  47. "keyword", "abstract", and "comment" fields.
  48.  
  49. See the shell scripts for more documentation.
  50. Otherwise you're on your own. Good luck.
  51.  
  52. David Kotz
  53. dfk@cs.dartmouth.edu
  54.  
  55. #!/bin/sh
  56. # This is a shell archive (shar 3.20)
  57. # made 09/03/1992 13:20 UTC by dfk@wildcat
  58. # Source directory /new/dfk/bib/bibtools
  59. #
  60. # existing files will NOT be overwritten
  61. # The unsharer will be INTERACTIVELY queried.
  62. #
  63. # This shar contains:
  64. # length  mode       name
  65. # ------ ---------- ------------------------------------------
  66. #   1536 -rw-r--r-- README
  67. #  23838 -rw-r--r-- abstract.bst
  68. #   1968 -rwxr-xr-x aux2bib
  69. #    644 -rwxr-xr-x bibify
  70. #   1469 -rwxr-xr-x bibkey
  71. #    740 -rw-r--r-- bibkey.awk
  72. #    751 -rw-r--r-- bibkey.sed
  73. #    468 -rwxr-xr-x cleantex
  74. #   1443 -rwxr-xr-x looktex
  75. #   1012 -rw-r--r-- looktex.awk
  76. #   1566 -rwxr-xr-x makebib
  77. #   1287 -rwxr-xr-x printbib
  78. #   5667 -rw-r--r-- subset-dfk.bst
  79. #   5473 -rw-r--r-- subset-nocomment.bst
  80. #   5442 -rw-r--r-- subset.bst
  81. #
  82. if touch 2>&1 | fgrep '[-amc]' > /dev/null
  83.  then TOUCH=touch
  84.  else TOUCH=true
  85. fi
  86. wish=
  87. # ============= README ==============
  88. if test X"$1" != X"-c" -a -f 'README'; then
  89.     case $wish in
  90.     A*|a*) echo x - overwriting 'README';;
  91.     *) echo "? - overwrite 'README' -- [No], [Y]es, [A]ll, [Q]uit? "
  92.         read wish;;
  93.     esac
  94.     case $wish in
  95.     Q*|q*) echo aborted; exit 86;;
  96.     A*|a*|Y*|y*) x=Y;;
  97.     *) x=N;;
  98.     esac
  99. else
  100.     x=Y
  101. fi
  102. if test $x != Y; then
  103.     echo x - skipping 'README'
  104. else
  105. echo "x - extracting README (Text)"
  106. sed 's/^X//' << 'SHAR_EOF' > README &&
  107. XSeptember 3, 1992
  108. X
  109. XThis is a collection of BibTeX tools written (mostly) by David Kotz.
  110. XI provide them as-is.  Use them as you please. Some slight
  111. Xmodifications may be needed to pathnames embedded in the shell
  112. Xscripts, to find the library files they need (sed, awk, and bst
  113. Xfiles).
  114. X
  115. XThe programs are:
  116. X       aux2bib - given an .aux file, make a portable .bib file to go
  117. Xwith it. This is useful when you need to ship a tex file elsewhere
  118. X
  119. X       bibify - this can be used to eliminate one pass of LaTeX in
  120. Xmany cases: (latex, bibtex, bibify, latex), instead of (latex, bibtex,
  121. Xlatex, latex). Handy for large documents. Does not work with multiple
  122. Xaux files.  
  123. X
  124. X       bibkey - make a list of all entries that have the given
  125. Xkeyword in their "keyword" field.
  126. X
  127. X       cleantex - really a general tex script, this removes all the
  128. Xlittle files created by tex and latex as they run, leaving only the
  129. Xoriginal files.
  130. X
  131. X       looktex - makes a list of all entries that match a given regexp 
  132. X
  133. X       makebib - makes an exportable .bib file from a given set of
  134. Xbib files and an optional list of citations. Handy for posting bib
  135. Xentries on the net! The portability comes from substituting @strings,
  136. Xand stripping "comment" fields if you like. Ignore the -d option.
  137. X
  138. X       printbib - the most useful of all; this makes a dvi file from
  139. Xa .bib file for handy reference, sorted by cite key and including
  140. X"keyword", "abstract", and "comment" fields.
  141. X
  142. XSee the shell scripts for more documentation.
  143. XOtherwise you're on your own. Good luck.
  144. X
  145. XDavid Kotz
  146. Xdfk@cs.dartmouth.edu
  147. X
  148. SHAR_EOF
  149. $TOUCH -am 0903091892 README &&
  150. chmod 0644 README ||
  151. echo "restore of README failed"
  152. set `wc -c README`;Wc_c=$1
  153. if test "$Wc_c" != "1536"; then
  154.     echo original size 1536, current size $Wc_c
  155. fi
  156. fi
  157. # ============= abstract.bst ==============
  158. if test X"$1" != X"-c" -a -f 'abstract.bst'; then
  159.     case $wish in
  160.     A*|a*) echo x - overwriting 'abstract.bst';;
  161.     *) echo "? - overwrite 'abstract.bst' -- [No], [Y]es, [A]ll, [Q]uit? "
  162.         read wish;;
  163.     esac
  164.     case $wish in
  165.     Q*|q*) echo aborted; exit 86;;
  166.     A*|a*|Y*|y*) x=Y;;
  167.     *) x=N;;
  168.     esac
  169. else
  170.     x=Y
  171. fi
  172. if test $x != Y; then
  173.     echo x - skipping 'abstract.bst'
  174. else
  175. echo "x - extracting abstract.bst (Text)"
  176. sed 's/^X//' << 'SHAR_EOF' > abstract.bst &&
  177. X% BibTeX bibliography style `abstract' 
  178. X% by David Kotz dfk@cs.duke.edu
  179. X% March 1989
  180. X%    modified from
  181. X% BibTeX standard bibliography style `alpha'
  182. X    % version 0.99a for BibTeX versions 0.99a or later, LaTeX version 2.09.
  183. X    % Copyright (C) 1985, all rights reserved.
  184. X    % Copying of this file is authorized only if either
  185. X    % (1) you make absolutely no changes to your copy, including name, or
  186. X    % (2) if you do make changes, you name it something other than
  187. X    % btxbst.doc, plain.bst, unsrt.bst, alpha.bst, and abbrv.bst.
  188. X    % This restriction helps ensure that all standard styles are identical.
  189. X    % The file btxbst.doc has the documentation for this style.
  190. X
  191. X% DFK added abstract, comment, keyword
  192. XENTRY
  193. X  { abstract
  194. X    address
  195. X    author
  196. X    booktitle
  197. X    chapter
  198. X    comment
  199. X    edition
  200. X    editor
  201. X    howpublished
  202. X    institution
  203. X    journal
  204. X    key
  205. X    keyword
  206. X    month
  207. X    note
  208. X    number
  209. X    organization
  210. X    pages
  211. X    publisher
  212. X    school
  213. X    series
  214. X    title
  215. X    type
  216. X    volume
  217. X    year
  218. X  }
  219. X  {}
  220. X  { label extra.label sort.label }
  221. X
  222. X% DFK added after.quote to signify end of something not needing period
  223. XINTEGERS { output.state before.all mid.sentence after.sentence after.block after.quote}
  224. X
  225. X% DFK added after.quote 
  226. XFUNCTION {init.state.consts}
  227. X{ #0 'before.all :=
  228. X  #1 'mid.sentence :=
  229. X  #2 'after.sentence :=
  230. X  #3 'after.block :=
  231. X  #4 'after.quote :=
  232. X}
  233. X
  234. XSTRINGS { s t }
  235. X
  236. X% DFK added after.quote handling so no period is printed after quotes
  237. XFUNCTION {output.nonnull}
  238. X{ 's :=
  239. X  output.state after.quote =
  240. X    { write$
  241. X      newline$
  242. X      "\newblock " write$
  243. X    }
  244. X  { output.state mid.sentence =
  245. X    { ", " * write$ }
  246. X    { output.state after.block =
  247. X    { add.period$ write$
  248. X      newline$
  249. X      "\newblock " write$
  250. X    }
  251. X    { output.state before.all =
  252. X         'write$
  253. X         { add.period$ " " * write$ }
  254. X        if$
  255. X    }
  256. X      if$
  257. X      mid.sentence 'output.state :=
  258. X    }
  259. X  if$
  260. X  }
  261. X  if$
  262. X  s
  263. X}
  264. X
  265. XFUNCTION {output}
  266. X{ duplicate$ empty$
  267. X    'pop$
  268. X    'output.nonnull
  269. X  if$
  270. X}
  271. X
  272. X% DFK added, variant of output
  273. XFUNCTION {output.quote}
  274. X{ duplicate$ empty$
  275. X    'pop$
  276. X    { output.nonnull 
  277. X     after.quote 'output.state :=}
  278. X  if$
  279. X}
  280. X
  281. XFUNCTION {output.check}
  282. X{ 't :=
  283. X  duplicate$ empty$
  284. X    { pop$ "empty " t * " in " * cite$ * warning$ }
  285. X    'output.nonnull
  286. X  if$
  287. X}
  288. X
  289. X% DFK changed to use cite$ for the label
  290. XFUNCTION {output.bibitem}
  291. X{ newline$
  292. X  "\bibitem[" write$
  293. X  cite$ write$
  294. X  "]{" write$
  295. X  cite$ write$
  296. X  "}" write$
  297. X  newline$
  298. X  ""
  299. X  before.all 'output.state :=
  300. X}
  301. X
  302. X% DFK changed to not put period when after.quote
  303. XFUNCTION {fin.entry}
  304. X{ output.state after.quote =
  305. X   'skip$
  306. X   'add.period$
  307. X  if$
  308. X  write$
  309. X  newline$
  310. X}
  311. X
  312. XFUNCTION {new.block}
  313. X{ output.state before.all =
  314. X    'skip$
  315. X    { after.block 'output.state := }
  316. X  if$
  317. X}
  318. X
  319. XFUNCTION {new.sentence}
  320. X{ output.state after.block =
  321. X    'skip$
  322. X    { output.state before.all =
  323. X    'skip$
  324. X    { after.sentence 'output.state := }
  325. X      if$
  326. X    }
  327. X  if$
  328. X}
  329. X
  330. XFUNCTION {not}
  331. X{   { #0 }
  332. X    { #1 }
  333. X  if$
  334. X}
  335. X
  336. XFUNCTION {and}
  337. X{   'skip$
  338. X    { pop$ #0 }
  339. X  if$
  340. X}
  341. X
  342. XFUNCTION {or}
  343. X{   { pop$ #1 }
  344. X    'skip$
  345. X  if$
  346. X}
  347. X
  348. XFUNCTION {new.block.checka}
  349. X{ empty$
  350. X    'skip$
  351. X    'new.block
  352. X  if$
  353. X}
  354. X
  355. XFUNCTION {new.block.checkb}
  356. X{ empty$
  357. X  swap$ empty$
  358. X  and
  359. X    'skip$
  360. X    'new.block
  361. X  if$
  362. X}
  363. X
  364. XFUNCTION {new.sentence.checka}
  365. X{ empty$
  366. X    'skip$
  367. X    'new.sentence
  368. X  if$
  369. X}
  370. X
  371. XFUNCTION {new.sentence.checkb}
  372. X{ empty$
  373. X  swap$ empty$
  374. X  and
  375. X    'skip$
  376. X    'new.sentence
  377. X  if$
  378. X}
  379. X
  380. XFUNCTION {field.or.null}
  381. X{ duplicate$ empty$
  382. X    { pop$ "" }
  383. X    'skip$
  384. X  if$
  385. X}
  386. X
  387. XFUNCTION {emphasize}
  388. X{ duplicate$ empty$
  389. X    { pop$ "" }
  390. X    { "{\em " swap$ * "}" * }
  391. X  if$
  392. X}
  393. X
  394. XINTEGERS { nameptr namesleft numnames }
  395. X
  396. XFUNCTION {format.names}
  397. X{ 's :=
  398. X  #1 'nameptr :=
  399. X  s num.names$ 'numnames :=
  400. X  numnames 'namesleft :=
  401. X    { namesleft #0 > }
  402. X    { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
  403. X      nameptr #1 >
  404. X    { namesleft #1 >
  405. X        { ", " * t * }
  406. X        { numnames #2 >
  407. X        { "," * }
  408. X        'skip$
  409. X          if$
  410. X          t "others" =
  411. X        { " et~al." * }
  412. X        { " and " * t * }
  413. X          if$
  414. X        }
  415. X      if$
  416. X    }
  417. X    't
  418. X      if$
  419. X      nameptr #1 + 'nameptr :=
  420. X      namesleft #1 - 'namesleft :=
  421. X    }
  422. X  while$
  423. X}
  424. X
  425. XFUNCTION {format.authors}
  426. X{ author empty$
  427. X    { "" }
  428. X    { author format.names }
  429. X  if$
  430. X}
  431. X
  432. XFUNCTION {format.editors}
  433. X{ editor empty$
  434. X    { "" }
  435. X    { editor format.names
  436. X      editor num.names$ #1 >
  437. X    { ", editors" * }
  438. X    { ", editor" * }
  439. X      if$
  440. X    }
  441. X  if$
  442. X}
  443. X
  444. XFUNCTION {format.title}
  445. X{ title empty$
  446. X    { "" }
  447. X    { title "t" change.case$ }
  448. X  if$
  449. X}
  450. X
  451. XFUNCTION {n.dashify}
  452. X{ 't :=
  453. X  ""
  454. X    { t empty$ not }
  455. X    { t #1 #1 substring$ "-" =
  456. X    { t #1 #2 substring$ "--" = not
  457. X        { "--" *
  458. X          t #2 global.max$ substring$ 't :=
  459. X        }
  460. X        {   { t #1 #1 substring$ "-" = }
  461. X        { "-" *
  462. X          t #2 global.max$ substring$ 't :=
  463. X        }
  464. X          while$
  465. X        }
  466. X      if$
  467. X    }
  468. X    { t #1 #1 substring$ *
  469. X      t #2 global.max$ substring$ 't :=
  470. X    }
  471. X      if$
  472. X    }
  473. X  while$
  474. X}
  475. X
  476. XFUNCTION {format.date}
  477. X{ year empty$
  478. X    { month empty$
  479. X    { "" }
  480. X    { "there's a month but no year in " cite$ * warning$
  481. X      month
  482. X    }
  483. X      if$
  484. X    }
  485. X    { month empty$
  486. X    'year
  487. X    { month " " * year * }
  488. X      if$
  489. X    }
  490. X  if$
  491. X}
  492. X
  493. XFUNCTION {format.btitle}
  494. X{ title emphasize
  495. X}
  496. X
  497. XFUNCTION {tie.or.space.connect}
  498. X{ duplicate$ text.length$ #3 <
  499. X    { "~" }
  500. X    { " " }
  501. X  if$
  502. X  swap$ * *
  503. X}
  504. X
  505. XFUNCTION {either.or.check}
  506. X{ empty$
  507. X    'pop$
  508. X    { "can't use both " swap$ * " fields in " * cite$ * warning$ }
  509. X  if$
  510. X}
  511. X
  512. XFUNCTION {format.bvolume}
  513. X{ volume empty$
  514. X    { "" }
  515. X    { "volume" volume tie.or.space.connect
  516. X      series empty$
  517. X    'skip$
  518. X    { " of " * series emphasize * }
  519. X      if$
  520. X      "volume and number" number either.or.check
  521. X    }
  522. X  if$
  523. X}
  524. X
  525. XFUNCTION {format.number.series}
  526. X{ volume empty$
  527. X    { number empty$
  528. X    { series field.or.null }
  529. X    { output.state mid.sentence =
  530. X        { "number" }
  531. X        { "Number" }
  532. X      if$
  533. X      number tie.or.space.connect
  534. X      series empty$
  535. X        { "there's a number but no series in " cite$ * warning$ }
  536. X        { " in " * series * }
  537. X      if$
  538. X    }
  539. X      if$
  540. X    }
  541. X    { "" }
  542. X  if$
  543. X}
  544. X
  545. XFUNCTION {format.edition}
  546. X{ edition empty$
  547. X    { "" }
  548. X    { output.state mid.sentence =
  549. X    { edition "l" change.case$ " edition" * }
  550. X    { edition "t" change.case$ " edition" * }
  551. X      if$
  552. X    }
  553. X  if$
  554. X}
  555. X
  556. XINTEGERS { multiresult }
  557. X
  558. XFUNCTION {multi.page.check}
  559. X{ 't :=
  560. X  #0 'multiresult :=
  561. X    { multiresult not
  562. X      t empty$ not
  563. X      and
  564. X    }
  565. X    { t #1 #1 substring$
  566. X      duplicate$ "-" =
  567. X      swap$ duplicate$ "," =
  568. X      swap$ "+" =
  569. X      or or
  570. X    { #1 'multiresult := }
  571. X    { t #2 global.max$ substring$ 't := }
  572. X      if$
  573. X    }
  574. X  while$
  575. X  multiresult
  576. X}
  577. X
  578. XFUNCTION {format.pages}
  579. X{ pages empty$
  580. X    { "" }
  581. X    { pages multi.page.check
  582. X    { "pages" pages n.dashify tie.or.space.connect }
  583. X    { "page" pages tie.or.space.connect }
  584. X      if$
  585. X    }
  586. X  if$
  587. X}
  588. X
  589. XFUNCTION {format.vol.num.pages}
  590. X{ volume field.or.null
  591. X  number empty$
  592. X    'skip$
  593. X    { "(" number * ")" * *
  594. X      volume empty$
  595. X    { "there's a number but no volume in " cite$ * warning$ }
  596. X    'skip$
  597. X      if$
  598. X    }
  599. X  if$
  600. X  pages empty$
  601. X    'skip$
  602. X    { duplicate$ empty$
  603. X    { pop$ format.pages }
  604. X    { ":" * pages n.dashify * }
  605. X      if$
  606. X    }
  607. X  if$
  608. X}
  609. X
  610. XFUNCTION {format.chapter.pages}
  611. X{ chapter empty$
  612. X    'format.pages
  613. X    { type empty$
  614. X    { "chapter" }
  615. X    { type "l" change.case$ }
  616. X      if$
  617. X      chapter tie.or.space.connect
  618. X      pages empty$
  619. X    'skip$
  620. X    { ", " * format.pages * }
  621. X      if$
  622. X    }
  623. X  if$
  624. X}
  625. X
  626. XFUNCTION {format.in.ed.booktitle}
  627. X{ booktitle empty$
  628. X    { "" }
  629. X    { editor empty$
  630. X    { "In " booktitle emphasize * }
  631. X    { "In " format.editors * ", " * booktitle emphasize * }
  632. X      if$
  633. X    }
  634. X  if$
  635. X}
  636. X
  637. XFUNCTION {empty.misc.check}
  638. X{ author empty$ title empty$ howpublished empty$
  639. X  month empty$ year empty$ note empty$
  640. X  and and and and and
  641. X  key empty$ not and
  642. X    { "all relevant fields are empty in " cite$ * warning$ }
  643. X    'skip$
  644. X  if$
  645. X}
  646. X
  647. XFUNCTION {format.thesis.type}
  648. X{ type empty$
  649. X    'skip$
  650. X    { pop$
  651. X      type "t" change.case$
  652. X    }
  653. X  if$
  654. X}
  655. X
  656. XFUNCTION {format.tr.number}
  657. X{ type empty$
  658. X    { "Technical Report" }
  659. X    'type
  660. X  if$
  661. X  number empty$
  662. X    { "t" change.case$ }
  663. X    { number tie.or.space.connect }
  664. X  if$
  665. X}
  666. X
  667. XFUNCTION {format.article.crossref}
  668. X{ key empty$
  669. X    { journal empty$
  670. X    { "need key or journal for " cite$ * " to crossref " * crossref *
  671. X      warning$
  672. X      ""
  673. X    }
  674. X    { "In {\em " journal * "\/}" * }
  675. X      if$
  676. X    }
  677. X    { "In " key * }
  678. X  if$
  679. X  " \cite{" * crossref * "}" *
  680. X}
  681. X
  682. XFUNCTION {format.crossref.editor}
  683. X{ editor #1 "{vv~}{ll}" format.name$
  684. X  editor num.names$ duplicate$
  685. X  #2 >
  686. X    { pop$ " et~al." * }
  687. X    { #2 <
  688. X    'skip$
  689. X    { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
  690. X        { " et~al." * }
  691. X        { " and " * editor #2 "{vv~}{ll}" format.name$ * }
  692. X      if$
  693. X    }
  694. X      if$
  695. X    }
  696. X  if$
  697. X}
  698. X
  699. XFUNCTION {format.book.crossref}
  700. X{ volume empty$
  701. X    { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
  702. X      "In "
  703. X    }
  704. X    { "Volume" volume tie.or.space.connect
  705. X      " of " *
  706. X    }
  707. X  if$
  708. X  editor empty$
  709. X  editor field.or.null author field.or.null =
  710. X  or
  711. X    { key empty$
  712. X    { series empty$
  713. X        { "need editor, key, or series for " cite$ * " to crossref " *
  714. X          crossref * warning$
  715. X          "" *
  716. X        }
  717. X        { "{\em " * series * "\/}" * }
  718. X      if$
  719. X    }
  720. X    { key * }
  721. X      if$
  722. X    }
  723. X    { format.crossref.editor * }
  724. X  if$
  725. X  " \cite{" * crossref * "}" *
  726. X}
  727. X
  728. XFUNCTION {format.incoll.inproc.crossref}
  729. X{ editor empty$
  730. X  editor field.or.null author field.or.null =
  731. X  or
  732. X    { key empty$
  733. X    { booktitle empty$
  734. X        { "need editor, key, or booktitle for " cite$ * " to crossref " *
  735. X          crossref * warning$
  736. X          ""
  737. X        }
  738. X        { "In {\em " booktitle * "\/}" * }
  739. X      if$
  740. X    }
  741. X    { "In " key * }
  742. X      if$
  743. X    }
  744. X    { "In " format.crossref.editor * }
  745. X  if$
  746. X  " \cite{" * crossref * "}" *
  747. X}
  748. X
  749. X% DFK added
  750. XFUNCTION {format.abstract}
  751. X{ abstract empty$
  752. X    { "" }
  753. X    { "\begin{quote} {\bf Abstract:} " abstract * " \end{quote}" *}
  754. X  if$
  755. X}
  756. X
  757. X% DFK added
  758. XFUNCTION {format.keyword}
  759. X{ keyword empty$
  760. X    { "" }
  761. X    { "\begin{quote} {\bf Keyword:} " keyword * " \end{quote}" *}
  762. X  if$
  763. X}
  764. X
  765. X% DFK added
  766. XFUNCTION {format.comment}
  767. X{ comment empty$
  768. X    { "" }
  769. X    { "\begin{quote} {\bf Comment:} " comment * " \end{quote}" *}
  770. X  if$
  771. X}
  772. X
  773. X% DFK added
  774. XFUNCTION {dfk.stuff}
  775. X{ new.block
  776. X  format.abstract output.quote
  777. X%  new.block
  778. X  format.keyword output.quote
  779. X%  new.block
  780. X  format.comment output.quote
  781. X}
  782. X
  783. X% DFK: added a call to dfk.stuff in all entry-type functions below
  784. X
  785. XFUNCTION {article}
  786. X{ output.bibitem
  787. X  format.authors "author" output.check
  788. X  new.block
  789. X  format.title "title" output.check
  790. X  new.block
  791. X  crossref missing$
  792. X    { journal emphasize "journal" output.check
  793. X      format.vol.num.pages output
  794. X      format.date "year" output.check
  795. X    }
  796. X    { format.article.crossref output.nonnull
  797. X      format.pages output
  798. X    }
  799. X  if$
  800. X  new.block
  801. X  note output
  802. X  dfk.stuff
  803. X  fin.entry
  804. X}
  805. X
  806. XFUNCTION {book}
  807. X{ output.bibitem
  808. X  author empty$
  809. X    { format.editors "author and editor" output.check }
  810. X    { format.authors output.nonnull
  811. X      crossref missing$
  812. X    { "author and editor" editor either.or.check }
  813. X    'skip$
  814. X      if$
  815. X    }
  816. X  if$
  817. X  new.block
  818. X  format.btitle "title" output.check
  819. X  crossref missing$
  820. X    { format.bvolume output
  821. X      new.block
  822. X      format.number.series output
  823. X      new.sentence
  824. X      publisher "publisher" output.check
  825. X      address output
  826. X    }
  827. X    { new.block
  828. X      format.book.crossref output.nonnull
  829. X    }
  830. X  if$
  831. X  format.edition output
  832. X  format.date "year" output.check
  833. X  new.block
  834. X  note output
  835. X  dfk.stuff
  836. X  fin.entry
  837. X}
  838. X
  839. XFUNCTION {booklet}
  840. X{ output.bibitem
  841. X  format.authors output
  842. X  new.block
  843. X  format.title "title" output.check
  844. X  howpublished address new.block.checkb
  845. X  howpublished output
  846. X  address output
  847. X  format.date output
  848. X  new.block
  849. X  note output
  850. X  dfk.stuff
  851. X  fin.entry
  852. X}
  853. X
  854. XFUNCTION {inbook}
  855. X{ output.bibitem
  856. X  author empty$
  857. X    { format.editors "author and editor" output.check }
  858. X    { format.authors output.nonnull
  859. X      crossref missing$
  860. X    { "author and editor" editor either.or.check }
  861. X    'skip$
  862. X      if$
  863. X    }
  864. X  if$
  865. X  new.block
  866. X  format.btitle "title" output.check
  867. X  crossref missing$
  868. X    { format.bvolume output
  869. X      format.chapter.pages "chapter and pages" output.check
  870. X      new.block
  871. X      format.number.series output
  872. X      new.sentence
  873. X      publisher "publisher" output.check
  874. X      address output
  875. X    }
  876. X    { format.chapter.pages "chapter and pages" output.check
  877. X      new.block
  878. X      format.book.crossref output.nonnull
  879. X    }
  880. X  if$
  881. X  format.edition output
  882. X  format.date "year" output.check
  883. X  new.block
  884. X  note output
  885. X  dfk.stuff
  886. X  fin.entry
  887. X}
  888. X
  889. XFUNCTION {incollection}
  890. X{ output.bibitem
  891. X  format.authors "author" output.check
  892. X  new.block
  893. X  format.title "title" output.check
  894. X  new.block
  895. X  crossref missing$
  896. X    { format.in.ed.booktitle "booktitle" output.check
  897. X      format.bvolume output
  898. X      format.number.series output
  899. X      format.chapter.pages output
  900. X      new.sentence
  901. X      publisher "publisher" output.check
  902. X      address output
  903. X      format.edition output
  904. X      format.date "year" output.check
  905. X    }
  906. X    { format.incoll.inproc.crossref output.nonnull
  907. X      format.chapter.pages output
  908. X    }
  909. X  if$
  910. X  new.block
  911. X  note output
  912. X  dfk.stuff
  913. X  fin.entry
  914. X}
  915. X
  916. XFUNCTION {inproceedings}
  917. X{ output.bibitem
  918. X  format.authors "author" output.check
  919. X  new.block
  920. X  format.title "title" output.check
  921. X  new.block
  922. X  crossref missing$
  923. X    { format.in.ed.booktitle "booktitle" output.check
  924. X      format.bvolume output
  925. X      format.number.series output
  926. X      format.pages output
  927. X      address empty$
  928. X    { organization publisher new.sentence.checkb
  929. X      organization output
  930. X      publisher output
  931. X      format.date "year" output.check
  932. X    }
  933. X    { address output.nonnull
  934. X      format.date "year" output.check
  935. X      new.sentence
  936. X      organization output
  937. X      publisher output
  938. X    }
  939. X      if$
  940. X    }
  941. X    { format.incoll.inproc.crossref output.nonnull
  942. X      format.pages output
  943. X    }
  944. X  if$
  945. X  new.block
  946. X  note output
  947. X  dfk.stuff
  948. X  fin.entry
  949. X}
  950. X
  951. XFUNCTION {conference} { inproceedings }
  952. X
  953. XFUNCTION {manual}
  954. X{ output.bibitem
  955. X  author empty$
  956. X    { organization empty$
  957. X    'skip$
  958. X    { organization output.nonnull
  959. X      address output
  960. X    }
  961. X      if$
  962. X    }
  963. X    { format.authors output.nonnull }
  964. X  if$
  965. X  new.block
  966. X  format.btitle "title" output.check
  967. X  author empty$
  968. X    { organization empty$
  969. X    { address new.block.checka
  970. X      address output
  971. X    }
  972. X    'skip$
  973. X      if$
  974. X    }
  975. X    { organization address new.block.checkb
  976. X      organization output
  977. X      address output
  978. X    }
  979. X  if$
  980. X  format.edition output
  981. X  format.date output
  982. X  new.block
  983. X  note output
  984. X  dfk.stuff
  985. X  fin.entry
  986. X}
  987. X
  988. XFUNCTION {mastersthesis}
  989. X{ output.bibitem
  990. X  format.authors "author" output.check
  991. X  new.block
  992. X  format.title "title" output.check
  993. X  new.block
  994. X  "Master's thesis" format.thesis.type output.nonnull
  995. X  school "school" output.check
  996. X  address output
  997. X  format.date "year" output.check
  998. X  new.block
  999. X  note output
  1000. X  dfk.stuff
  1001. X  fin.entry
  1002. X}
  1003. X
  1004. XFUNCTION {misc}
  1005. X{ output.bibitem
  1006. X  format.authors output
  1007. X  title howpublished new.block.checkb
  1008. X  format.title output
  1009. X  howpublished new.block.checka
  1010. X  howpublished output
  1011. X  format.date output
  1012. X  new.block
  1013. X  note output
  1014. X  dfk.stuff
  1015. X  fin.entry
  1016. X  empty.misc.check
  1017. X}
  1018. X
  1019. XFUNCTION {phdthesis}
  1020. X{ output.bibitem
  1021. X  format.authors "author" output.check
  1022. X  new.block
  1023. X  format.btitle "title" output.check
  1024. X  new.block
  1025. X  "PhD thesis" format.thesis.type output.nonnull
  1026. X  school "school" output.check
  1027. X  address output
  1028. X  format.date "year" output.check
  1029. X  new.block
  1030. X  note output
  1031. X  dfk.stuff
  1032. X  fin.entry
  1033. X}
  1034. X
  1035. XFUNCTION {proceedings}
  1036. X{ output.bibitem
  1037. X  editor empty$
  1038. X    { organization output }
  1039. X    { format.editors output.nonnull }
  1040. X  if$
  1041. X  new.block
  1042. X  format.btitle "title" output.check
  1043. X  format.bvolume output
  1044. X  format.number.series output
  1045. X  address empty$
  1046. X    { editor empty$
  1047. X    { publisher new.sentence.checka }
  1048. X    { organization publisher new.sentence.checkb
  1049. X      organization output
  1050. X    }
  1051. X      if$
  1052. X      publisher output
  1053. X      format.date "year" output.check
  1054. X    }
  1055. X    { address output.nonnull
  1056. X      format.date "year" output.check
  1057. X      new.sentence
  1058. X      editor empty$
  1059. X    'skip$
  1060. X    { organization output }
  1061. X      if$
  1062. X      publisher output
  1063. X    }
  1064. X  if$
  1065. X  new.block
  1066. X  note output
  1067. X  dfk.stuff
  1068. X  fin.entry
  1069. X}
  1070. X
  1071. XFUNCTION {techreport}
  1072. X{ output.bibitem
  1073. X  format.authors "author" output.check
  1074. X  new.block
  1075. X  format.title "title" output.check
  1076. X  new.block
  1077. X  format.tr.number output.nonnull
  1078. X  institution "institution" output.check
  1079. X  address output
  1080. X  format.date "year" output.check
  1081. X  new.block
  1082. X  note output
  1083. X  dfk.stuff
  1084. X  fin.entry
  1085. X}
  1086. X
  1087. XFUNCTION {unpublished}
  1088. X{ output.bibitem
  1089. X  format.authors "author" output.check
  1090. X  new.block
  1091. X  format.title "title" output.check
  1092. X  new.block
  1093. X  note "note" output.check
  1094. X  format.date output
  1095. X  dfk.stuff
  1096. X  fin.entry
  1097. X}
  1098. X
  1099. XFUNCTION {default.type} { misc }
  1100. X
  1101. XMACRO {jan} {"January"}
  1102. X
  1103. XMACRO {feb} {"February"}
  1104. X
  1105. XMACRO {mar} {"March"}
  1106. X
  1107. XMACRO {apr} {"April"}
  1108. X
  1109. XMACRO {may} {"May"}
  1110. X
  1111. XMACRO {jun} {"June"}
  1112. X
  1113. XMACRO {jul} {"July"}
  1114. X
  1115. XMACRO {aug} {"August"}
  1116. X
  1117. XMACRO {sep} {"September"}
  1118. X
  1119. XMACRO {oct} {"October"}
  1120. X
  1121. XMACRO {nov} {"November"}
  1122. X
  1123. XMACRO {dec} {"December"}
  1124. X
  1125. XMACRO {acmcs} {"ACM Computing Surveys"}
  1126. X
  1127. XMACRO {acta} {"Acta Informatica"}
  1128. X
  1129. XMACRO {cacm} {"Communications of the ACM"}
  1130. X
  1131. XMACRO {ibmjrd} {"IBM Journal of Research and Development"}
  1132. X
  1133. XMACRO {ibmsj} {"IBM Systems Journal"}
  1134. X
  1135. XMACRO {ieeese} {"IEEE Transactions on Software Engineering"}
  1136. X
  1137. XMACRO {ieeetc} {"IEEE Transactions on Computers"}
  1138. X
  1139. XMACRO {ieeetcad}
  1140. X {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
  1141. X
  1142. XMACRO {ipl} {"Information Processing Letters"}
  1143. X
  1144. XMACRO {jacm} {"Journal of the ACM"}
  1145. X
  1146. XMACRO {jcss} {"Journal of Computer and System Sciences"}
  1147. X
  1148. XMACRO {scp} {"Science of Computer Programming"}
  1149. X
  1150. XMACRO {sicomp} {"SIAM Journal on Computing"}
  1151. X
  1152. XMACRO {tocs} {"ACM Transactions on Computer Systems"}
  1153. X
  1154. XMACRO {tods} {"ACM Transactions on Database Systems"}
  1155. X
  1156. XMACRO {tog} {"ACM Transactions on Graphics"}
  1157. X
  1158. XMACRO {toms} {"ACM Transactions on Mathematical Software"}
  1159. X
  1160. XMACRO {toois} {"ACM Transactions on Office Information Systems"}
  1161. X
  1162. XMACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
  1163. X
  1164. XMACRO {tcs} {"Theoretical Computer Science"}
  1165. X
  1166. XREAD
  1167. X
  1168. XFUNCTION {sortify}
  1169. X{ purify$
  1170. X  "l" change.case$
  1171. X}
  1172. X
  1173. XINTEGERS { len }
  1174. X
  1175. XFUNCTION {chop.word}
  1176. X{ 's :=
  1177. X  'len :=
  1178. X  s #1 len substring$ =
  1179. X    { s len #1 + global.max$ substring$ }
  1180. X    's
  1181. X  if$
  1182. X}
  1183. X
  1184. XINTEGERS { et.al.char.used }
  1185. X
  1186. XFUNCTION {initialize.et.al.char.used}
  1187. X{ #0 'et.al.char.used :=
  1188. X}
  1189. X
  1190. XEXECUTE {initialize.et.al.char.used}
  1191. X
  1192. XFUNCTION {format.lab.names}
  1193. X{ 's :=
  1194. X  s num.names$ 'numnames :=
  1195. X  numnames #1 >
  1196. X    { numnames #4 >
  1197. X    { #3 'namesleft := }
  1198. X    { numnames 'namesleft := }
  1199. X      if$
  1200. X      #1 'nameptr :=
  1201. X      ""
  1202. X    { namesleft #0 > }
  1203. X    { nameptr numnames =
  1204. X        { s nameptr "{ff }{vv }{ll}{ jj}" format.name$ "others" =
  1205. X        { "{\etalchar{+}}" *
  1206. X          #1 'et.al.char.used :=
  1207. X        }
  1208. X        { s nameptr "{v{}}{l{}}" format.name$ * }
  1209. X          if$
  1210. X        }
  1211. X        { s nameptr "{v{}}{l{}}" format.name$ * }
  1212. X      if$
  1213. X      nameptr #1 + 'nameptr :=
  1214. X      namesleft #1 - 'namesleft :=
  1215. X    }
  1216. X      while$
  1217. X      numnames #4 >
  1218. X    { "{\etalchar{+}}" *
  1219. X      #1 'et.al.char.used :=
  1220. X    }
  1221. X    'skip$
  1222. X      if$
  1223. X    }
  1224. X    { s #1 "{v{}}{l{}}" format.name$
  1225. X      duplicate$ text.length$ #2 <
  1226. X    { pop$ s #1 "{ll}" format.name$ #3 text.prefix$ }
  1227. X    'skip$
  1228. X      if$
  1229. X    }
  1230. X  if$
  1231. X}
  1232. X
  1233. XFUNCTION {author.key.label}
  1234. X{ author empty$
  1235. X    { key empty$
  1236. X    { cite$ #1 #3 substring$ }
  1237. X    { key #3 text.prefix$ }
  1238. X      if$
  1239. X    }
  1240. X    { author format.lab.names }
  1241. X  if$
  1242. X}
  1243. X
  1244. XFUNCTION {author.editor.key.label}
  1245. X{ author empty$
  1246. X    { editor empty$
  1247. X    { key empty$
  1248. X        { cite$ #1 #3 substring$ }
  1249. X        { key #3 text.prefix$ }
  1250. X      if$
  1251. X    }
  1252. X    { editor format.lab.names }
  1253. X      if$
  1254. X    }
  1255. X    { author format.lab.names }
  1256. X  if$
  1257. X}
  1258. X
  1259. XFUNCTION {author.key.organization.label}
  1260. X{ author empty$
  1261. X    { key empty$
  1262. X    { organization empty$
  1263. X        { cite$ #1 #3 substring$ }
  1264. X        { "The " #4 organization chop.word #3 text.prefix$ }
  1265. X      if$
  1266. X    }
  1267. X    { key #3 text.prefix$ }
  1268. X      if$
  1269. X    }
  1270. X    { author format.lab.names }
  1271. X  if$
  1272. X}
  1273. X
  1274. XFUNCTION {editor.key.organization.label}
  1275. X{ editor empty$
  1276. X    { key empty$
  1277. X    { organization empty$
  1278. X        { cite$ #1 #3 substring$ }
  1279. X        { "The " #4 organization chop.word #3 text.prefix$ }
  1280. X      if$
  1281. X    }
  1282. X    { key #3 text.prefix$ }
  1283. X      if$
  1284. X    }
  1285. X    { editor format.lab.names }
  1286. X  if$
  1287. X}
  1288. X
  1289. XFUNCTION {calc.label}
  1290. X{ type$ "book" =
  1291. X  type$ "inbook" =
  1292. X  or
  1293. X    'author.editor.key.label
  1294. X    { type$ "proceedings" =
  1295. X    'editor.key.organization.label
  1296. X    { type$ "manual" =
  1297. X        'author.key.organization.label
  1298. X        'author.key.label
  1299. X      if$
  1300. X    }
  1301. X      if$
  1302. X    }
  1303. X  if$
  1304. X  duplicate$
  1305. X  year field.or.null purify$ #-1 #2 substring$
  1306. X  *
  1307. X  'label :=
  1308. X  year field.or.null purify$ #-1 #4 substring$
  1309. X  *
  1310. X  sortify 'sort.label :=
  1311. X}
  1312. X
  1313. XFUNCTION {sort.format.names}
  1314. X{ 's :=
  1315. X  #1 'nameptr :=
  1316. X  ""
  1317. X  s num.names$ 'numnames :=
  1318. X  numnames 'namesleft :=
  1319. X    { namesleft #0 > }
  1320. X    { nameptr #1 >
  1321. X    { "   " * }
  1322. X    'skip$
  1323. X      if$
  1324. X      s nameptr "{vv{ } }{ll{ }}{  ff{ }}{  jj{ }}" format.name$ 't :=
  1325. X      nameptr numnames = t "others" = and
  1326. X    { "et al" * }
  1327. X    { t sortify * }
  1328. X      if$
  1329. X      nameptr #1 + 'nameptr :=
  1330. X      namesleft #1 - 'namesleft :=
  1331. X    }
  1332. X  while$
  1333. X}
  1334. X
  1335. XFUNCTION {sort.format.title}
  1336. X{ 't :=
  1337. X  "A " #2
  1338. X    "An " #3
  1339. X      "The " #4 t chop.word
  1340. X    chop.word
  1341. X  chop.word
  1342. X  sortify
  1343. X  #1 global.max$ substring$
  1344. X}
  1345. X
  1346. XFUNCTION {author.sort}
  1347. X{ author empty$
  1348. X    { key empty$
  1349. X    { "to sort, need author or key in " cite$ * warning$
  1350. X      ""
  1351. X    }
  1352. X    { key sortify }
  1353. X      if$
  1354. X    }
  1355. X    { author sort.format.names }
  1356. X  if$
  1357. X}
  1358. X
  1359. XFUNCTION {author.editor.sort}
  1360. X{ author empty$
  1361. X    { editor empty$
  1362. X    { key empty$
  1363. X        { "to sort, need author, editor, or key in " cite$ * warning$
  1364. X          ""
  1365. X        }
  1366. X        { key sortify }
  1367. X      if$
  1368. X    }
  1369. X    { editor sort.format.names }
  1370. X      if$
  1371. X    }
  1372. X    { author sort.format.names }
  1373. X  if$
  1374. X}
  1375. X
  1376. XFUNCTION {author.organization.sort}
  1377. X{ author empty$
  1378. X    { organization empty$
  1379. X    { key empty$
  1380. X        { "to sort, need author, organization, or key in " cite$ * warning$
  1381. X          ""
  1382. X        }
  1383. X        { key sortify }
  1384. X      if$
  1385. X    }
  1386. X    { "The " #4 organization chop.word sortify }
  1387. X      if$
  1388. X    }
  1389. X    { author sort.format.names }
  1390. X  if$
  1391. X}
  1392. X
  1393. XFUNCTION {editor.organization.sort}
  1394. X{ editor empty$
  1395. X    { organization empty$
  1396. X    { key empty$
  1397. X        { "to sort, need editor, organization, or key in " cite$ * warning$
  1398. X          ""
  1399. X        }
  1400. X        { key sortify }
  1401. X      if$
  1402. X    }
  1403. X    { "The " #4 organization chop.word sortify }
  1404. X      if$
  1405. X    }
  1406. X    { editor sort.format.names }
  1407. X  if$
  1408. X}
  1409. X
  1410. XFUNCTION {presort}
  1411. X{ calc.label
  1412. X  sort.label
  1413. X  "    "
  1414. X  *
  1415. X  type$ "book" =
  1416. X  type$ "inbook" =
  1417. X  or
  1418. X    'author.editor.sort
  1419. X    { type$ "proceedings" =
  1420. X    'editor.organization.sort
  1421. X    { type$ "manual" =
  1422. X        'author.organization.sort
  1423. X        'author.sort
  1424. X      if$
  1425. X    }
  1426. X      if$
  1427. X    }
  1428. X  if$
  1429. X  *
  1430. X  "    "
  1431. X  *
  1432. X  year field.or.null sortify
  1433. X  *
  1434. X  "    "
  1435. X  *
  1436. X  title field.or.null
  1437. X  sort.format.title
  1438. X  *
  1439. X% DFK throw away stuff above and use cite$ for sort key
  1440. X  pop$
  1441. X  cite$
  1442. X  #1 entry.max$ substring$
  1443. X  'sort.key$ :=
  1444. X}
  1445. X
  1446. XITERATE {presort}
  1447. X
  1448. XSORT
  1449. X
  1450. XSTRINGS { longest.label last.sort.label next.extra }
  1451. X
  1452. XINTEGERS { longest.label.width last.extra.num }
  1453. X
  1454. XFUNCTION {initialize.longest.label}
  1455. X{ "" 'longest.label :=
  1456. X  #0 int.to.chr$ 'last.sort.label :=
  1457. X  "" 'next.extra :=
  1458. X  #0 'longest.label.width :=
  1459. X  #0 'last.extra.num :=
  1460. X}
  1461. X
  1462. XFUNCTION {forward.pass}
  1463. X{ last.sort.label sort.label =
  1464. X    { last.extra.num #1 + 'last.extra.num :=
  1465. X      last.extra.num int.to.chr$ 'extra.label :=
  1466. X    }
  1467. X    { "a" chr.to.int$ 'last.extra.num :=
  1468. X      "" 'extra.label :=
  1469. X      sort.label 'last.sort.label :=
  1470. X    }
  1471. X  if$
  1472. X}
  1473. X
  1474. XFUNCTION {reverse.pass}
  1475. X{ next.extra "b" =
  1476. X    { "a" 'extra.label := }
  1477. X    'skip$
  1478. X  if$
  1479. X  label extra.label * 'label :=
  1480. X  label width$ longest.label.width >
  1481. X    { label 'longest.label :=
  1482. X      label width$ 'longest.label.width :=
  1483. X    }
  1484. X    'skip$
  1485. X  if$
  1486. X  extra.label 'next.extra :=
  1487. X}
  1488. X
  1489. XEXECUTE {initialize.longest.label}
  1490. X
  1491. XITERATE {forward.pass}
  1492. X
  1493. XREVERSE {reverse.pass}
  1494. X
  1495. XFUNCTION {begin.bib}
  1496. X{ et.al.char.used
  1497. X    { "\newcommand{\etalchar}[1]{$^{#1}$}" write$ newline$ }
  1498. X    'skip$
  1499. X  if$
  1500. X  preamble$ empty$
  1501. X    'skip$
  1502. X    { preamble$ write$ newline$ }
  1503. X  if$
  1504. X  "\begin{thebibliography}{"  longest.label  * "}" * write$ newline$
  1505. X}
  1506. X
  1507. XEXECUTE {begin.bib}
  1508. X
  1509. XEXECUTE {init.state.consts}
  1510. X
  1511. XITERATE {call.type$}
  1512. X
  1513. XFUNCTION {end.bib}
  1514. X{ newline$
  1515. X  "\end{thebibliography}" write$ newline$
  1516. X}
  1517. X
  1518. XEXECUTE {end.bib}
  1519. SHAR_EOF
  1520. $TOUCH -am 0801230992 abstract.bst &&
  1521. chmod 0644 abstract.bst ||
  1522. echo "restore of abstract.bst failed"
  1523. set `wc -c abstract.bst`;Wc_c=$1
  1524. if test "$Wc_c" != "23838"; then
  1525.     echo original size 23838, current size $Wc_c
  1526. fi
  1527. fi
  1528. # ============= aux2bib ==============
  1529. if test X"$1" != X"-c" -a -f 'aux2bib'; then
  1530.     case $wish in
  1531.     A*|a*) echo x - overwriting 'aux2bib';;
  1532.     *) echo "? - overwrite 'aux2bib' -- [No], [Y]es, [A]ll, [Q]uit? "
  1533.         read wish;;
  1534.     esac
  1535.     case $wish in
  1536.     Q*|q*) echo aborted; exit 86;;
  1537.     A*|a*|Y*|y*) x=Y;;
  1538.     *) x=N;;
  1539.     esac
  1540. else
  1541.     x=Y
  1542. fi
  1543. if test $x != Y; then
  1544.     echo x - skipping 'aux2bib'
  1545. else
  1546. echo "x - extracting aux2bib (Text)"
  1547. sed 's/^X//' << 'SHAR_EOF' > aux2bib &&
  1548. X#!/usr/local/bin/perl -s
  1549. X#
  1550. X# take a latex AUX file and change the bibstyle to subset or subset-nocomment
  1551. X# depending on if the -c flag was given (-c means use comments), then rename
  1552. X# the modified file to references.aux, run bibtex on it, rename the file
  1553. X# references.bbl to references.bib and delete references.{aux,blg}.  This
  1554. X# results in a BibTeX file which can be shipped with the latex source of the
  1555. X# paper.  The \bibliography{} command in the latex file will need to be changed
  1556. X# to use the newly generated bibliography.
  1557. X#
  1558. X# assumes subset.bst and subset-nocomment.bst are in the input path
  1559. X#
  1560. X# V. Khera    07-AUG-1992
  1561. X# khera@cs.duke.edu
  1562. X
  1563. X$tmpfile = "refs$$";
  1564. X$outfile = "references.bib";
  1565. X
  1566. X$SIG{'INT'} = 'handler';
  1567. X$SIG{'QUIT'} = 'handler';
  1568. X$SIG{'TERM'} = 'handler';
  1569. X$| = 1;                # make sure output is flushed after print.
  1570. X
  1571. Xsub handler {
  1572. X  local($sig) = @_;
  1573. X  print "Got a SIG$sig -- cleaning up\n";
  1574. X  &cleanup;
  1575. X  exit 1;
  1576. X}
  1577. X
  1578. Xsub cleanup {
  1579. X  unlink <$tmpfile.*>;
  1580. X}
  1581. X
  1582. X$bibstyle = defined($c) ? "subset" : "subset-nocomment";
  1583. X
  1584. Xdie "usage: $0 [-c] <auxfile>\n" unless $#ARGV == 0;
  1585. X
  1586. X$infile = shift;
  1587. X
  1588. X# canonicalize the name to end i .aux. assumes file is in current directory,
  1589. X# even though a path may have been specified.  tough noogies, i say!
  1590. X$infile =~ s#(.*/)?([^.]*).*#\2.aux#;
  1591. X
  1592. Xdie "No such file $infile\n" unless -f $infile;
  1593. X
  1594. Xopen(INF,$infile) || die "Cannot read $infile\n";
  1595. X@auxdata = <INF>;        # slurp the whole file in
  1596. Xclose(INF);
  1597. X
  1598. X# create a new AUX file with subset bibstyle specified.
  1599. X@result = grep(m/(\\citation|\\bibdata).*/ , @auxdata);
  1600. Xdie "No citations or data files specified in $infile\n" unless @result;
  1601. Xpush(@result,"\\bibstyle{$bibstyle}\n");
  1602. X
  1603. Xopen (OUTF,">$tmpfile.aux") || die "Cannot create temp file\n";
  1604. Xprint OUTF @result;
  1605. Xclose(OUTF);
  1606. X
  1607. Xprint "Running bibtex...\n";
  1608. X
  1609. X$result = system "bibtex $tmpfile";
  1610. Xdie "Error running bibtex\n" unless ($result >> 8) == 0;
  1611. Xrename ("$tmpfile.bbl", $outfile);
  1612. X
  1613. Xprint "Output is in $outfile\n";
  1614. X
  1615. X&cleanup;
  1616. SHAR_EOF
  1617. $TOUCH -am 0811124692 aux2bib &&
  1618. chmod 0755 aux2bib ||
  1619. echo "restore of aux2bib failed"
  1620. set `wc -c aux2bib`;Wc_c=$1
  1621. if test "$Wc_c" != "1968"; then
  1622.     echo original size 1968, current size $Wc_c
  1623. fi
  1624. fi
  1625. # ============= bibify ==============
  1626. if test X"$1" != X"-c" -a -f 'bibify'; then
  1627.     case $wish in
  1628.     A*|a*) echo x - overwriting 'bibify';;
  1629.     *) echo "? - overwrite 'bibify' -- [No], [Y]es, [A]ll, [Q]uit? "
  1630.         read wish;;
  1631.     esac
  1632.     case $wish in
  1633.     Q*|q*) echo aborted; exit 86;;
  1634.     A*|a*|Y*|y*) x=Y;;
  1635.     *) x=N;;
  1636.     esac
  1637. else
  1638.     x=Y
  1639. fi
  1640. if test $x != Y; then
  1641.     echo x - skipping 'bibify'
  1642. else
  1643. echo "x - extracting bibify (Text)"
  1644. sed 's/^X//' << 'SHAR_EOF' > bibify &&
  1645. X#!/bin/csh -f
  1646. X
  1647. Xif ($1 !~ *.aux) then
  1648. X    set input=$1.aux
  1649. X    set bbl = $1.bbl
  1650. Xelse
  1651. X    set input=$1
  1652. X    set bbl=$1:r.bbl
  1653. Xendif
  1654. X
  1655. Xset file=/tmp/bibify$$
  1656. Xonintr clean
  1657. X
  1658. Xcat $input > $file
  1659. X
  1660. Xset style=`sed -n 's/\\bibstyle{\(.*\)}/\1/p' $input`
  1661. X
  1662. Xswitch($style)
  1663. Xcase "alpha":
  1664. Xcase "/u/dfk/lib/abstract":
  1665. X cat $bbl | sed -n 's/bibitem\[\(.*\)\]{\(.*\)}/bibcite{\2}{\1}/p' >> $file
  1666. X breaksw
  1667. Xcase "plain":
  1668. Xcase "unsrt":
  1669. Xcase "abbrv":
  1670. X cat $bbl | sed -n 's/bibitem/bibcite/p'| awk '{print $1"{"NR"}"}' >> $file
  1671. X breaksw
  1672. Xdefault:
  1673. X echo unknown bibliography style, cannot bibify.
  1674. X goto clean
  1675. Xendsw
  1676. X
  1677. Xmv $file $input
  1678. X
  1679. Xclean:
  1680. X/bin/rm -f $file.* >& /dev/null
  1681. X
  1682. SHAR_EOF
  1683. $TOUCH -am 0517131290 bibify &&
  1684. chmod 0755 bibify ||
  1685. echo "restore of bibify failed"
  1686. set `wc -c bibify`;Wc_c=$1
  1687. if test "$Wc_c" != "644"; then
  1688.     echo original size 644, current size $Wc_c
  1689. fi
  1690. fi
  1691. # ============= bibkey ==============
  1692. if test X"$1" != X"-c" -a -f 'bibkey'; then
  1693.     case $wish in
  1694.     A*|a*) echo x - overwriting 'bibkey';;
  1695.     *) echo "? - overwrite 'bibkey' -- [No], [Y]es, [A]ll, [Q]uit? "
  1696.         read wish;;
  1697.     esac
  1698.     case $wish in
  1699.     Q*|q*) echo aborted; exit 86;;
  1700.     A*|a*|Y*|y*) x=Y;;
  1701.     *) x=N;;
  1702.     esac
  1703. else
  1704.     x=Y
  1705. fi
  1706. if test $x != Y; then
  1707.     echo x - skipping 'bibkey'
  1708. else
  1709. echo "x - extracting bibkey (Text)"
  1710. sed 's/^X//' << 'SHAR_EOF' > bibkey &&
  1711. X#!/bin/csh -f
  1712. X# 
  1713. X# bibkey - look for a word in the keyword field
  1714. X# in the references in a BiBTeX file. A restricted form of looktex, in
  1715. X# that bibkey only looks at "keyword" fields of the entries.
  1716. X#
  1717. X# David Kotz (dfk@cs.dartmouth.edu)
  1718. X#
  1719. X# usage: 
  1720. X#  bibkey keyword file...
  1721. X#
  1722. X# Warning: Any characters in keyword that have meanings in regexps
  1723. X# used by either sed or egrep must be escaped with a \ (the most 
  1724. X# likely occurrence might be \ itself: use \\). Case is ignored in 
  1725. X# the search.
  1726. X#
  1727. X# Multiple keywords may be specified with an egrep alternation format:
  1728. X# eg  bibkey 'jones|smith' foo.bib
  1729. X#
  1730. X# Actually, any egrep expression is allowed. 
  1731. X# Be sure to quote it properly. 
  1732. X#
  1733. X
  1734. Xset L=~/lib
  1735. X
  1736. Xif ($#argv < 2) then
  1737. X    echo usage: bibkey keyword 'file...'
  1738. X    exit 1
  1739. Xendif
  1740. X
  1741. Xset keyword=`echo "$1" | tr A-Z a-z`
  1742. Xshift
  1743. X
  1744. Xset script=/tmp/bibkey$$
  1745. Xonintr cleanup
  1746. X
  1747. X# Search for the keyword and get a script for extracting the
  1748. X# references:
  1749. X#  Cat the files
  1750. X#  Strip comment lines and comments on lines
  1751. X#  Translate to lower case (needs to precede sed and egrep)
  1752. X#  Extract the keyword entries, plus number for lines with @
  1753. X#  Search for the keyword
  1754. X#  Convert this output into a sed script
  1755. Xcat $* \
  1756. X    | sed -e 's/^%.*//' -e 's/\([^\\]\)%.*/\1/' \
  1757. X    | tr A-Z a-z \
  1758. X    | sed -n -f $L/bibkey.sed \
  1759. X    | egrep '^[0-9]*$|'"($keyword)" \
  1760. X    | awk -f $L/bibkey.awk > $script
  1761. X
  1762. X# Now have sed print out the correct entries:
  1763. Xcat $* | sed -n -f $script 
  1764. X
  1765. Xcleanup:
  1766. Xrm -f $script
  1767. SHAR_EOF
  1768. $TOUCH -am 0803160792 bibkey &&
  1769. chmod 0755 bibkey ||
  1770. echo "restore of bibkey failed"
  1771. set `wc -c bibkey`;Wc_c=$1
  1772. if test "$Wc_c" != "1469"; then
  1773.     echo original size 1469, current size $Wc_c
  1774. fi
  1775. fi
  1776. # ============= bibkey.awk ==============
  1777. if test X"$1" != X"-c" -a -f 'bibkey.awk'; then
  1778.     case $wish in
  1779.     A*|a*) echo x - overwriting 'bibkey.awk';;
  1780.     *) echo "? - overwrite 'bibkey.awk' -- [No], [Y]es, [A]ll, [Q]uit? "
  1781.         read wish;;
  1782.     esac
  1783.     case $wish in
  1784.     Q*|q*) echo aborted; exit 86;;
  1785.     A*|a*|Y*|y*) x=Y;;
  1786.     *) x=N;;
  1787.     esac
  1788. else
  1789.     x=Y
  1790. fi
  1791. if test $x != Y; then
  1792.     echo x - skipping 'bibkey.awk'
  1793. else
  1794. echo "x - extracting bibkey.awk (Text)"
  1795. sed 's/^X//' << 'SHAR_EOF' > bibkey.awk &&
  1796. X# bibkey.awk 
  1797. X#
  1798. X# Goes with bin/bibkey - look for a word in the keyword entry 
  1799. X#
  1800. X# David Kotz (dfk@cs.dartmouth.edu)
  1801. X#
  1802. X# On stdin, we get a list of line numbers of the beginning of entries
  1803. X# (in the concatenated bibtex input) and the text of lines from keyword
  1804. X# entries  that have the keyword in them.
  1805. X#
  1806. X# On stdout, we produce a sed script for printing entries that had a
  1807. X# match in them somewhere. This is a list of lines like "A,Bp" where A
  1808. X# and B are line numbers.
  1809. X
  1810. XBEGIN {found=0; last=1}
  1811. X
  1812. X{
  1813. X# test: is line a number?
  1814. X    if ($1+0 > 0) {
  1815. X           if (found) {
  1816. X                  print last "," $1-1 "p";
  1817. X                  found=0
  1818. X           }
  1819. X           last=$1
  1820. X    } else {
  1821. X       found = 1
  1822. X    }
  1823. X}
  1824. X
  1825. XEND {
  1826. X    if (found)
  1827. X        print last ",$p";
  1828. X}
  1829. SHAR_EOF
  1830. $TOUCH -am 0803155292 bibkey.awk &&
  1831. chmod 0644 bibkey.awk ||
  1832. echo "restore of bibkey.awk failed"
  1833. set `wc -c bibkey.awk`;Wc_c=$1
  1834. if test "$Wc_c" != "740"; then
  1835.     echo original size 740, current size $Wc_c
  1836. fi
  1837. fi
  1838. # ============= bibkey.sed ==============
  1839. if test X"$1" != X"-c" -a -f 'bibkey.sed'; then
  1840.     case $wish in
  1841.     A*|a*) echo x - overwriting 'bibkey.sed';;
  1842.     *) echo "? - overwrite 'bibkey.sed' -- [No], [Y]es, [A]ll, [Q]uit? "
  1843.         read wish;;
  1844.     esac
  1845.     case $wish in
  1846.     Q*|q*) echo aborted; exit 86;;
  1847.     A*|a*|Y*|y*) x=Y;;
  1848.     *) x=N;;
  1849.     esac
  1850. else
  1851.     x=Y
  1852. fi
  1853. if test $x != Y; then
  1854.     echo x - skipping 'bibkey.sed'
  1855. else
  1856. echo "x - extracting bibkey.sed (Text)"
  1857. sed 's/^X//' << 'SHAR_EOF' > bibkey.sed &&
  1858. X# bibkey.sed
  1859. X#
  1860. X# Goes with bin/bibkey - look for a word in the keyword entry 
  1861. X#
  1862. X# David Kotz (dfk@cs.dartmouth.edu)
  1863. X#
  1864. X# On stdin, we get a lowercased bibtex file with comments stripped.
  1865. X#
  1866. X# On stdout, we produce a list of line numbers that are the starting
  1867. X# line number of each reference, and the text of all "keyword"
  1868. X# entries on separate lines.
  1869. X
  1870. X# the idea is to get @ line numbers and all keywords
  1871. X# @ entry
  1872. X/^[     ]*@.*/=
  1873. X# one-line keyword entry
  1874. Xs/[     ]*keyword[     ]*=[     ]*"\(.*\)".*/\1/p
  1875. Xt 
  1876. X# start of multi-line keyword entry
  1877. Xs/[     ]*keyword[     ]*=[     ]*"\(.*\)/\1/
  1878. Xt partial
  1879. Xb
  1880. X# Handle multi-line keyword entry: save this line, repeatedly add
  1881. X# lines until close quote forces output
  1882. X:partial
  1883. XN
  1884. Xs/\(.*\n.*\)".*/\1/
  1885. Xt done
  1886. Xb partial
  1887. X:done
  1888. Xs/\n/ /g
  1889. Xp
  1890. SHAR_EOF
  1891. $TOUCH -am 0803160892 bibkey.sed &&
  1892. chmod 0644 bibkey.sed ||
  1893. echo "restore of bibkey.sed failed"
  1894. set `wc -c bibkey.sed`;Wc_c=$1
  1895. if test "$Wc_c" != "751"; then
  1896.     echo original size 751, current size $Wc_c
  1897. fi
  1898. fi
  1899. # ============= cleantex ==============
  1900. if test X"$1" != X"-c" -a -f 'cleantex'; then
  1901.     case $wish in
  1902.     A*|a*) echo x - overwriting 'cleantex';;
  1903.     *) echo "? - overwrite 'cleantex' -- [No], [Y]es, [A]ll, [Q]uit? "
  1904.         read wish;;
  1905.     esac
  1906.     case $wish in
  1907.     Q*|q*) echo aborted; exit 86;;
  1908.     A*|a*|Y*|y*) x=Y;;
  1909.     *) x=N;;
  1910.     esac
  1911. else
  1912.     x=Y
  1913. fi
  1914. if test $x != Y; then
  1915.     echo x - skipping 'cleantex'
  1916. else
  1917. echo "x - extracting cleantex (Text)"
  1918. sed 's/^X//' << 'SHAR_EOF' > cleantex &&
  1919. X#!/bin/csh
  1920. X#
  1921. X# cleantex - clean up files related to Latex processing
  1922. X#
  1923. X# usage - cleantex [base]...
  1924. X# default is \*, ie, to remove all latex extraneous files. 
  1925. X# Otherwise, those beginning with 'base.' are removed.
  1926. X#
  1927. X# No csh -f flag so that we get safe-rm instead of rm, where appropriate.
  1928. X
  1929. Xset extensions="{dvi,aux,log,toc,lof,bbl,blg,lot}"
  1930. X
  1931. Xif ($#argv == 0) then
  1932. X       rm -f *~ *.$extensions
  1933. Xelse
  1934. X       foreach i ($*)
  1935. X              rm -f $i.tex~ $i.$extensions
  1936. X       end
  1937. Xendif
  1938. SHAR_EOF
  1939. $TOUCH -am 0205231692 cleantex &&
  1940. chmod 0755 cleantex ||
  1941. echo "restore of cleantex failed"
  1942. set `wc -c cleantex`;Wc_c=$1
  1943. if test "$Wc_c" != "468"; then
  1944.     echo original size 468, current size $Wc_c
  1945. fi
  1946. fi
  1947. # ============= looktex ==============
  1948. if test X"$1" != X"-c" -a -f 'looktex'; then
  1949.     case $wish in
  1950.     A*|a*) echo x - overwriting 'looktex';;
  1951.     *) echo "? - overwrite 'looktex' -- [No], [Y]es, [A]ll, [Q]uit? "
  1952.         read wish;;
  1953.     esac
  1954.     case $wish in
  1955.     Q*|q*) echo aborted; exit 86;;
  1956.     A*|a*|Y*|y*) x=Y;;
  1957.     *) x=N;;
  1958.     esac
  1959. else
  1960.     x=Y
  1961. fi
  1962. if test $x != Y; then
  1963.     echo x - skipping 'looktex'
  1964. else
  1965. echo "x - extracting looktex (Text)"
  1966. sed 's/^X//' << 'SHAR_EOF' > looktex &&
  1967. X#!/bin/csh -f
  1968. X# looktex - look for a keyword in the references in a BiBTeX file.
  1969. X#
  1970. X# David Kotz (dfk@cs.dartmouth.edu)
  1971. X#
  1972. X# usage: 
  1973. X#  looktex keyword file...
  1974. X#
  1975. X# Warning: Any characters in keyword that have meanings in regexps
  1976. X# used by either sed or egrep must be escaped with a \ (the most 
  1977. X# likely occurrence might be \ itself: use \\). Case is ignored in 
  1978. X# the search, as well as position in the reference.
  1979. X#
  1980. X# Multiple keywords may be specified with an egrep alternation format:
  1981. X# eg  looktex 'jones|smith' foo.bib
  1982. X#
  1983. X# Actually, any egrep expression is allowed. 
  1984. X# Be sure to quote it properly. 
  1985. X#
  1986. X
  1987. Xset L=~/lib
  1988. X
  1989. Xif ($#argv < 2) then
  1990. X    echo usage: looktex keyword 'file...'
  1991. X    exit 1
  1992. Xendif
  1993. X
  1994. Xset keyword=`echo "$1" | tr A-Z a-z`
  1995. Xshift
  1996. X
  1997. Xset script=/tmp/looktex$$
  1998. Xonintr cleanup
  1999. X
  2000. X# Search for the keyword and get a script for extracting the
  2001. X# references:
  2002. X#  Cat the files
  2003. X#  Strip comment lines and comments on lines
  2004. X#  Translate to lower case
  2005. X#  Search for the keyword and all @ lines
  2006. X#  Extract the line number only, plus 'entry' for lines with @
  2007. X#  Convert this output into a sed script
  2008. Xcat $* \
  2009. X    | sed -e 's/^%.*//' -e 's/\([^\\]\)%.*/\1/' \
  2010. X    | tr A-Z a-z \
  2011. X    | egrep -n "($keyword)"'|^[ ]*@' \
  2012. X    | sed -n -e "s/:[ ]*@.*$keyword.*/ entry key/p" -e 's/:[ ]*@.*/ entry/p' -e "s/:.*//p" \
  2013. X    | awk -f $L/looktex.awk > $script
  2014. X
  2015. X# Now have sed print out the correct entries:
  2016. Xcat $* | sed -n -f $script 
  2017. X
  2018. Xcleanup:
  2019. Xrm -f $script
  2020. SHAR_EOF
  2021. $TOUCH -am 0803155092 looktex &&
  2022. chmod 0755 looktex ||
  2023. echo "restore of looktex failed"
  2024. set `wc -c looktex`;Wc_c=$1
  2025. if test "$Wc_c" != "1443"; then
  2026.     echo original size 1443, current size $Wc_c
  2027. fi
  2028. fi
  2029. # ============= looktex.awk ==============
  2030. if test X"$1" != X"-c" -a -f 'looktex.awk'; then
  2031.     case $wish in
  2032.     A*|a*) echo x - overwriting 'looktex.awk';;
  2033.     *) echo "? - overwrite 'looktex.awk' -- [No], [Y]es, [A]ll, [Q]uit? "
  2034.         read wish;;
  2035.     esac
  2036.     case $wish in
  2037.     Q*|q*) echo aborted; exit 86;;
  2038.     A*|a*|Y*|y*) x=Y;;
  2039.     *) x=N;;
  2040.     esac
  2041. else
  2042.     x=Y
  2043. fi
  2044. if test $x != Y; then
  2045.     echo x - skipping 'looktex.awk'
  2046. else
  2047. echo "x - extracting looktex.awk (Text)"
  2048. sed 's/^X//' << 'SHAR_EOF' > looktex.awk &&
  2049. X# looktex.awk 
  2050. X#
  2051. X# Goes with bin/looktex - look for a keyword in the references in a BiBTeX file
  2052. X#
  2053. X# David Kotz (dfk@cs.dartmouth.edu)
  2054. X#
  2055. X# This takes a list of line numbers that had the keyword. Some of the
  2056. X# line numbers will be followed by "entry" or "entry key"; "entry"
  2057. X# means that the line number is the start of a new bibtex entry, not a
  2058. X# line containing the keyword. "entry key" means that it is a line
  2059. X# starting an entry AND containing the keyword.
  2060. X#
  2061. X# On stdout, we produce a sed script for printing entries that had a
  2062. X# match in them somewhere. This is a list of lines like "A,Bp" where A
  2063. X# and B are line numbers.
  2064. X
  2065. XBEGIN {found=0; last=1}
  2066. X
  2067. X# defines the start of a new entry WITH a keyword match
  2068. XNF==3 {
  2069. X    if (found) { print last "," $1-1 "p" }
  2070. X    found=1
  2071. X    last=$1 
  2072. X}
  2073. X
  2074. X# defines the start of a new entry
  2075. XNF==2 {
  2076. X    if (found) { print last "," $1-1 "p" }
  2077. X    found=0
  2078. X    last=$1
  2079. X}
  2080. X
  2081. X# marks a place where the keyword was found
  2082. XNF==1 {found=1}
  2083. X
  2084. XEND {
  2085. X    if (found)
  2086. X        print last ",$p";
  2087. X}
  2088. SHAR_EOF
  2089. $TOUCH -am 0803154292 looktex.awk &&
  2090. chmod 0644 looktex.awk ||
  2091. echo "restore of looktex.awk failed"
  2092. set `wc -c looktex.awk`;Wc_c=$1
  2093. if test "$Wc_c" != "1012"; then
  2094.     echo original size 1012, current size $Wc_c
  2095. fi
  2096. fi
  2097. # ============= makebib ==============
  2098. if test X"$1" != X"-c" -a -f 'makebib'; then
  2099.     case $wish in
  2100.     A*|a*) echo x - overwriting 'makebib';;
  2101.     *) echo "? - overwrite 'makebib' -- [No], [Y]es, [A]ll, [Q]uit? "
  2102.         read wish;;
  2103.     esac
  2104.     case $wish in
  2105.     Q*|q*) echo aborted; exit 86;;
  2106.     A*|a*|Y*|y*) x=Y;;
  2107.     *) x=N;;
  2108.     esac
  2109. else
  2110.     x=Y
  2111. fi
  2112. if test $x != Y; then
  2113.     echo x - skipping 'makebib'
  2114. else
  2115. echo "x - extracting makebib (Text)"
  2116. sed 's/^X//' << 'SHAR_EOF' > makebib &&
  2117. X#!/bin/csh -f
  2118. X#
  2119. X# makebib - make a bib file that has the given citations
  2120. X#
  2121. X# usage: 
  2122. X#    makebib [-n | -d] file.bib... [citekey]...
  2123. X# Where -n means "no comment", ie, don't include any "comment" fields.
  2124. X# And -d means "dfk", ie, add attribution to dfk to all comment fields.
  2125. X# Output is to subset.bib. If citekey is not given, then all refs in
  2126. X# the bibfile are included.
  2127. X
  2128. Xonintr cleanup
  2129. X
  2130. Xif ($#argv < 1) then
  2131. X       echo 'usage: makebib [-n|-d] file.bib... [citekey]...'
  2132. X       exit 1
  2133. Xendif
  2134. X
  2135. Xif ("$1" == "-n") then
  2136. X       set bst=subset-nocomment
  2137. X       shift
  2138. Xelse
  2139. X       if ("$1" == "-d") then
  2140. X              set bst=subset-dfk
  2141. X              shift
  2142. X       else
  2143. X              set bst=subset
  2144. X       endif
  2145. Xendif
  2146. X
  2147. Xif ($#argv < 1) then
  2148. X       echo 'usage: makebib [-n|-d] file.bib... [citekey]...'
  2149. X       exit 1
  2150. Xendif
  2151. X
  2152. Xset files = $1:r
  2153. Xshift
  2154. X
  2155. Xwhile ($1:e == "bib")
  2156. X       set files=($files,$1:r)
  2157. X       shift
  2158. Xend
  2159. X
  2160. Xecho creating subset.tex for $files
  2161. X
  2162. Xcat > subset.tex <<EOF
  2163. X\documentstyle{article}
  2164. X\begin{document}
  2165. XEOF
  2166. X
  2167. Xif ($#argv > 0) then
  2168. X       foreach f ($*)
  2169. X          echo "\nocite{$f}" >> subset.tex
  2170. X       end
  2171. Xelse
  2172. X       echo "\nocite{*}" >> subset.tex
  2173. Xendif
  2174. X
  2175. Xcat >> subset.tex <<EOF
  2176. X\bibliographystyle{$bst}
  2177. X\bibliography{$files}
  2178. X\end{document}
  2179. XEOF
  2180. X
  2181. Xrm -f subset.{aux,log,dvi,bbl,blg}
  2182. X
  2183. Xecho latex subset.tex
  2184. Xlatex subset.tex
  2185. Xecho bibtex subset
  2186. Xbibtex subset
  2187. X
  2188. Xsed > subset.bib \
  2189. X   -e 's/\\ie/i.e./g' \
  2190. X   -e 's/\\eg/e.g./g' \
  2191. X   -e 's/\\etc/{\\em etc.}/g' \
  2192. X   -e 's/\\vs/{\\em vs.}/g' \
  2193. X   -e 's/\\usec/{{$\\mu$}sec}/g' \
  2194. X  subset.bbl
  2195. X
  2196. Xecho ""
  2197. Xecho output is in subset.bib
  2198. X
  2199. Xcleanup:
  2200. Xrm -f subset.{tex,aux,log,dvi,bbl,blg}
  2201. X
  2202. SHAR_EOF
  2203. $TOUCH -am 0827104492 makebib &&
  2204. chmod 0755 makebib ||
  2205. echo "restore of makebib failed"
  2206. set `wc -c makebib`;Wc_c=$1
  2207. if test "$Wc_c" != "1566"; then
  2208.     echo original size 1566, current size $Wc_c
  2209. fi
  2210. fi
  2211. # ============= printbib ==============
  2212. if test X"$1" != X"-c" -a -f 'printbib'; then
  2213.     case $wish in
  2214.     A*|a*) echo x - overwriting 'printbib';;
  2215.     *) echo "? - overwrite 'printbib' -- [No], [Y]es, [A]ll, [Q]uit? "
  2216.         read wish;;
  2217.     esac
  2218.     case $wish in
  2219.     Q*|q*) echo aborted; exit 86;;
  2220.     A*|a*|Y*|y*) x=Y;;
  2221.     *) x=N;;
  2222.     esac
  2223. else
  2224.     x=Y
  2225. fi
  2226. if test $x != Y; then
  2227.     echo x - skipping 'printbib'
  2228. else
  2229. echo "x - extracting printbib (Text)"
  2230. sed 's/^X//' << 'SHAR_EOF' > printbib &&
  2231. X#!/bin/csh -f
  2232. X#
  2233. X# printbib - print a full bibtex bib file out
  2234. X#
  2235. X# David Kotz
  2236. X#
  2237. X# usage:
  2238. X#  printbib bibfile...
  2239. X#
  2240. X# Then send the dvi file 'abstract.dvi' to the printer
  2241. X# (usage varies; try lpr -d abstract.dvi)
  2242. X
  2243. Xif ($#argv == 0) then
  2244. X       echo usage: printbib bibfile...
  2245. X       exit 1
  2246. Xendif
  2247. X
  2248. Xif ($1:e == "bib") then
  2249. X       set files=($1:r)
  2250. Xelse
  2251. X       set files=($1)
  2252. Xendif
  2253. X
  2254. Xshift
  2255. Xforeach f ($*)
  2256. X       if ($f:e == "bib") then
  2257. X              set files="$files,$f:r"
  2258. X       else
  2259. X              set files="$files,$f"
  2260. X       endif
  2261. Xend
  2262. X
  2263. Xecho creating abstract.tex for $files
  2264. X
  2265. Xcat > abstract.tex <<EOF
  2266. X\documentstyle[11pt]{article}
  2267. X\sloppy
  2268. X\setlength{\textwidth}{6.5in}
  2269. X\setlength{\textheight}{9in}
  2270. X\setlength{\topmargin}{-0.5in}
  2271. X\setlength{\oddsidemargin}{0pt}
  2272. X\setlength{\evensidemargin}{0pt}
  2273. X\newcommand{\eg}{e.g.}        % e.g.
  2274. X\newcommand{\ie}{i.e.}        % i.e.
  2275. X\newcommand{\etc}{etc.}        % etc.
  2276. X\newcommand{\vs}{{\em vs.}}        % vs.
  2277. X\begin{document}
  2278. X\begin{center} \Large Bibliography files \large \\\\
  2279. XEOF
  2280. Xecho $files >> abstract.tex
  2281. Xcat >> abstract.tex <<EOF
  2282. X\\\\ \today
  2283. X\end{center}
  2284. X\nocite{*}
  2285. X\bibliographystyle{abstract}
  2286. XEOF
  2287. X
  2288. Xecho "\bibliography{$files}" >> abstract.tex
  2289. Xecho '\end{document}' >> abstract.tex
  2290. X
  2291. Xrm -f abstract.{aux,log,dvi,bbl,blg}
  2292. X
  2293. Xset echo 
  2294. Xlatex abstract.tex
  2295. Xbibtex abstract
  2296. Xlatex abstract.tex
  2297. Xlatex abstract.tex
  2298. SHAR_EOF
  2299. $TOUCH -am 0113153792 printbib &&
  2300. chmod 0755 printbib ||
  2301. echo "restore of printbib failed"
  2302. set `wc -c printbib`;Wc_c=$1
  2303. if test "$Wc_c" != "1287"; then
  2304.     echo original size 1287, current size $Wc_c
  2305. fi
  2306. fi
  2307. # ============= subset-dfk.bst ==============
  2308. if test X"$1" != X"-c" -a -f 'subset-dfk.bst'; then
  2309.     case $wish in
  2310.     A*|a*) echo x - overwriting 'subset-dfk.bst';;
  2311.     *) echo "? - overwrite 'subset-dfk.bst' -- [No], [Y]es, [A]ll, [Q]uit? "
  2312.         read wish;;
  2313.     esac
  2314.     case $wish in
  2315.     Q*|q*) echo aborted; exit 86;;
  2316.     A*|a*|Y*|y*) x=Y;;
  2317.     *) x=N;;
  2318.     esac
  2319. else
  2320.     x=Y
  2321. fi
  2322. if test $x != Y; then
  2323.     echo x - skipping 'subset-dfk.bst'
  2324. else
  2325. echo "x - extracting subset-dfk.bst (Text)"
  2326. sed 's/^X//' << 'SHAR_EOF' > subset-dfk.bst &&
  2327. X% BibTeX bibliography style `subset'
  2328. X% by David Kotz dfk@cs.dartmouth.edu
  2329. X% August 1992
  2330. X%   This takes an aux file and produces an unusual .bbl file,
  2331. X% that is actually in .bib format -- but it has all of the references,
  2332. X% and strings expanded. Thus, it becomes a complete, portable .bib
  2333. X% file. Doesn't handle crossrefs?
  2334. X%  modified from
  2335. X   % BibTeX bibliography style `abstract' 
  2336. X   % by David Kotz dfk@cs.duke.edu
  2337. X   % March 1989
  2338. X   %  modified from
  2339. X   %  BibTeX standard bibliography style `alpha'
  2340. X     % version 0.99a for BibTeX versions 0.99a or later, LaTeX version 2.09.
  2341. X      % Copyright (C) 1985, all rights reserved.
  2342. X      % Copying of this file is authorized only if either
  2343. X      % (1) you make absolutely no changes to your copy, including name, or
  2344. X      % (2) if you do make changes, you name it something other than
  2345. X      % btxbst.doc, plain.bst, unsrt.bst, alpha.bst, and abbrv.bst.
  2346. X      % This restriction helps ensure that all standard styles are identical.
  2347. X      % The file btxbst.doc has the documentation for this style.
  2348. X
  2349. X% DFK added abstract, comment, keyword to standard set
  2350. XENTRY
  2351. X  { abstract
  2352. X    address
  2353. X    author
  2354. X    booktitle
  2355. X    chapter
  2356. X    comment
  2357. X    edition
  2358. X    editor
  2359. X    howpublished
  2360. X    institution
  2361. X    journal
  2362. X    key
  2363. X    keyword
  2364. X    month
  2365. X    note
  2366. X    number
  2367. X    organization
  2368. X    pages
  2369. X    publisher
  2370. X    school
  2371. X    series
  2372. X    title
  2373. X    type
  2374. X    volume
  2375. X    year
  2376. X  }
  2377. X  {}
  2378. X  { label extra.label sort.label }
  2379. X
  2380. XSTRINGS { s t }
  2381. X
  2382. X% output a field; the top is the text, the next to top is the name of
  2383. X% the field, and we know that the text is nonnull.
  2384. X% we start by finishing the previous line
  2385. XFUNCTION {output.field}
  2386. X{
  2387. X  ", " write$             % write comma and newline
  2388. X  newline$
  2389. X  "  " write$             % and a respectable indentation
  2390. X
  2391. X  swap$                            % now field name is on top
  2392. X  " = {" *                        % put = {
  2393. X  swap$ *                           % now text is back on top; concatenate
  2394. X  "}" *                            % put }
  2395. X  write$
  2396. X}
  2397. X
  2398. X% output if top not empty; below the top is the name of the field
  2399. XFUNCTION {output}
  2400. X{ duplicate$ empty$
  2401. X    { pop$ pop$ }
  2402. X    'output.field
  2403. X  if$
  2404. X}
  2405. X
  2406. X% special for "comment"
  2407. X% output if top not empty; below the top is the name of the field
  2408. XFUNCTION {output.comment}
  2409. X{ duplicate$ empty$
  2410. X    { pop$ pop$ }
  2411. X    { " [David.Kotz@Dartmouth.edu]" * output.field }
  2412. X  if$
  2413. X}
  2414. X
  2415. X% Takes name of type as argument, and prints @ line
  2416. X% then it prints each field 
  2417. XFUNCTION {output.bibitem}
  2418. X{
  2419. X% write the @ line
  2420. X  "@" swap$ * write$              % @type
  2421. X  "{" cite$ * write$            % {citekey
  2422. X
  2423. X% The fields, in what seems to be a good order
  2424. X  "key" key output
  2425. X  "author" author output
  2426. X  "title" title output
  2427. X
  2428. X  "journal" journal output
  2429. X  "booktitle" booktitle output
  2430. X
  2431. X  "chapter" chapter output
  2432. X  "edition" edition output
  2433. X  "editor" editor output
  2434. X
  2435. X  "year" year output
  2436. X  "month" month output
  2437. X  "series" series output
  2438. X  "volume" volume output
  2439. X  "number" number output
  2440. X  "type" type output
  2441. X
  2442. X  "pages" pages output
  2443. X
  2444. X  "institution" institution output
  2445. X  "school" school output
  2446. X  "organization" organization output
  2447. X  "publisher" publisher output
  2448. X  "howpublished" howpublished output
  2449. X  "address" address output
  2450. X
  2451. X  "note" note output
  2452. X
  2453. X  "keyword" keyword output
  2454. X  "abstract" abstract output
  2455. X  "comment" comment output.comment
  2456. X% finish entry
  2457. X  newline$
  2458. X  "}" write$ 
  2459. X  newline$
  2460. X  newline$
  2461. X}
  2462. X
  2463. XFUNCTION {article}{ "Article" output.bibitem }
  2464. X
  2465. XFUNCTION {book}{ "Book" output.bibitem }
  2466. X
  2467. XFUNCTION {booklet}{ "Booklet" output.bibitem }
  2468. X
  2469. XFUNCTION {inbook}{ "InBook" output.bibitem }
  2470. X
  2471. XFUNCTION {incollection}{ "InCollection" output.bibitem }
  2472. X
  2473. XFUNCTION {inproceedings}{ "InProceedings" output.bibitem }
  2474. X
  2475. XFUNCTION {conference}{ "Conference" output.bibitem }
  2476. X
  2477. XFUNCTION {manual}{ "Manual" output.bibitem }
  2478. X
  2479. XFUNCTION {mastersthesis}{ "MastersThesis" output.bibitem }
  2480. X
  2481. XFUNCTION {misc}{ "Misc" output.bibitem }
  2482. X
  2483. XFUNCTION {phdthesis}{ "PhdThesis" output.bibitem }
  2484. X
  2485. XFUNCTION {proceedings}{ "Proceedings" output.bibitem }
  2486. X
  2487. XFUNCTION {techreport}{ "TechReport" output.bibitem }
  2488. X
  2489. XFUNCTION {unpublished}{ "Unpublished" output.bibitem }
  2490. X
  2491. XFUNCTION {default.type} { misc }
  2492. X
  2493. XMACRO {jan} {"January"}
  2494. X
  2495. XMACRO {feb} {"February"}
  2496. X
  2497. XMACRO {mar} {"March"}
  2498. X
  2499. XMACRO {apr} {"April"}
  2500. X
  2501. XMACRO {may} {"May"}
  2502. X
  2503. XMACRO {jun} {"June"}
  2504. X
  2505. XMACRO {jul} {"July"}
  2506. X
  2507. XMACRO {aug} {"August"}
  2508. X
  2509. XMACRO {sep} {"September"}
  2510. X
  2511. XMACRO {oct} {"October"}
  2512. X
  2513. XMACRO {nov} {"November"}
  2514. X
  2515. XMACRO {dec} {"December"}
  2516. X
  2517. XMACRO {acmcs} {"ACM Computing Surveys"}
  2518. X
  2519. XMACRO {acta} {"Acta Informatica"}
  2520. X
  2521. XMACRO {cacm} {"Communications of the ACM"}
  2522. X
  2523. XMACRO {ibmjrd} {"IBM Journal of Research and Development"}
  2524. X
  2525. XMACRO {ibmsj} {"IBM Systems Journal"}
  2526. X
  2527. XMACRO {ieeese} {"IEEE Transactions on Software Engineering"}
  2528. X
  2529. XMACRO {ieeetc} {"IEEE Transactions on Computers"}
  2530. X
  2531. XMACRO {ieeetcad}
  2532. X {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
  2533. X
  2534. XMACRO {ipl} {"Information Processing Letters"}
  2535. X
  2536. XMACRO {jacm} {"Journal of the ACM"}
  2537. X
  2538. XMACRO {jcss} {"Journal of Computer and System Sciences"}
  2539. X
  2540. XMACRO {scp} {"Science of Computer Programming"}
  2541. X
  2542. XMACRO {sicomp} {"SIAM Journal on Computing"}
  2543. X
  2544. XMACRO {tocs} {"ACM Transactions on Computer Systems"}
  2545. X
  2546. XMACRO {tods} {"ACM Transactions on Database Systems"}
  2547. X
  2548. XMACRO {tog} {"ACM Transactions on Graphics"}
  2549. X
  2550. XMACRO {toms} {"ACM Transactions on Mathematical Software"}
  2551. X
  2552. XMACRO {toois} {"ACM Transactions on Office Information Systems"}
  2553. X
  2554. XMACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
  2555. X
  2556. XMACRO {tcs} {"Theoretical Computer Science"}
  2557. X
  2558. XREAD
  2559. X
  2560. X% DFK use cite$ for sort key
  2561. XFUNCTION {presort}
  2562. X{
  2563. X  cite$
  2564. X  #1 entry.max$ substring$
  2565. X  'sort.key$ :=
  2566. X}
  2567. X
  2568. XITERATE {presort}
  2569. X
  2570. XSORT
  2571. X
  2572. XFUNCTION {begin.bib}
  2573. X{
  2574. X  "% BibTeX bibliography file" write$ 
  2575. X  newline$ 
  2576. X  newline$
  2577. X}
  2578. X
  2579. XEXECUTE {begin.bib}
  2580. X
  2581. XITERATE {call.type$}
  2582. SHAR_EOF
  2583. $TOUCH -am 0827105092 subset-dfk.bst &&
  2584. chmod 0644 subset-dfk.bst ||
  2585. echo "restore of subset-dfk.bst failed"
  2586. set `wc -c subset-dfk.bst`;Wc_c=$1
  2587. if test "$Wc_c" != "5667"; then
  2588.     echo original size 5667, current size $Wc_c
  2589. fi
  2590. fi
  2591. # ============= subset-nocomment.bst ==============
  2592. if test X"$1" != X"-c" -a -f 'subset-nocomment.bst'; then
  2593.     case $wish in
  2594.     A*|a*) echo x - overwriting 'subset-nocomment.bst';;
  2595.     *) echo "? - overwrite 'subset-nocomment.bst' -- [No], [Y]es, [A]ll, [Q]uit? "
  2596.         read wish;;
  2597.     esac
  2598.     case $wish in
  2599.     Q*|q*) echo aborted; exit 86;;
  2600.     A*|a*|Y*|y*) x=Y;;
  2601.     *) x=N;;
  2602.     esac
  2603. else
  2604.     x=Y
  2605. fi
  2606. if test $x != Y; then
  2607.     echo x - skipping 'subset-nocomment.bst'
  2608. else
  2609. echo "x - extracting subset-nocomment.bst (Text)"
  2610. sed 's/^X//' << 'SHAR_EOF' > subset-nocomment.bst &&
  2611. X% BibTeX bibliography style `subset'
  2612. X% by David Kotz dfk@cs.dartmouth.edu
  2613. X% August 1992
  2614. X%   This takes an aux file and produces an unusual .bbl file,
  2615. X% that is actually in .bib format -- but it has all of the references,
  2616. X% and strings expanded. Thus, it becomes a complete, portable .bib
  2617. X% file. Doesn't handle crossrefs?
  2618. X%  modified from
  2619. X   % BibTeX bibliography style `abstract' 
  2620. X   % by David Kotz dfk@cs.duke.edu
  2621. X   % March 1989
  2622. X   %  modified from
  2623. X   %  BibTeX standard bibliography style `alpha'
  2624. X     % version 0.99a for BibTeX versions 0.99a or later, LaTeX version 2.09.
  2625. X      % Copyright (C) 1985, all rights reserved.
  2626. X      % Copying of this file is authorized only if either
  2627. X      % (1) you make absolutely no changes to your copy, including name, or
  2628. X      % (2) if you do make changes, you name it something other than
  2629. X      % btxbst.doc, plain.bst, unsrt.bst, alpha.bst, and abbrv.bst.
  2630. X      % This restriction helps ensure that all standard styles are identical.
  2631. X      % The file btxbst.doc has the documentation for this style.
  2632. X
  2633. X% DFK added abstract, comment, keyword to standard set
  2634. XENTRY
  2635. X  { abstract
  2636. X    address
  2637. X    author
  2638. X    booktitle
  2639. X    chapter
  2640. X    comment
  2641. X    edition
  2642. X    editor
  2643. X    howpublished
  2644. X    institution
  2645. X    journal
  2646. X    key
  2647. X    keyword
  2648. X    month
  2649. X    note
  2650. X    number
  2651. X    organization
  2652. X    pages
  2653. X    publisher
  2654. X    school
  2655. X    series
  2656. X    title
  2657. X    type
  2658. X    volume
  2659. X    year
  2660. X  }
  2661. X  {}
  2662. X  { label extra.label sort.label }
  2663. X
  2664. XSTRINGS { s t }
  2665. X
  2666. X% output a field; the top is the text, the next to top is the name of
  2667. X% the field, and we know that the text is nonnull.
  2668. X% we start by finishing the previous line
  2669. XFUNCTION {output.field}
  2670. X{
  2671. X  ", " write$             % write comma and newline
  2672. X  newline$
  2673. X  "  " write$             % and a respectable indentation
  2674. X
  2675. X  swap$                            % now field name is on top
  2676. X  " = {" *                        % put = {
  2677. X  swap$ *                           % now text is back on top; concatenate
  2678. X  "}" *                            % put }
  2679. X  write$
  2680. X}
  2681. X
  2682. X% output if top not empty; below the top is the name of the field
  2683. XFUNCTION {output}
  2684. X{ duplicate$ empty$
  2685. X    { pop$ pop$ }
  2686. X    'output.field
  2687. X  if$
  2688. X}
  2689. X
  2690. X% Takes name of type as argument, and prints @ line
  2691. X% then it prints each field 
  2692. XFUNCTION {output.bibitem}
  2693. X{
  2694. X% write the @ line
  2695. X  "@" swap$ * write$              % @type
  2696. X  "{" cite$ * write$            % {citekey
  2697. X
  2698. X% The fields, in what seems to be a good order
  2699. X  "key" key output
  2700. X  "author" author output
  2701. X  "title" title output
  2702. X
  2703. X  "journal" journal output
  2704. X  "booktitle" booktitle output
  2705. X
  2706. X  "chapter" chapter output
  2707. X  "edition" edition output
  2708. X  "editor" editor output
  2709. X
  2710. X  "year" year output
  2711. X  "month" month output
  2712. X  "series" series output
  2713. X  "volume" volume output
  2714. X  "number" number output
  2715. X  "type" type output
  2716. X
  2717. X  "pages" pages output
  2718. X
  2719. X  "institution" institution output
  2720. X  "school" school output
  2721. X  "organization" organization output
  2722. X  "publisher" publisher output
  2723. X  "howpublished" howpublished output
  2724. X  "address" address output
  2725. X
  2726. X  "note" note output
  2727. X
  2728. X  "keyword" keyword output
  2729. X  "abstract" abstract output
  2730. X% leave out the comments here
  2731. X%  "comment" comment output
  2732. X
  2733. X% finish entry
  2734. X  newline$
  2735. X  "}" write$ 
  2736. X  newline$
  2737. X  newline$
  2738. X}
  2739. X
  2740. XFUNCTION {article}{ "Article" output.bibitem }
  2741. X
  2742. XFUNCTION {book}{ "Book" output.bibitem }
  2743. X
  2744. XFUNCTION {booklet}{ "Booklet" output.bibitem }
  2745. X
  2746. XFUNCTION {inbook}{ "InBook" output.bibitem }
  2747. X
  2748. XFUNCTION {incollection}{ "InCollection" output.bibitem }
  2749. X
  2750. XFUNCTION {inproceedings}{ "InProceedings" output.bibitem }
  2751. X
  2752. XFUNCTION {conference}{ "Conference" output.bibitem }
  2753. X
  2754. XFUNCTION {manual}{ "Manual" output.bibitem }
  2755. X
  2756. XFUNCTION {mastersthesis}{ "MastersThesis" output.bibitem }
  2757. X
  2758. XFUNCTION {misc}{ "Misc" output.bibitem }
  2759. X
  2760. XFUNCTION {phdthesis}{ "PhdThesis" output.bibitem }
  2761. X
  2762. XFUNCTION {proceedings}{ "Proceedings" output.bibitem }
  2763. X
  2764. XFUNCTION {techreport}{ "TechReport" output.bibitem }
  2765. X
  2766. XFUNCTION {unpublished}{ "Unpublished" output.bibitem }
  2767. X
  2768. XFUNCTION {default.type} { misc }
  2769. X
  2770. XMACRO {jan} {"January"}
  2771. X
  2772. XMACRO {feb} {"February"}
  2773. X
  2774. XMACRO {mar} {"March"}
  2775. X
  2776. XMACRO {apr} {"April"}
  2777. X
  2778. XMACRO {may} {"May"}
  2779. X
  2780. XMACRO {jun} {"June"}
  2781. X
  2782. XMACRO {jul} {"July"}
  2783. X
  2784. XMACRO {aug} {"August"}
  2785. X
  2786. XMACRO {sep} {"September"}
  2787. X
  2788. XMACRO {oct} {"October"}
  2789. X
  2790. XMACRO {nov} {"November"}
  2791. X
  2792. XMACRO {dec} {"December"}
  2793. X
  2794. XMACRO {acmcs} {"ACM Computing Surveys"}
  2795. X
  2796. XMACRO {acta} {"Acta Informatica"}
  2797. X
  2798. XMACRO {cacm} {"Communications of the ACM"}
  2799. X
  2800. XMACRO {ibmjrd} {"IBM Journal of Research and Development"}
  2801. X
  2802. XMACRO {ibmsj} {"IBM Systems Journal"}
  2803. X
  2804. XMACRO {ieeese} {"IEEE Transactions on Software Engineering"}
  2805. X
  2806. XMACRO {ieeetc} {"IEEE Transactions on Computers"}
  2807. X
  2808. XMACRO {ieeetcad}
  2809. X {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
  2810. X
  2811. XMACRO {ipl} {"Information Processing Letters"}
  2812. X
  2813. XMACRO {jacm} {"Journal of the ACM"}
  2814. X
  2815. XMACRO {jcss} {"Journal of Computer and System Sciences"}
  2816. X
  2817. XMACRO {scp} {"Science of Computer Programming"}
  2818. X
  2819. XMACRO {sicomp} {"SIAM Journal on Computing"}
  2820. X
  2821. XMACRO {tocs} {"ACM Transactions on Computer Systems"}
  2822. X
  2823. XMACRO {tods} {"ACM Transactions on Database Systems"}
  2824. X
  2825. XMACRO {tog} {"ACM Transactions on Graphics"}
  2826. X
  2827. XMACRO {toms} {"ACM Transactions on Mathematical Software"}
  2828. X
  2829. XMACRO {toois} {"ACM Transactions on Office Information Systems"}
  2830. X
  2831. XMACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
  2832. X
  2833. XMACRO {tcs} {"Theoretical Computer Science"}
  2834. X
  2835. XREAD
  2836. X
  2837. X% DFK use cite$ for sort key
  2838. XFUNCTION {presort}
  2839. X{
  2840. X  cite$
  2841. X  #1 entry.max$ substring$
  2842. X  'sort.key$ :=
  2843. X}
  2844. X
  2845. XITERATE {presort}
  2846. X
  2847. XSORT
  2848. X
  2849. XFUNCTION {begin.bib}
  2850. X{
  2851. X  "% BibTeX bibliography file" write$ 
  2852. X  newline$ 
  2853. X  newline$
  2854. X}
  2855. X
  2856. XEXECUTE {begin.bib}
  2857. X
  2858. XITERATE {call.type$}
  2859. SHAR_EOF
  2860. $TOUCH -am 0806141092 subset-nocomment.bst &&
  2861. chmod 0644 subset-nocomment.bst ||
  2862. echo "restore of subset-nocomment.bst failed"
  2863. set `wc -c subset-nocomment.bst`;Wc_c=$1
  2864. if test "$Wc_c" != "5473"; then
  2865.     echo original size 5473, current size $Wc_c
  2866. fi
  2867. fi
  2868. # ============= subset.bst ==============
  2869. if test X"$1" != X"-c" -a -f 'subset.bst'; then
  2870.     case $wish in
  2871.     A*|a*) echo x - overwriting 'subset.bst';;
  2872.     *) echo "? - overwrite 'subset.bst' -- [No], [Y]es, [A]ll, [Q]uit? "
  2873.         read wish;;
  2874.     esac
  2875.     case $wish in
  2876.     Q*|q*) echo aborted; exit 86;;
  2877.     A*|a*|Y*|y*) x=Y;;
  2878.     *) x=N;;
  2879.     esac
  2880. else
  2881.     x=Y
  2882. fi
  2883. if test $x != Y; then
  2884.     echo x - skipping 'subset.bst'
  2885. else
  2886. echo "x - extracting subset.bst (Text)"
  2887. sed 's/^X//' << 'SHAR_EOF' > subset.bst &&
  2888. X% BibTeX bibliography style `subset'
  2889. X% by David Kotz dfk@cs.dartmouth.edu
  2890. X% August 1992
  2891. X%   This takes an aux file and produces an unusual .bbl file,
  2892. X% that is actually in .bib format -- but it has all of the references,
  2893. X% and strings expanded. Thus, it becomes a complete, portable .bib
  2894. X% file. Doesn't handle crossrefs?
  2895. X%  modified from
  2896. X   % BibTeX bibliography style `abstract' 
  2897. X   % by David Kotz dfk@cs.duke.edu
  2898. X   % March 1989
  2899. X   %  modified from
  2900. X   %  BibTeX standard bibliography style `alpha'
  2901. X     % version 0.99a for BibTeX versions 0.99a or later, LaTeX version 2.09.
  2902. X      % Copyright (C) 1985, all rights reserved.
  2903. X      % Copying of this file is authorized only if either
  2904. X      % (1) you make absolutely no changes to your copy, including name, or
  2905. X      % (2) if you do make changes, you name it something other than
  2906. X      % btxbst.doc, plain.bst, unsrt.bst, alpha.bst, and abbrv.bst.
  2907. X      % This restriction helps ensure that all standard styles are identical.
  2908. X      % The file btxbst.doc has the documentation for this style.
  2909. X
  2910. X% DFK added abstract, comment, keyword to standard set
  2911. XENTRY
  2912. X  { abstract
  2913. X    address
  2914. X    author
  2915. X    booktitle
  2916. X    chapter
  2917. X    comment
  2918. X    edition
  2919. X    editor
  2920. X    howpublished
  2921. X    institution
  2922. X    journal
  2923. X    key
  2924. X    keyword
  2925. X    month
  2926. X    note
  2927. X    number
  2928. X    organization
  2929. X    pages
  2930. X    publisher
  2931. X    school
  2932. X    series
  2933. X    title
  2934. X    type
  2935. X    volume
  2936. X    year
  2937. X  }
  2938. X  {}
  2939. X  { label extra.label sort.label }
  2940. X
  2941. XSTRINGS { s t }
  2942. X
  2943. X% output a field; the top is the text, the next to top is the name of
  2944. X% the field, and we know that the text is nonnull.
  2945. X% we start by finishing the previous line
  2946. XFUNCTION {output.field}
  2947. X{
  2948. X  ", " write$             % write comma and newline
  2949. X  newline$
  2950. X  "  " write$             % and a respectable indentation
  2951. X
  2952. X  swap$                            % now field name is on top
  2953. X  " = {" *                        % put = {
  2954. X  swap$ *                           % now text is back on top; concatenate
  2955. X  "}" *                            % put }
  2956. X  write$
  2957. X}
  2958. X
  2959. X% output if top not empty; below the top is the name of the field
  2960. XFUNCTION {output}
  2961. X{ duplicate$ empty$
  2962. X    { pop$ pop$ }
  2963. X    'output.field
  2964. X  if$
  2965. X}
  2966. X
  2967. X% Takes name of type as argument, and prints @ line
  2968. X% then it prints each field 
  2969. XFUNCTION {output.bibitem}
  2970. X{
  2971. X% write the @ line
  2972. X  "@" swap$ * write$              % @type
  2973. X  "{" cite$ * write$            % {citekey
  2974. X
  2975. X% The fields, in what seems to be a good order
  2976. X  "key" key output
  2977. X  "author" author output
  2978. X  "title" title output
  2979. X
  2980. X  "journal" journal output
  2981. X  "booktitle" booktitle output
  2982. X
  2983. X  "chapter" chapter output
  2984. X  "edition" edition output
  2985. X  "editor" editor output
  2986. X
  2987. X  "year" year output
  2988. X  "month" month output
  2989. X  "series" series output
  2990. X  "volume" volume output
  2991. X  "number" number output
  2992. X  "type" type output
  2993. X
  2994. X  "pages" pages output
  2995. X
  2996. X  "institution" institution output
  2997. X  "school" school output
  2998. X  "organization" organization output
  2999. X  "publisher" publisher output
  3000. X  "howpublished" howpublished output
  3001. X  "address" address output
  3002. X
  3003. X  "note" note output
  3004. X
  3005. X  "keyword" keyword output
  3006. X  "abstract" abstract output
  3007. X  "comment" comment output
  3008. X
  3009. X% finish entry
  3010. X  newline$
  3011. X  "}" write$ 
  3012. X  newline$
  3013. X  newline$
  3014. X}
  3015. X
  3016. XFUNCTION {article}{ "Article" output.bibitem }
  3017. X
  3018. XFUNCTION {book}{ "Book" output.bibitem }
  3019. X
  3020. XFUNCTION {booklet}{ "Booklet" output.bibitem }
  3021. X
  3022. XFUNCTION {inbook}{ "InBook" output.bibitem }
  3023. X
  3024. XFUNCTION {incollection}{ "InCollection" output.bibitem }
  3025. X
  3026. XFUNCTION {inproceedings}{ "InProceedings" output.bibitem }
  3027. X
  3028. XFUNCTION {conference}{ "Conference" output.bibitem }
  3029. X
  3030. XFUNCTION {manual}{ "Manual" output.bibitem }
  3031. X
  3032. XFUNCTION {mastersthesis}{ "MastersThesis" output.bibitem }
  3033. X
  3034. XFUNCTION {misc}{ "Misc" output.bibitem }
  3035. X
  3036. XFUNCTION {phdthesis}{ "PhdThesis" output.bibitem }
  3037. X
  3038. XFUNCTION {proceedings}{ "Proceedings" output.bibitem }
  3039. X
  3040. XFUNCTION {techreport}{ "TechReport" output.bibitem }
  3041. X
  3042. XFUNCTION {unpublished}{ "Unpublished" output.bibitem }
  3043. X
  3044. XFUNCTION {default.type} { misc }
  3045. X
  3046. XMACRO {jan} {"January"}
  3047. X
  3048. XMACRO {feb} {"February"}
  3049. X
  3050. XMACRO {mar} {"March"}
  3051. X
  3052. XMACRO {apr} {"April"}
  3053. X
  3054. XMACRO {may} {"May"}
  3055. X
  3056. XMACRO {jun} {"June"}
  3057. X
  3058. XMACRO {jul} {"July"}
  3059. X
  3060. XMACRO {aug} {"August"}
  3061. X
  3062. XMACRO {sep} {"September"}
  3063. X
  3064. XMACRO {oct} {"October"}
  3065. X
  3066. XMACRO {nov} {"November"}
  3067. X
  3068. XMACRO {dec} {"December"}
  3069. X
  3070. XMACRO {acmcs} {"ACM Computing Surveys"}
  3071. X
  3072. XMACRO {acta} {"Acta Informatica"}
  3073. X
  3074. XMACRO {cacm} {"Communications of the ACM"}
  3075. X
  3076. XMACRO {ibmjrd} {"IBM Journal of Research and Development"}
  3077. X
  3078. XMACRO {ibmsj} {"IBM Systems Journal"}
  3079. X
  3080. XMACRO {ieeese} {"IEEE Transactions on Software Engineering"}
  3081. X
  3082. XMACRO {ieeetc} {"IEEE Transactions on Computers"}
  3083. X
  3084. XMACRO {ieeetcad}
  3085. X {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
  3086. X
  3087. XMACRO {ipl} {"Information Processing Letters"}
  3088. X
  3089. XMACRO {jacm} {"Journal of the ACM"}
  3090. X
  3091. XMACRO {jcss} {"Journal of Computer and System Sciences"}
  3092. X
  3093. XMACRO {scp} {"Science of Computer Programming"}
  3094. X
  3095. XMACRO {sicomp} {"SIAM Journal on Computing"}
  3096. X
  3097. XMACRO {tocs} {"ACM Transactions on Computer Systems"}
  3098. X
  3099. XMACRO {tods} {"ACM Transactions on Database Systems"}
  3100. X
  3101. XMACRO {tog} {"ACM Transactions on Graphics"}
  3102. X
  3103. XMACRO {toms} {"ACM Transactions on Mathematical Software"}
  3104. X
  3105. XMACRO {toois} {"ACM Transactions on Office Information Systems"}
  3106. X
  3107. XMACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
  3108. X
  3109. XMACRO {tcs} {"Theoretical Computer Science"}
  3110. X
  3111. XREAD
  3112. X
  3113. X% DFK use cite$ for sort key
  3114. XFUNCTION {presort}
  3115. X{
  3116. X  cite$
  3117. X  #1 entry.max$ substring$
  3118. X  'sort.key$ :=
  3119. X}
  3120. X
  3121. XITERATE {presort}
  3122. X
  3123. XSORT
  3124. X
  3125. XFUNCTION {begin.bib}
  3126. X{
  3127. X  "% BibTeX bibliography file" write$ 
  3128. X  newline$ 
  3129. X  newline$
  3130. X}
  3131. X
  3132. XEXECUTE {begin.bib}
  3133. X
  3134. XITERATE {call.type$}
  3135. SHAR_EOF
  3136. $TOUCH -am 0806140392 subset.bst &&
  3137. chmod 0644 subset.bst ||
  3138. echo "restore of subset.bst failed"
  3139. set `wc -c subset.bst`;Wc_c=$1
  3140. if test "$Wc_c" != "5442"; then
  3141.     echo original size 5442, current size $Wc_c
  3142. fi
  3143. fi
  3144. exit 0
  3145. -- 
  3146. -----------------
  3147. Mathematics and Computer Science
  3148. Dartmouth College, 6188 Bradley Hall, Hanover NH 03755-3551
  3149. email: David.Kotz@Dartmouth.edu    or   dfk@cs.dartmouth.edu
  3150.