Guest User

chicago-new.bst

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