Advertisement
Guest User

chicago-new.bst

a guest
Jul 5th, 2013
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 38.16 KB | None | 0 0
  1. %%% ====================================================================
  2. %%% @BibTeX-style-file{
  3. %%% author = "Glenn Paulley",
  4. %%% version = "4",
  5. %%% date = "28 August 1992",
  6. %%% time = "10:23:39 199",
  7. %%% filename = "chicago.bst",
  8. %%% address = "Data Structuring Group
  9. %%% Department of Computer Science
  10. %%% University of Waterloo
  11. %%% Waterloo, Ontario, Canada
  12. %%% N2L 3G1",
  13. %%% telephone = "(519) 885-1211",
  14. %%% FAX = "(519) 885-1208",
  15. %%% checksum = "26323 1654 5143 37417",
  16. %%% email = "gnpaulle@bluebox.uwaterloo.ca",
  17. %%% codetable = "ISO/ASCII",
  18. %%% keywords = "",
  19. %%% supported = "yes",
  20. %%% abstract = "A BibTeX bibliography style that follows the
  21. %%% `B' reference style of the 13th Edition of
  22. %%% the Chicago Manual of Style. A detailed
  23. %%% feature list is given below.",
  24. %%% docstring = "The checksum field above contains a CRC-16
  25. %%% checksum as the first value, followed by the
  26. %%% equivalent of the standard UNIX wc (word
  27. %%% count) utility output of lines, words, and
  28. %%% characters. This is produced by Robert
  29. %%% Solovay's checksum utility.",
  30. %%% }
  31. %%% ====================================================================
  32. %
  33. % "Chicago" BibTeX style, chicago.bst
  34. % ===================================
  35. %
  36. % BibTeX `chicago' style file for BibTeX version 0.99c, LaTeX version 2.09
  37. % Place it in a file called chicago.bst in the BibTeX search path.
  38. % You need to include chicago.sty as a \documentstyle option.
  39. % (Placing it in the same directory as the LaTeX document should also work.)
  40. % This "chicago" style is based on newapa.bst (American Psych. Assoc.)
  41. % found at ymir.claremont.edu.
  42. %
  43. % Citation format: (author-last-name year)
  44. % (author-last-name and author-last-name year)
  45. % (author-last-name, author-last-name, and author-last-name year)
  46. % (author-last-name et al. year)
  47. % (author-last-name)
  48. % author-last-name (year)
  49. % (author-last-name and author-last-name)
  50. % (author-last-name et al.)
  51. % (year) or (year,year)
  52. % year or year,year
  53. %
  54. % Reference list ordering: alphabetical by author or whatever passes
  55. % for author in the absence of one.
  56. %
  57. % This BibTeX style has support for abbreviated author lists and for
  58. % year-only citations. This is done by having the citations
  59. % actually look like
  60. %
  61. % \citeauthoryear{full-author-info}{abbrev-author-info}{year}
  62. %
  63. % The LaTeX style has to have the following (or similar)
  64. %
  65. % \let\@internalcite\cite
  66. % \def\fullcite{\def\citeauthoryear##1##2##3{##1, ##3}\@internalcite}
  67. % \def\fullciteA{\def\citeauthoryear##1##2##3{##1}\@internalcite}
  68. % \def\shortcite{\def\citeauthoryear##1##2##3{##2, ##3}\@internalcite}
  69. % \def\shortciteA{\def\citeauthoryear##1##2##3{##2}\@internalcite}
  70. % \def\citeyear{\def\citeauthoryear##1##2##3{##3}\@internalcite}
  71. %
  72. % These TeX macro definitions are found in chicago.sty. Additional
  73. % commands to manipulate different components of a citation can be defined
  74. % so that, for example, you can list author's names without parentheses
  75. % if using a citation as a noun or object in a sentence.
  76. %
  77. % This file was originally copied from newapa.bst at ymir.claremont.edu.
  78. %
  79. % Features of chicago.bst:
  80. % =======================
  81. %
  82. % - full names used in citations, but abbreviated citations are available
  83. % (see above)
  84. % - if an entry has a "month", then the month and year are also printed
  85. % as part of that bibitem.
  86. % - all conjunctions use "and" instead of "\&"
  87. % - major modification from Chicago Manual of Style (13th ed.) is that
  88. % only the first author in a reference appears last name first-
  89. % additional authors appear as J. Q. Public.
  90. % - pages are listed as "pp. xx-xx" in all entry types except
  91. % article entries.
  92. % - book, inbook, and manual use "location: publisher" (or organization)
  93. % for address and publisher. All other types list publishers separately.
  94. % - "pp." are used to identify page numbers for all entry types except
  95. % articles.
  96. % - organization is used as a citation label if neither author nor editor
  97. % is present (for manuals).
  98. % - "et al." is used for long author and editor lists, or when "others"
  99. % is used.
  100. %
  101. % Modifications and bug fixes from newapa.bst:
  102. % ===========================================
  103. %
  104. % - added month, year to bib entries if month is present
  105. % - fixed bug with In proceedings, added necessary comma after title
  106. % - all conjunctions changed to "and" from "\&"
  107. % - fixed bug with author labels in my.full.label: "et al." now is
  108. % generated when "others" is an author name
  109. % - major modification from Chicago Manual of Style (13th ed.) is that
  110. % only the first author in a reference appears last name first-
  111. % additional authors appear as J. Q. Public.
  112. % - pages are listed as "pp. xx-xx" in all entry types except
  113. % article entries. Unnecessary (IMHO) "()" around page numbers
  114. % were removed, and page numbers now don't end with a period.
  115. % - created chicago.sty for use with this bibstyle (required).
  116. % - fixed bugs in FUNCTION {format.vol.num.pages} for missing volume,
  117. % number, and /or pages. Renamed to format.jour.vol.
  118. % - fixed bug in formatting booktitles: additional period an error if
  119. % book has a volume.
  120. % - fixed bug: editors usually given redundant period before next clause
  121. % (format.editors.dot) removed.
  122. % - added label support for organizations, if both author and editor
  123. % are missing (from alpha.bst). If organization is too long, then
  124. % the key field is used for abbreviated citations.
  125. % - In proceedings or books of several volumes, no comma was written
  126. % between the "Volume x" and the page numbers (this was intentional
  127. % in newapa.bst). Fixed.
  128. % - Some journals may not have volumes/numbers, only month/year (eg.
  129. % IEEE Computer). Fixed bug in article style that assumed volume/number
  130. % was always present.
  131. %
  132. % Original documentation for newapa.sty:
  133. % =====================================
  134. %
  135. % This version was made by modifying the master file made by
  136. % Oren Patashnik (PATASHNIK@SCORE.STANFORD.EDU), and the 'named' BibTeX
  137. % style of Peter F. Patel-Schneider.
  138. %
  139. % Copyright (C) 1985, all rights reserved.
  140. % Copying of this file is authorized only if either
  141. % (1) you make absolutely no changes to your copy, including name, or
  142. % (2) if you do make changes, you name it something other than 'newapa.bst'.
  143. % There are undoubtably bugs in this style. If you make bug fixes,
  144. % improvements, etc. please let me know. My e-mail address is:
  145. % spencer@cgrg.ohio.state.edu or 71160.3141@compuserve.com
  146. %
  147. % This style was made from 'plain.bst', 'named.bst', and 'apalike.bst',
  148. % with lots of tweaking to make it look like APA style, along with tips
  149. % from Young Ryu and Brian Reiser's modifications of 'apalike.bst'.
  150.  
  151. ENTRY
  152. { address
  153. author
  154. booktitle
  155. chapter
  156. edition
  157. editor
  158. howpublished
  159. institution
  160. journal
  161. key
  162. month
  163. note
  164. number
  165. organization
  166. pages
  167. publisher
  168. school
  169. series
  170. title
  171. type
  172. volume
  173. year
  174. }
  175. {}
  176. { label.year extra.label sort.year sort.label }
  177.  
  178. INTEGERS { output.state before.all mid.sentence after.sentence after.block }
  179.  
  180. FUNCTION {init.state.consts}
  181. { #0 'before.all :=
  182. #1 'mid.sentence :=
  183. #2 'after.sentence :=
  184. #3 'after.block :=
  185. }
  186.  
  187. STRINGS { s t u }
  188.  
  189. FUNCTION {output.nonnull}
  190. { 's :=
  191. output.state mid.sentence =
  192. { ", " * write$ }
  193. { output.state after.block =
  194. { add.period$ write$
  195. newline$
  196. "\newblock " write$
  197. }
  198. { output.state before.all =
  199. 'write$
  200. { add.period$ " " * write$ }
  201. if$
  202. }
  203. if$
  204. mid.sentence 'output.state :=
  205. }
  206. if$
  207. s
  208. }
  209.  
  210. % Use a colon to separate output. Used only for address/publisher
  211. % combination in book/inbook types, address/institution for manuals,
  212. % and organization:publisher for proceedings (inproceedings).
  213. %
  214. FUNCTION {output.nonnull.colon}
  215. { 's :=
  216. output.state mid.sentence =
  217. { ": " * write$ }
  218. { output.state after.block =
  219. { add.period$ write$
  220. newline$
  221. "\newblock " write$
  222. }
  223. { output.state before.all =
  224. 'write$
  225. { add.period$ " " * write$ }
  226. if$
  227. }
  228. if$
  229. mid.sentence 'output.state :=
  230. }
  231. if$
  232. s
  233. }
  234.  
  235. FUNCTION {output}
  236. { duplicate$ empty$
  237. 'pop$
  238. 'output.nonnull
  239. if$
  240. }
  241.  
  242. FUNCTION {output.colon}
  243. { duplicate$ empty$
  244. 'pop$
  245. 'output.nonnull.colon
  246. if$
  247. }
  248.  
  249. FUNCTION {output.check}
  250. { 't :=
  251. duplicate$ empty$
  252. { pop$ "empty " t * " in " * cite$ * warning$ }
  253. 'output.nonnull
  254. if$
  255. }
  256.  
  257. FUNCTION {output.check.colon}
  258. { 't :=
  259. duplicate$ empty$
  260. { pop$ "empty " t * " in " * cite$ * warning$ }
  261. 'output.nonnull.colon
  262. if$
  263. }
  264.  
  265. FUNCTION {output.year.check}
  266. { year empty$
  267. { "empty year in " cite$ * warning$ }
  268. { write$
  269. " (" year * extra.label *
  270. month empty$
  271. { ")" * }
  272. { ", " * month * ")" * }
  273. if$
  274. mid.sentence 'output.state :=
  275. }
  276. if$
  277. }
  278.  
  279.  
  280. FUNCTION {fin.entry}
  281. { add.period$
  282. write$
  283. newline$
  284. }
  285.  
  286. FUNCTION {new.block}
  287. { output.state before.all =
  288. 'skip$
  289. { after.block 'output.state := }
  290. if$
  291. }
  292.  
  293. FUNCTION {new.sentence}
  294. { output.state after.block =
  295. 'skip$
  296. { output.state before.all =
  297. 'skip$
  298. { after.sentence 'output.state := }
  299. if$
  300. }
  301. if$
  302. }
  303.  
  304. FUNCTION {not}
  305. { { #0 }
  306. { #1 }
  307. if$
  308. }
  309.  
  310. FUNCTION {and}
  311. { 'skip$
  312. { pop$ #0 }
  313. if$
  314. }
  315.  
  316. FUNCTION {or}
  317. { { pop$ #1 }
  318. 'skip$
  319. if$
  320. }
  321.  
  322. FUNCTION {new.block.checka}
  323. { empty$
  324. 'skip$
  325. 'new.block
  326. if$
  327. }
  328.  
  329. FUNCTION {new.block.checkb}
  330. { empty$
  331. swap$ empty$
  332. and
  333. 'skip$
  334. 'new.block
  335. if$
  336. }
  337.  
  338. FUNCTION {new.sentence.checka}
  339. { empty$
  340. 'skip$
  341. 'new.sentence
  342. if$
  343. }
  344.  
  345. FUNCTION {new.sentence.checkb}
  346. { empty$
  347. swap$ empty$
  348. and
  349. 'skip$
  350. 'new.sentence
  351. if$
  352. }
  353.  
  354. FUNCTION {field.or.null}
  355. { duplicate$ empty$
  356. { pop$ "" }
  357. 'skip$
  358. if$
  359. }
  360.  
  361. %
  362. % Emphasize the top string on the stack.
  363. %
  364. FUNCTION {emphasize}
  365. { duplicate$ empty$
  366. { pop$ "" }
  367. { "{\em " swap$ * "}" * }
  368. if$
  369. }
  370.  
  371. %
  372. % Emphasize the top string on the stack, but add a trailing space.
  373. %
  374. FUNCTION {emphasize.space}
  375. { duplicate$ empty$
  376. { pop$ "" }
  377. { "{\em " swap$ * "\/}" * }
  378. if$
  379. }
  380.  
  381. INTEGERS { nameptr namesleft numnames }
  382. %
  383. % Format bibliographical entries with the first author last name first,
  384. % and subsequent authors with initials followed by last name.
  385. % All names are formatted in this routine.
  386. %
  387. FUNCTION {format.names}
  388. { 's :=
  389. #1 'nameptr := % nameptr = 1;
  390. s num.names$ 'numnames := % numnames = num.name$(s);
  391. numnames 'namesleft :=
  392. { namesleft #0 > }
  393.  
  394. { nameptr #1 =
  395. {s nameptr "{vv~}{ll}{, jj}{, f.}" format.name$ 't := }
  396. {s nameptr "{f.~}{vv~}{ll}{, jj}" format.name$ 't := }
  397. if$
  398. nameptr #1 >
  399. { namesleft #1 >
  400. { ", " * t * }
  401. { numnames #2 >
  402. { "," * }
  403. 'skip$
  404. if$
  405. t "others" =
  406. { " et~al." * }
  407. { " and " * t * } % from Chicago Manual of Style
  408. if$
  409. }
  410. if$
  411. }
  412. 't
  413. if$
  414. nameptr #1 + 'nameptr := % nameptr += 1;
  415. namesleft #1 - 'namesleft := % namesleft =- 1;
  416. }
  417. while$
  418. }
  419.  
  420. FUNCTION {my.full.label}
  421. { 's :=
  422. #1 'nameptr := % nameptr = 1;
  423. s num.names$ 'numnames := % numnames = num.name$(s);
  424. numnames 'namesleft :=
  425. { namesleft #0 > }
  426.  
  427. { s nameptr "{vv~}{ll}" format.name$ 't := % get the next name
  428. nameptr #1 >
  429. { namesleft #1 >
  430. { ", " * t * }
  431. { numnames #2 >
  432. { "," * }
  433. 'skip$
  434. if$
  435. t "others" =
  436. { " et~al." * }
  437. { " and " * t * } % from Chicago Manual of Style
  438. if$
  439. }
  440. if$
  441. }
  442. 't
  443. if$
  444. nameptr #1 + 'nameptr := % nameptr += 1;
  445. namesleft #1 - 'namesleft := % namesleft =- 1;
  446. }
  447. while$
  448.  
  449. }
  450.  
  451. FUNCTION {format.names.fml}
  452. %
  453. % Format names in "familiar" format, with first initial followed by
  454. % last name. Like format.names, ALL names are formatted.
  455. %
  456. { 's :=
  457. #1 'nameptr := % nameptr = 1;
  458. s num.names$ 'numnames := % numnames = num.name$(s);
  459. numnames 'namesleft :=
  460. { namesleft #0 > }
  461.  
  462. { s nameptr "{f.~}{vv~}{ll}{, jj}" format.name$ 't :=
  463.  
  464. nameptr #1 >
  465. { namesleft #1 >
  466. { ", " * t * }
  467. { numnames #2 >
  468. { "," * }
  469. 'skip$
  470. if$
  471. t "others" =
  472. { " et~al." * }
  473. { " and " * t * }
  474. % { " \& " * t * }
  475. if$
  476. }
  477. if$
  478. }
  479. 't
  480. if$
  481. nameptr #1 + 'nameptr := % nameptr += 1;
  482. namesleft #1 - 'namesleft := % namesleft =- 1;
  483. }
  484. while$
  485. }
  486.  
  487. FUNCTION {format.authors}
  488. { author empty$
  489. { "" }
  490. { author format.names }
  491. if$
  492. }
  493.  
  494. FUNCTION {format.key}
  495. { empty$
  496. { key field.or.null }
  497. { "" }
  498. if$
  499. }
  500.  
  501. %
  502. % Format editor names for use in the "in" types: inbook, incollection,
  503. % inproceedings: first initial, then last names. When editors are the
  504. % LABEL for an entry, then format.editor is used which lists editors
  505. % by last name first.
  506. %
  507. FUNCTION {format.editors.fml}
  508. { editor empty$
  509. { "" }
  510. { editor format.names.fml
  511. editor num.names$ #1 >
  512. { " (Eds.)" * }
  513. { " (Ed.)" * }
  514. if$
  515. }
  516. if$
  517. }
  518.  
  519. %
  520. % Format editor names for use in labels, last names first.
  521. %
  522. FUNCTION {format.editors}
  523. { editor empty$
  524. { "" }
  525. { editor format.names
  526. editor num.names$ #1 >
  527. { " (Eds.)" * }
  528. { " (Ed.)" * }
  529. if$
  530. }
  531. if$
  532. }
  533.  
  534. FUNCTION {format.title}
  535. { title empty$
  536. { "" }
  537. { title "t" change.case$ }
  538. if$
  539. }
  540.  
  541. % Note that the APA style requres case changes
  542. % in article titles. The following does not
  543. % change cases. If you perfer it, uncomment the
  544. % following and comment out the above.
  545.  
  546. %FUNCTION {format.title}
  547. %{ title empty$
  548. % { "" }
  549. % { title }
  550. % if$
  551. %}
  552.  
  553. FUNCTION {n.dashify}
  554. { 't :=
  555. ""
  556. { t empty$ not }
  557. { t #1 #1 substring$ "-" =
  558. { t #1 #2 substring$ "--" = not
  559. { "--" *
  560. t #2 global.max$ substring$ 't :=
  561. }
  562. { { t #1 #1 substring$ "-" = }
  563. { "-" *
  564. t #2 global.max$ substring$ 't :=
  565. }
  566. while$
  567. }
  568. if$
  569. }
  570. { t #1 #1 substring$ *
  571. t #2 global.max$ substring$ 't :=
  572. }
  573. if$
  574. }
  575. while$
  576. }
  577.  
  578. FUNCTION {format.btitle}
  579. { edition empty$
  580. { title emphasize }
  581. { title empty$
  582. { title emphasize }
  583. { volume empty$ % gnp - check for volume, then don't need period
  584. { "{\em " title * "\/} (" * edition * ". Auflage)" * "." * }
  585. { "{\em " title * "\/} (" * edition * ". Auflage)" * }
  586. if$
  587. }
  588. if$
  589. }
  590. if$
  591. }
  592.  
  593. FUNCTION {format.emphasize.booktitle}
  594. { edition empty$
  595. { booktitle emphasize }
  596. { booktitle empty$
  597. { booktitle emphasize }
  598. { volume empty$ % gnp - extra period an error if book has a volume
  599. { "{\em " booktitle * "\/} (" * edition * " ed.)" * "." *}
  600. { "{\em " booktitle * "\/} (" * edition * " ed.)" * }
  601. if$
  602. }
  603. if$
  604. }
  605. if$
  606. }
  607.  
  608.  
  609. FUNCTION {tie.or.space.connect}
  610. { duplicate$ text.length$ #3 <
  611. { "~" }
  612. { " " }
  613. if$
  614. swap$ * *
  615. }
  616.  
  617. FUNCTION {either.or.check}
  618. { empty$
  619. 'pop$
  620. { "can't use both " swap$ * " fields in " * cite$ * warning$ }
  621. if$
  622. }
  623.  
  624. FUNCTION {format.bvolume}
  625. { volume empty$
  626. { "" }
  627. { "Volume" volume tie.or.space.connect % gnp - changed to mixed case
  628. series empty$
  629. 'skip$
  630. { " of " * series emphasize * }
  631. if$
  632. "volume and number" number either.or.check
  633. }
  634. if$
  635. }
  636.  
  637. FUNCTION {format.number.series}
  638. { volume empty$
  639. { number empty$
  640. { series field.or.null }
  641. { output.state mid.sentence =
  642. { "Number" } % gnp - changed to mixed case always
  643. { "Number" }
  644. if$
  645. number tie.or.space.connect
  646. series empty$
  647. { "there's a number but no series in " cite$ * warning$ }
  648. { " in " * series * }
  649. if$
  650. }
  651. if$
  652. }
  653. { "" }
  654. if$
  655. }
  656.  
  657. INTEGERS { multiresult }
  658.  
  659. FUNCTION {multi.page.check}
  660. { 't :=
  661. #0 'multiresult :=
  662. { multiresult not
  663. t empty$ not
  664. and
  665. }
  666. { t #1 #1 substring$
  667. duplicate$ "-" =
  668. swap$ duplicate$ "," =
  669. swap$ "+" =
  670. or or
  671. { #1 'multiresult := }
  672. { t #2 global.max$ substring$ 't := }
  673. if$
  674. }
  675. while$
  676. multiresult
  677. }
  678.  
  679. FUNCTION {format.pages}
  680. { pages empty$
  681. { "" }
  682. { pages multi.page.check
  683. { "pp.\ " pages n.dashify tie.or.space.connect } % gnp - removed ()
  684. { "pp.\ " pages tie.or.space.connect }
  685. if$
  686. }
  687. if$
  688. }
  689.  
  690. % By Young (and Spencer)
  691. % GNP - fixed bugs with missing volume, number, and/or pages
  692. %
  693. % Format journal, volume, number, pages for article types.
  694. %
  695. FUNCTION {format.jour.vol}
  696. { journal empty$
  697. { "no journal in " cite$ * warning$
  698. "" }
  699. { journal emphasize.space }
  700. if$
  701. number empty$
  702. { volume empty$
  703. { "no number and no volume in " cite$ * warning$
  704. "" * }
  705. { "~{\em " * Volume * "}" * }
  706. if$
  707. }
  708. { volume empty$
  709. {"no volume for " cite$ * warning$
  710. "~(" * number * ")" * }
  711. { "~" *
  712. volume emphasize.space
  713. "(" * number * ")" * * }
  714. if$
  715. }
  716. if$
  717. pages empty$
  718. {"page numbers missing in " cite$ * warning$
  719. "" * } % gnp - place a null string on the stack for output
  720. { duplicate$ empty$
  721. { pop$ format.pages }
  722. { ", " * pages n.dashify * } % gnp - removed pp. for articles
  723. if$
  724. }
  725. if$
  726. }
  727.  
  728. FUNCTION {format.chapter.pages}
  729. { chapter empty$
  730. 'format.pages
  731. { type empty$
  732. { "Chapter" } % gnp - changed to mixed case
  733. { type "t" change.case$ }
  734. if$
  735. chapter tie.or.space.connect
  736. pages empty$
  737. {"page numbers missing in " cite$ * warning$} % gnp - added check
  738. { ", " * format.pages * }
  739. if$
  740. }
  741. if$
  742. }
  743.  
  744. FUNCTION {format.in.ed.booktitle}
  745. { booktitle empty$
  746. { "" }
  747. { editor empty$
  748. { "In " format.emphasize.booktitle * }
  749. { "In " format.editors.fml * ", " * format.emphasize.booktitle * }
  750. if$
  751. }
  752. if$
  753. }
  754.  
  755. FUNCTION {format.thesis.type}
  756. { type empty$
  757. 'skip$
  758. { pop$
  759. type "t" change.case$
  760. }
  761. if$
  762. }
  763.  
  764. FUNCTION {format.tr.number}
  765. { type empty$
  766. { "Technical Report" }
  767. 'type
  768. if$
  769. number empty$
  770. { "t" change.case$ }
  771. { number tie.or.space.connect }
  772. if$
  773. }
  774.  
  775. FUNCTION {format.article.crossref}
  776. { "See"
  777. "\citeN{" * crossref * "}" *
  778. }
  779.  
  780. FUNCTION {format.crossref.editor}
  781. { editor #1 "{vv~}{ll}" format.name$
  782. editor num.names$ duplicate$
  783. #2 >
  784. { pop$ " et~al." * }
  785. { #2 <
  786. 'skip$
  787. { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
  788. { " et~al." * }
  789. { " and " * editor #2 "{vv~}{ll}" format.name$ * }
  790. if$
  791. }
  792. if$
  793. }
  794. if$
  795. }
  796.  
  797. FUNCTION {format.book.crossref}
  798. { volume empty$
  799. { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
  800. "In "
  801. }
  802. { "Volume" volume tie.or.space.connect % gnp - changed to mixed case
  803. " of " *
  804. }
  805. if$
  806. editor empty$
  807. editor field.or.null author field.or.null =
  808. or
  809. { key empty$
  810. { series empty$
  811. { "need editor, key, or series for " cite$ * " to crossref " *
  812. crossref * warning$
  813. "" *
  814. }
  815. { "{\em " * series * "\/}" * }
  816. if$
  817. }
  818. { key * }
  819. if$
  820. }
  821. { format.crossref.editor * }
  822. if$
  823. " \citeN{" * crossref * "}" *
  824. }
  825.  
  826. FUNCTION {format.incoll.inproc.crossref}
  827. { "See"
  828. " \citeN{" * crossref * "}" *
  829. }
  830.  
  831. % format.lab.names:
  832. %
  833. % determines "short" names for the abbreviated author information.
  834. % "Long" labels are created in calc.label, using the routine my.full.label
  835. % to format author and editor fields.
  836. %
  837. % There are 4 cases for labels. (n=3 in the example)
  838. % a) one author Foo
  839. % b) one to n Foo, Bar and Baz
  840. % c) use of "and others" Foo, Bar et al.
  841. % d) more than n Foo et al.
  842. %
  843. FUNCTION {format.lab.names}
  844. { 's :=
  845. s num.names$ 'numnames :=
  846. numnames #2 > % change number to number of others allowed before
  847. % forcing "et al".
  848. { s #1 "{vv~}{ll}" format.name$ " et~al." * }
  849. {
  850. numnames #1 - 'namesleft :=
  851. #2 'nameptr :=
  852. s #1 "{vv~}{ll}" format.name$
  853. { namesleft #0 > }
  854. { nameptr numnames =
  855. { s nameptr "{ff }{vv }{ll}{ jj}" format.name$ "others" =
  856. { " et~al." * }
  857. { " and " * s nameptr "{vv~}{ll}" format.name$ * }
  858. if$
  859. }
  860. { ", " * s nameptr "{vv~}{ll}" format.name$ * }
  861. if$
  862. nameptr #1 + 'nameptr :=
  863. namesleft #1 - 'namesleft :=
  864. }
  865. while$
  866. }
  867. if$
  868. }
  869.  
  870. FUNCTION {author.key.label}
  871. { author empty$
  872. { key empty$
  873. { "no key, author in " cite$ * warning$
  874. cite$ #1 #3 substring$ }
  875. 'key
  876. if$
  877. }
  878. { author format.lab.names }
  879. if$
  880. }
  881.  
  882. FUNCTION {editor.key.label}
  883. { editor empty$
  884. { key empty$
  885. { "no key, editor in " cite$ * warning$
  886. cite$ #1 #3 substring$ }
  887. 'key
  888. if$
  889. }
  890. { editor format.lab.names }
  891. if$
  892. }
  893.  
  894. FUNCTION {author.key.organization.label}
  895. %
  896. % added - gnp. Provide label formatting by organization if author is null.
  897. %
  898. { author empty$
  899. { organization empty$
  900. { key empty$
  901. { "no key, author or organization in " cite$ * warning$
  902. cite$ #1 #3 substring$ }
  903. 'key
  904. if$
  905. }
  906. { organization }
  907. if$
  908. }
  909. { author format.lab.names }
  910. if$
  911. }
  912.  
  913. FUNCTION {editor.key.organization.label}
  914. %
  915. % added - gnp. Provide label formatting by organization if editor is null.
  916. %
  917. { editor empty$
  918. { organization empty$
  919. { key empty$
  920. { "no key, editor or organization in " cite$ * warning$
  921. cite$ #1 #3 substring$ }
  922. 'key
  923. if$
  924. }
  925. { organization }
  926. if$
  927. }
  928. { editor format.lab.names }
  929. if$
  930. }
  931.  
  932. FUNCTION {author.editor.key.label}
  933. { author empty$
  934. { editor empty$
  935. { key empty$
  936. { "no key, author, or editor in " cite$ * warning$
  937. cite$ #1 #3 substring$ }
  938. 'key
  939. if$
  940. }
  941. { editor format.lab.names }
  942. if$
  943. }
  944. { author format.lab.names }
  945. if$
  946. }
  947.  
  948. FUNCTION {calc.label}
  949. %
  950. % Changed - GNP. See also author.organization.sort, editor.organization.sort
  951. % Form label for BibTeX entry. The classification of which fields are used
  952. % for which type of entry (book, inbook, etc.) are taken from alpha.bst.
  953. % The change here from newapa is to also include organization as a
  954. % citation label if author or editor is missing.
  955. %
  956. { type$ "book" =
  957. type$ "inbook" =
  958. or
  959. 'author.editor.key.label
  960. { type$ "proceedings" =
  961. 'editor.key.organization.label
  962. { type$ "manual" =
  963. 'author.key.organization.label
  964. 'author.key.label
  965. if$
  966. }
  967. if$
  968. }
  969. if$
  970.  
  971. author empty$ % generate the full label citation information.
  972. { editor empty$
  973. { organization empty$
  974. { "no author, editor, or organization in " cite$ * warning$
  975. "??" }
  976. { organization }
  977. if$
  978. }
  979. { editor my.full.label }
  980. if$
  981. }
  982. { author my.full.label }
  983. if$
  984.  
  985. % leave label on the stack, to be popped when required.
  986.  
  987. "}{" * swap$ * "}{" *
  988. % year field.or.null purify$ #-1 #4 substring$ *
  989. %
  990. % save the year for sort processing afterwards (adding a, b, c, etc.)
  991. year field.or.null purify$ #-1 #4 substring$
  992. 'label.year :=
  993. }
  994.  
  995. FUNCTION {output.bibitem}
  996. { newline$
  997.  
  998. "\bibitem[\protect\citeauthoryear{" write$
  999. calc.label write$
  1000. sort.year write$
  1001. "}]{" write$
  1002.  
  1003. cite$ write$
  1004. "}" write$
  1005. newline$
  1006. ""
  1007. before.all 'output.state :=
  1008. }
  1009.  
  1010. FUNCTION {article}
  1011. { output.bibitem
  1012. format.authors
  1013. "author" output.check
  1014. author format.key output % added
  1015. output.year.check % added
  1016. new.block
  1017. format.title
  1018. "title" output.check
  1019. new.block
  1020. crossref missing$
  1021. { format.jour.vol output
  1022. }
  1023. { format.article.crossref output.nonnull
  1024. format.pages output
  1025. }
  1026. if$
  1027. new.block
  1028. note output
  1029. fin.entry
  1030. }
  1031.  
  1032. FUNCTION {book}
  1033. { output.bibitem
  1034. author empty$
  1035. { format.editors
  1036. "author and editor" output.check }
  1037. { format.authors
  1038. output.nonnull
  1039. crossref missing$
  1040. { "author and editor" editor either.or.check }
  1041. 'skip$
  1042. if$
  1043. }
  1044. if$
  1045. output.year.check % added
  1046. new.block
  1047. format.btitle
  1048. "title" output.check
  1049. crossref missing$
  1050. { format.bvolume output
  1051. new.block
  1052. format.number.series output
  1053. new.sentence
  1054. address output
  1055. publisher "publisher" output.check.colon
  1056. }
  1057. { new.block
  1058. format.book.crossref output.nonnull
  1059. }
  1060. if$
  1061. new.block
  1062. note output
  1063. fin.entry
  1064. }
  1065.  
  1066. FUNCTION {booklet}
  1067. { output.bibitem
  1068. format.authors output
  1069. author format.key output % added
  1070. output.year.check % added
  1071. new.block
  1072. format.title
  1073. "title" output.check
  1074. new.block
  1075. howpublished output
  1076. address output
  1077. new.block
  1078. note output
  1079. fin.entry
  1080. }
  1081.  
  1082. FUNCTION {inbook}
  1083. { output.bibitem
  1084. author empty$
  1085. { format.editors
  1086. "author and editor" output.check
  1087. }
  1088. { format.authors output.nonnull
  1089. crossref missing$
  1090. { "author and editor" editor either.or.check }
  1091. 'skip$
  1092. if$
  1093. }
  1094. if$
  1095. output.year.check % added
  1096. new.block
  1097. format.btitle
  1098. "title" output.check
  1099. crossref missing$
  1100. { format.bvolume output
  1101. format.chapter.pages
  1102. "chapter and pages" output.check
  1103. new.block
  1104. format.number.series output
  1105. new.sentence
  1106. address output
  1107. publisher
  1108. "publisher" output.check.colon
  1109. }
  1110. { format.chapter.pages "chapter and pages" output.check
  1111. new.block
  1112. format.book.crossref output.nonnull
  1113. }
  1114. if$
  1115. new.block
  1116. note output
  1117. fin.entry
  1118. }
  1119.  
  1120. FUNCTION {incollection}
  1121. { output.bibitem
  1122. format.authors
  1123. "author" output.check
  1124. author format.key output % added
  1125. output.year.check % added
  1126. new.block
  1127. format.title
  1128. "title" output.check
  1129. new.block
  1130. crossref missing$
  1131. { format.in.ed.booktitle
  1132. "booktitle" output.check
  1133. format.bvolume output
  1134. format.number.series output
  1135. format.chapter.pages output % gnp - was special.output.nonnull
  1136. % left out comma before page numbers
  1137. new.sentence
  1138. address output
  1139. publisher "publisher" output.check.colon
  1140. }
  1141. { format.incoll.inproc.crossref
  1142. output.nonnull
  1143. format.chapter.pages output
  1144. }
  1145. if$
  1146. new.block
  1147. note output
  1148. fin.entry
  1149. }
  1150.  
  1151. FUNCTION {inproceedings}
  1152. { output.bibitem
  1153. format.authors
  1154. "author" output.check
  1155. author format.key output % added
  1156. output.year.check % added
  1157. new.block
  1158. format.title
  1159. "title" output.check
  1160. new.block
  1161. crossref missing$
  1162. { format.in.ed.booktitle
  1163. "booktitle" output.check
  1164. format.bvolume output
  1165. format.number.series output
  1166. address output
  1167. format.pages output
  1168. new.sentence
  1169. organization output
  1170. publisher output.colon
  1171. }
  1172. { format.incoll.inproc.crossref output.nonnull
  1173. format.pages output
  1174. }
  1175. if$
  1176. new.block
  1177. note output
  1178. fin.entry
  1179. }
  1180.  
  1181. FUNCTION {conference} { inproceedings }
  1182.  
  1183. FUNCTION {manual}
  1184. { output.bibitem
  1185. author empty$
  1186. { editor empty$
  1187. { organization "organization" output.check
  1188. organization format.key output } % if all else fails, use key
  1189. { format.editors "author and editor" output.check }
  1190. if$
  1191. }
  1192. { format.authors output.nonnull }
  1193. if$
  1194. output.year.check % added
  1195. new.block
  1196. format.btitle
  1197. "title" output.check
  1198. organization address new.block.checkb
  1199. % Reversed the order of "address" and "organization", added the ":".
  1200. address output
  1201. organization "organization" output.check.colon
  1202. % address output
  1203. % ":" output
  1204. % organization output
  1205. new.block
  1206. note output
  1207. fin.entry
  1208. }
  1209.  
  1210. FUNCTION {mastersthesis}
  1211. { output.bibitem
  1212. format.authors
  1213. "author" output.check
  1214. author format.key output % added
  1215. output.year.check % added
  1216. new.block
  1217. format.title
  1218. "title" output.check
  1219. new.block
  1220. "Master's thesis" format.thesis.type output.nonnull
  1221. school "school" output.check
  1222. address output
  1223. new.block
  1224. note output
  1225. fin.entry
  1226. }
  1227.  
  1228. FUNCTION {misc}
  1229. { output.bibitem
  1230. format.authors output
  1231. author format.key output % added
  1232. output.year.check % added
  1233. title howpublished new.block.checkb
  1234. format.btitle output
  1235. new.block
  1236. howpublished output
  1237. new.block
  1238. note output
  1239. fin.entry
  1240. }
  1241.  
  1242. FUNCTION {phdthesis}
  1243. { output.bibitem
  1244. format.authors
  1245. "author" output.check
  1246. author format.key output % added
  1247. output.year.check % added
  1248. new.block
  1249. format.btitle
  1250. "title" output.check
  1251. new.block
  1252. "Ph.\ D. thesis" format.thesis.type output.nonnull
  1253. school "school" output.check
  1254. address output
  1255. new.block
  1256. note output
  1257. fin.entry
  1258. }
  1259.  
  1260. FUNCTION {proceedings}
  1261. { output.bibitem
  1262. editor empty$
  1263. { organization output
  1264. organization format.key output } % gnp - changed from author format.key
  1265. { format.editors output.nonnull }
  1266. if$
  1267. % author format.key output % gnp - removed (should be either
  1268. % editor or organization
  1269. output.year.check % added (newapa)
  1270. new.block
  1271. format.btitle
  1272. "title" output.check
  1273. format.bvolume output
  1274. format.number.series output
  1275. address output
  1276. new.sentence
  1277. organization output
  1278. publisher output.colon
  1279. new.block
  1280. note output
  1281. fin.entry
  1282. }
  1283.  
  1284. FUNCTION {techreport}
  1285. { output.bibitem
  1286. format.authors
  1287. "author" output.check
  1288. author format.key output % added
  1289. output.year.check % added
  1290. new.block
  1291. format.title
  1292. "title" output.check
  1293. new.block
  1294. format.tr.number output.nonnull
  1295. institution
  1296. "institution" output.check
  1297. address output
  1298. new.block
  1299. note output
  1300. fin.entry
  1301. }
  1302.  
  1303. FUNCTION {unpublished}
  1304. { output.bibitem
  1305. format.authors
  1306. "author" output.check
  1307. author format.key output % added
  1308. output.year.check % added
  1309. new.block
  1310. format.title
  1311. "title" output.check
  1312. new.block
  1313. note "note" output.check
  1314. fin.entry
  1315. }
  1316.  
  1317. FUNCTION {default.type} { misc }
  1318.  
  1319. MACRO {jan} {"January"}
  1320.  
  1321. MACRO {feb} {"February"}
  1322.  
  1323. MACRO {mar} {"March"}
  1324.  
  1325. MACRO {apr} {"April"}
  1326.  
  1327. MACRO {may} {"May"}
  1328.  
  1329. MACRO {jun} {"June"}
  1330.  
  1331. MACRO {jul} {"July"}
  1332.  
  1333. MACRO {aug} {"August"}
  1334.  
  1335. MACRO {sep} {"September"}
  1336.  
  1337. MACRO {oct} {"October"}
  1338.  
  1339. MACRO {nov} {"November"}
  1340.  
  1341. MACRO {dec} {"December"}
  1342.  
  1343. MACRO {acmcs} {"ACM Computing Surveys"}
  1344.  
  1345. MACRO {acta} {"Acta Informatica"}
  1346.  
  1347. MACRO {ai} {"Artificial Intelligence"}
  1348.  
  1349. MACRO {cacm} {"Communications of the ACM"}
  1350.  
  1351. MACRO {ibmjrd} {"IBM Journal of Research and Development"}
  1352.  
  1353. MACRO {ibmsj} {"IBM Systems Journal"}
  1354.  
  1355. MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
  1356.  
  1357. MACRO {ieeetc} {"IEEE Transactions on Computers"}
  1358.  
  1359. MACRO {ieeetcad}
  1360. {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
  1361.  
  1362. MACRO {ipl} {"Information Processing Letters"}
  1363.  
  1364. MACRO {jacm} {"Journal of the ACM"}
  1365.  
  1366. MACRO {jcss} {"Journal of Computer and System Sciences"}
  1367.  
  1368. MACRO {scp} {"Science of Computer Programming"}
  1369.  
  1370. MACRO {sicomp} {"SIAM Journal on Computing"}
  1371.  
  1372. MACRO {tocs} {"ACM Transactions on Computer Systems"}
  1373.  
  1374. MACRO {tods} {"ACM Transactions on Database Systems"}
  1375.  
  1376. MACRO {tog} {"ACM Transactions on Graphics"}
  1377.  
  1378. MACRO {toms} {"ACM Transactions on Mathematical Software"}
  1379.  
  1380. MACRO {toois} {"ACM Transactions on Office Information Systems"}
  1381.  
  1382. MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
  1383.  
  1384. MACRO {tcs} {"Theoretical Computer Science"}
  1385.  
  1386. READ
  1387.  
  1388. FUNCTION {sortify}
  1389. { purify$
  1390. "l" change.case$
  1391. }
  1392.  
  1393. INTEGERS { len }
  1394.  
  1395. FUNCTION {chop.word}
  1396. { 's :=
  1397. 'len :=
  1398. s #1 len substring$ =
  1399. { s len #1 + global.max$ substring$ }
  1400. 's
  1401. if$
  1402. }
  1403.  
  1404.  
  1405.  
  1406. FUNCTION {sort.format.names}
  1407. { 's :=
  1408. #1 'nameptr :=
  1409. ""
  1410. s num.names$ 'numnames :=
  1411. numnames 'namesleft :=
  1412. { namesleft #0 > }
  1413. { nameptr #1 >
  1414. { " " * }
  1415. 'skip$
  1416. if$
  1417. s nameptr "{vv{ } }{ll{ }}{ f{ }}{ jj{ }}" format.name$ 't :=
  1418. nameptr numnames = t "others" = and
  1419. { " et~al" * }
  1420. { t sortify * }
  1421. if$
  1422. nameptr #1 + 'nameptr :=
  1423. namesleft #1 - 'namesleft :=
  1424. }
  1425. while$
  1426. }
  1427.  
  1428. FUNCTION {sort.format.title}
  1429. { 't :=
  1430. "A " #2
  1431. "An " #3
  1432. "The " #4 t chop.word
  1433. chop.word
  1434. chop.word
  1435. sortify
  1436. #1 global.max$ substring$
  1437. }
  1438.  
  1439. FUNCTION {author.sort}
  1440. { author empty$
  1441. { key empty$
  1442. { "to sort, need author or key in " cite$ * warning$
  1443. "" }
  1444. { key sortify }
  1445. if$
  1446. }
  1447. { author sort.format.names }
  1448. if$
  1449. }
  1450.  
  1451. FUNCTION {editor.sort}
  1452. { editor empty$
  1453. { key empty$
  1454. { "to sort, need editor or key in " cite$ * warning$
  1455. ""
  1456. }
  1457. { key sortify }
  1458. if$
  1459. }
  1460. { editor sort.format.names }
  1461. if$
  1462. }
  1463.  
  1464. FUNCTION {author.editor.sort}
  1465. { author empty$
  1466. { "missing author in " cite$ * warning$
  1467. editor empty$
  1468. { key empty$
  1469. { "to sort, need author, editor, or key in " cite$ * warning$
  1470. ""
  1471. }
  1472. { key sortify }
  1473. if$
  1474. }
  1475. { editor sort.format.names }
  1476. if$
  1477. }
  1478. { author sort.format.names }
  1479. if$
  1480. }
  1481.  
  1482. FUNCTION {author.organization.sort}
  1483. %
  1484. % added - GNP. Stack author or organization for sorting (from alpha.bst).
  1485. % Unlike alpha.bst, we need entire names, not abbreviations
  1486. %
  1487. { author empty$
  1488. { organization empty$
  1489. { key empty$
  1490. { "to sort, need author, organization, or key in " cite$ * warning$
  1491. ""
  1492. }
  1493. { key sortify }
  1494. if$
  1495. }
  1496. { organization sortify }
  1497. if$
  1498. }
  1499. { author sort.format.names }
  1500. if$
  1501. }
  1502.  
  1503. FUNCTION {editor.organization.sort}
  1504. %
  1505. % added - GNP. Stack editor or organization for sorting (from alpha.bst).
  1506. % Unlike alpha.bst, we need entire names, not abbreviations
  1507. %
  1508. { editor empty$
  1509. { organization empty$
  1510. { key empty$
  1511. { "to sort, need editor, organization, or key in " cite$ * warning$
  1512. ""
  1513. }
  1514. { key sortify }
  1515. if$
  1516. }
  1517. { organization sortify }
  1518. if$
  1519. }
  1520. { editor sort.format.names }
  1521. if$
  1522. }
  1523.  
  1524. FUNCTION {presort}
  1525. %
  1526. % Presort creates the bibentry's label via a call to calc.label, and then
  1527. % sorts the entries based on entry type. Chicago.bst adds support for
  1528. % including organizations as the sort key; the following is stolen from
  1529. % alpha.bst.
  1530. %
  1531. { calc.label sortify % recalculate bibitem label
  1532. year field.or.null purify$ #-1 #4 substring$ * % add year
  1533. " "
  1534. *
  1535. type$ "book" =
  1536. type$ "inbook" =
  1537. or
  1538. 'author.editor.sort
  1539. { type$ "proceedings" =
  1540. 'editor.organization.sort
  1541. { type$ "manual" =
  1542. 'author.organization.sort
  1543. 'author.sort
  1544. if$
  1545. }
  1546. if$
  1547. }
  1548. if$
  1549. #1 entry.max$ substring$ % added for newapa
  1550. 'sort.label := % added for newapa
  1551. sort.label % added for newapa
  1552. *
  1553. " "
  1554. *
  1555. title field.or.null
  1556. sort.format.title
  1557. *
  1558. #1 entry.max$ substring$
  1559. 'sort.key$ :=
  1560. }
  1561.  
  1562. ITERATE {presort}
  1563.  
  1564. SORT % by label, year, author/editor, title
  1565.  
  1566. STRINGS { last.label next.extra }
  1567.  
  1568. INTEGERS { last.extra.num }
  1569.  
  1570. FUNCTION {initialize.extra.label.stuff}
  1571. { #0 int.to.chr$ 'last.label :=
  1572. "" 'next.extra :=
  1573. #0 'last.extra.num :=
  1574. }
  1575.  
  1576. FUNCTION {forward.pass}
  1577. %
  1578. % Pass through all entries, comparing current entry to last one.
  1579. % Need to concatenate year to the stack (done by calc.label) to determine
  1580. % if two entries are the same (see presort)
  1581. %
  1582. { last.label
  1583. calc.label year field.or.null purify$ #-1 #4 substring$ * % add year
  1584. #1 entry.max$ substring$ = % are they equal?
  1585. { last.extra.num #1 + 'last.extra.num :=
  1586. last.extra.num int.to.chr$ 'extra.label :=
  1587. }
  1588. { "a" chr.to.int$ 'last.extra.num :=
  1589. "" 'extra.label :=
  1590. calc.label year field.or.null purify$ #-1 #4 substring$ * % add year
  1591. #1 entry.max$ substring$ 'last.label := % assign to last.label
  1592. }
  1593. if$
  1594. }
  1595.  
  1596. FUNCTION {reverse.pass}
  1597. { next.extra "b" =
  1598. { "a" 'extra.label := }
  1599. 'skip$
  1600. if$
  1601. label.year extra.label * 'sort.year :=
  1602. extra.label 'next.extra :=
  1603. }
  1604.  
  1605. EXECUTE {initialize.extra.label.stuff}
  1606.  
  1607. ITERATE {forward.pass}
  1608.  
  1609. REVERSE {reverse.pass}
  1610.  
  1611. FUNCTION {bib.sort.order}
  1612. { sort.label
  1613. " "
  1614. *
  1615. year field.or.null sortify
  1616. *
  1617. " "
  1618. *
  1619. title field.or.null
  1620. sort.format.title
  1621. *
  1622. #1 entry.max$ substring$
  1623. 'sort.key$ :=
  1624. }
  1625.  
  1626. ITERATE {bib.sort.order}
  1627.  
  1628. SORT % by sort.label, year, title --- giving final bib. order.
  1629.  
  1630. FUNCTION {begin.bib}
  1631.  
  1632. { preamble$ empty$
  1633. 'skip$
  1634. { preamble$ write$ newline$ }
  1635. if$
  1636. "\begin{thebibliography}{}" write$ newline$
  1637. }
  1638.  
  1639.  
  1640. EXECUTE {begin.bib}
  1641.  
  1642. EXECUTE {init.state.consts}
  1643.  
  1644. ITERATE {call.type$}
  1645.  
  1646. FUNCTION {end.bib}
  1647. { newline$
  1648. "\end{thebibliography}" write$ newline$
  1649. }
  1650.  
  1651. EXECUTE {end.bib}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement