chicago2.bst 37 KB

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