agsm.bst 25 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354
  1. % BibTeX standard bibliography style `agsm' (one of the harvard family)
  2. % version 0.99a for BibTeX versions 0.99a or later, LaTeX version 2.09.
  3. % Copyright (C) 1991, all rights reserved.
  4. % Copying of this file is authorized only if either
  5. % (1) you make absolutely no changes to your copy, including name, or
  6. % (2) if you do make changes, you name it something other than
  7. % btxbst.doc, plain.bst, unsrt.bst, alpha.bst, abbrv.bst, agsm.bst,
  8. % dcu.bst or kluwer.bst.
  9. % This restriction helps ensure that all standard styles are identical.
  10. % The file harvard.tex has the documentation for this style.
  11. % ACKNOWLEDGEMENT:
  12. % This document is a modified version of alpha.bst to which it owes much of
  13. % its functionality.
  14. % AUTHOR
  15. % Peter Williams, Key Centre for Design Quality, Sydney University
  16. % e-mail: [email protected]
  17. ENTRY
  18. { address
  19. author
  20. booktitle
  21. chapter
  22. edition
  23. editor
  24. howpublished
  25. institution
  26. journal
  27. key
  28. month
  29. note
  30. number
  31. organization
  32. pages
  33. publisher
  34. school
  35. series
  36. title
  37. type
  38. URL
  39. volume
  40. year
  41. }
  42. { field.used etal.allowed etal.required} %%%XXX change
  43. { extra.label sort.label list.year }
  44. INTEGERS { output.state before.all mid.sentence after.sentence after.block }
  45. FUNCTION {init.state.consts}
  46. { #0 'before.all :=
  47. #1 'mid.sentence :=
  48. #2 'after.sentence :=
  49. #3 'after.block :=
  50. }
  51. STRINGS { s t f }
  52. FUNCTION {output.nonnull}
  53. { 's :=
  54. output.state mid.sentence =
  55. { ", " * write$ }
  56. { output.state after.block =
  57. { add.period$ write$
  58. newline$
  59. "\newblock " write$
  60. }
  61. { output.state before.all =
  62. 'write$
  63. { add.period$ " " * write$ }
  64. if$
  65. }
  66. if$
  67. mid.sentence 'output.state :=
  68. }
  69. if$
  70. s
  71. }
  72. FUNCTION {output}
  73. { duplicate$ empty$
  74. 'pop$
  75. 'output.nonnull
  76. if$
  77. }
  78. FUNCTION {output.check}
  79. { 't :=
  80. duplicate$ empty$
  81. { pop$ "empty " t * " in " * cite$ * warning$ }
  82. 'output.nonnull
  83. if$
  84. }
  85. FUNCTION {item.check}
  86. { 't :=
  87. empty$
  88. { "empty " t * " in " * cite$ * warning$ }
  89. { skip$ }
  90. if$
  91. }
  92. FUNCTION {fin.entry}
  93. { add.period$
  94. write$
  95. newline$
  96. }
  97. FUNCTION {new.block}
  98. { output.state before.all =
  99. 'skip$
  100. { after.block 'output.state := }
  101. if$
  102. }
  103. FUNCTION {not}
  104. { { #0 }
  105. { #1 }
  106. if$
  107. }
  108. FUNCTION {and}
  109. { 'skip$
  110. { pop$ #0 }
  111. if$
  112. }
  113. FUNCTION {or}
  114. { { pop$ #1 }
  115. 'skip$
  116. if$
  117. }
  118. FUNCTION {field.or.null}
  119. { duplicate$ empty$
  120. { pop$ "" }
  121. 'skip$
  122. if$
  123. }
  124. FUNCTION {emphasize}
  125. { duplicate$ empty$
  126. { pop$ "" }
  127. { "{\em " swap$ * "}" * }
  128. if$
  129. }
  130. FUNCTION {embolden}
  131. { duplicate$ empty$
  132. { pop$ "" }
  133. { "{\bf " swap$ * "}" * }
  134. if$
  135. }
  136. FUNCTION {quote}
  137. { duplicate$ empty$
  138. { pop$ "" }
  139. { "`" swap$ * "'" * }
  140. if$
  141. }
  142. FUNCTION {write.url}
  143. { URL empty$
  144. { skip$ }
  145. { "\newline\harvardurl{" URL * "}" * write$ newline$ }
  146. if$
  147. }
  148. INTEGERS { nameptr namesleft numnames }
  149. FUNCTION {format.names}
  150. { 's :=
  151. 'f :=
  152. #1 'nameptr :=
  153. s num.names$ 'numnames :=
  154. numnames 'namesleft :=
  155. { namesleft #0 > }
  156. { s nameptr f format.name$ 't :=
  157. nameptr #1 >
  158. { namesleft #1 >
  159. { ", " * t * }
  160. { t "others" =
  161. { " et~al." * }
  162. { " \harvardand\ " * t * }
  163. if$
  164. }
  165. if$
  166. }
  167. 't
  168. if$
  169. nameptr #1 + 'nameptr :=
  170. namesleft #1 - 'namesleft :=
  171. }
  172. while$
  173. }
  174. FUNCTION {format.authors}
  175. { author empty$
  176. { "" }
  177. { "{vv~}{ll}{, jj}{, f.}" author format.names }
  178. if$
  179. }
  180. FUNCTION {format.editors}
  181. { editor empty$
  182. { "" }
  183. { "{vv~}{ll}{, jj}{, f.}" editor format.names
  184. editor num.names$ #1 >
  185. { ", eds" * }
  186. { ", ed." * }
  187. if$
  188. }
  189. if$
  190. }
  191. FUNCTION {format.editors.reverse}
  192. { editor empty$
  193. { "" }
  194. { "{f.~}{vv~}{ll}{, jj}" editor format.names
  195. editor num.names$ #1 >
  196. { ", eds" * }
  197. { ", ed." * }
  198. if$
  199. }
  200. if$
  201. }
  202. FUNCTION {format.title}
  203. { title empty$
  204. { "" }
  205. { title "t" change.case$ }
  206. if$
  207. }
  208. FUNCTION {n.dashify}
  209. { 't :=
  210. ""
  211. { t empty$ not }
  212. { t #1 #1 substring$ "-" =
  213. { t #1 #2 substring$ "--" = not
  214. { "--" *
  215. t #2 global.max$ substring$ 't :=
  216. }
  217. { { t #1 #1 substring$ "-" = }
  218. { "-" *
  219. t #2 global.max$ substring$ 't :=
  220. }
  221. while$
  222. }
  223. if$
  224. }
  225. { t #1 #1 substring$ *
  226. t #2 global.max$ substring$ 't :=
  227. }
  228. if$
  229. }
  230. while$
  231. }
  232. FUNCTION {format.btitle}
  233. { title emphasize
  234. }
  235. FUNCTION {tie.or.space.connect}
  236. { duplicate$ text.length$ #3 <
  237. { "~" }
  238. { " " }
  239. if$
  240. swap$ * *
  241. }
  242. FUNCTION {either.or.check}
  243. { empty$
  244. 'pop$
  245. { "can't use both " swap$ * " fields in " * cite$ * warning$ }
  246. if$
  247. }
  248. FUNCTION {format.bvolume}
  249. { volume empty$
  250. { "" }
  251. { "Vol." volume tie.or.space.connect
  252. series empty$
  253. 'skip$
  254. { " of " * series emphasize * }
  255. if$
  256. "volume and number" number either.or.check
  257. }
  258. if$
  259. }
  260. FUNCTION {format.number.series}
  261. { volume empty$
  262. { number empty$
  263. { series field.or.null }
  264. { output.state mid.sentence =
  265. { "number" }
  266. { "Number" }
  267. if$
  268. number tie.or.space.connect
  269. series empty$
  270. { "there's a number but no series in " cite$ * warning$ }
  271. { " {\em in} " * series quote * }
  272. if$
  273. }
  274. if$
  275. }
  276. { "" }
  277. if$
  278. }
  279. FUNCTION {format.edition}
  280. { edition empty$
  281. { "" }
  282. { output.state mid.sentence =
  283. { edition "l" change.case$ " edn" * }
  284. { edition "t" change.case$ " edn" * }
  285. if$
  286. }
  287. if$
  288. }
  289. INTEGERS { multiresult }
  290. FUNCTION {multi.page.check}
  291. { 't :=
  292. #0 'multiresult :=
  293. { multiresult not
  294. t empty$ not
  295. and
  296. }
  297. { t #1 #1 substring$
  298. duplicate$ "-" =
  299. swap$ duplicate$ "," =
  300. swap$ "+" =
  301. or or
  302. { #1 'multiresult := }
  303. { t #2 global.max$ substring$ 't := }
  304. if$
  305. }
  306. while$
  307. multiresult
  308. }
  309. FUNCTION {format.pages}
  310. { pages empty$
  311. { "" }
  312. { pages multi.page.check
  313. { "pp.~" pages n.dashify * }
  314. { "p.~" pages * }
  315. if$
  316. }
  317. if$
  318. }
  319. FUNCTION {format.vol.num.pages}
  320. { volume embolden field.or.null
  321. number empty$
  322. 'skip$
  323. { "(" number * ")" * *
  324. volume empty$
  325. { "there's a number but no volume in " cite$ * warning$ }
  326. 'skip$
  327. if$
  328. }
  329. if$
  330. pages empty$
  331. 'skip$
  332. { duplicate$ empty$
  333. { pop$ format.pages }
  334. { ",~" * pages n.dashify * }
  335. if$
  336. }
  337. if$
  338. }
  339. FUNCTION {format.chapter.pages}
  340. { chapter empty$
  341. 'format.pages
  342. { type empty$
  343. { "chapter" }
  344. { type "l" change.case$ }
  345. if$
  346. chapter tie.or.space.connect
  347. pages empty$
  348. 'skip$
  349. { ", " * format.pages * }
  350. if$
  351. }
  352. if$
  353. }
  354. FUNCTION {format.in.ed.booktitle}
  355. { booktitle empty$
  356. { "" }
  357. { editor empty$
  358. { "{\em in} " booktitle quote * }
  359. { "{\em in} " format.editors.reverse * ", " * booktitle quote * }
  360. if$
  361. }
  362. if$
  363. }
  364. FUNCTION {empty.misc.check}
  365. { author empty$ title empty$ howpublished empty$
  366. month empty$ year empty$ note empty$
  367. and and and and and
  368. key empty$ not and
  369. { "all relevant fields are empty in " cite$ * warning$ }
  370. 'skip$
  371. if$
  372. }
  373. FUNCTION {format.thesis.type}
  374. { type empty$
  375. 'skip$
  376. { pop$
  377. type "t" change.case$
  378. }
  379. if$
  380. }
  381. FUNCTION {format.tr.number}
  382. { type empty$
  383. { "Technical Report" }
  384. 'type
  385. if$
  386. number empty$
  387. { "t" change.case$ }
  388. { number tie.or.space.connect }
  389. if$
  390. }
  391. FUNCTION {format.article.crossref}
  392. { key empty$
  393. { journal empty$
  394. { "need key or journal for " cite$ * " to crossref " * crossref *
  395. warning$
  396. ""
  397. }
  398. { "in {\em " journal * "\/} \cite{" * crossref * "}" *}
  399. if$
  400. }
  401. { "{\em in} \citeasnoun{" crossref * "}" * }
  402. if$
  403. }
  404. FUNCTION {format.book.crossref}
  405. { volume empty$
  406. { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
  407. "in "
  408. }
  409. { "Vol." volume tie.or.space.connect
  410. " of " *
  411. }
  412. if$
  413. editor empty$
  414. editor field.or.null author field.or.null =
  415. or
  416. { key empty$
  417. { series empty$
  418. { "need editor, key, or series for " cite$ * " to crossref " *
  419. crossref * warning$
  420. "" *
  421. }
  422. { "{\em " * series * "\/} \cite{" * crossref * "}" *}
  423. if$
  424. }
  425. { " \citeasnoun{" * crossref * "}" * }
  426. if$
  427. }
  428. { " \citeasnoun{" * crossref * "}" * }
  429. if$
  430. }
  431. FUNCTION {format.incoll.inproc.crossref}
  432. { editor empty$
  433. editor field.or.null author field.or.null =
  434. or
  435. { key empty$
  436. { booktitle empty$
  437. { "need editor, key, or booktitle for " cite$ * " to crossref " *
  438. crossref * warning$
  439. ""
  440. }
  441. { "in {\em " booktitle * "\/}" * " \cite{" * crossref * "}" *}
  442. if$
  443. }
  444. { "{\em in} \citeasnoun{" crossref * "}" * }
  445. if$
  446. }
  447. { "{\em in} \citeasnoun{" crossref * "}" * }
  448. if$
  449. }
  450. INTEGERS { len }
  451. FUNCTION {chop.word}
  452. { 's :=
  453. 'len :=
  454. s #1 len substring$ =
  455. { s len #1 + global.max$ substring$ }
  456. 's
  457. if$
  458. }
  459. INTEGERS { ind tsslen }
  460. STRINGS { tss ret rss istr }
  461. FUNCTION {replace.substring}{
  462. 'rss :=
  463. 'tss :=
  464. 'istr :=
  465. "" 'ret :=
  466. tss text.length$ 'tsslen :=
  467. #1 'ind :=
  468. { istr ind tsslen substring$ "" = not }
  469. { istr ind tsslen substring$ tss =
  470. { ret rss * 'ret :=
  471. ind tsslen + 'ind :=
  472. }
  473. { ret istr ind #1 substring$ * 'ret :=
  474. ind #1 + 'ind :=
  475. }
  476. if$
  477. }
  478. while$
  479. ret
  480. }
  481. FUNCTION {format.lab.names.abbr}
  482. { 's :=
  483. s num.names$ 'numnames :=
  484. numnames #1 >
  485. { numnames #2 >
  486. { s #1 "{vv~}{ll}" format.name$ " et~al." * }
  487. { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
  488. { s #1 "{vv~}{ll}" format.name$ " et~al." * }
  489. { s #1 "{vv~}{ll}" format.name$ " \harvardand\ " *
  490. s #2 "{vv~}{ll}" format.name$ *
  491. }
  492. if$
  493. }
  494. if$
  495. }
  496. { s #1 "{vv~}{ll}" format.name$ }
  497. if$
  498. }
  499. FUNCTION {format.lab.names.full}
  500. { 's :=
  501. #1 'nameptr :=
  502. s num.names$ 'numnames :=
  503. numnames 'namesleft :=
  504. { namesleft #0 > }
  505. { s nameptr "{vv~}{ll}" format.name$ 't :=
  506. nameptr #1 >
  507. { namesleft #1 >
  508. { ", " * t * }
  509. { t "others" =
  510. { " et~al." * }
  511. { " \harvardand\ " * t * }
  512. if$
  513. }
  514. if$
  515. }
  516. 't
  517. if$
  518. nameptr #1 + 'nameptr :=
  519. namesleft #1 - 'namesleft :=
  520. }
  521. while$
  522. }
  523. INTEGERS { author.field editor.field organization.field title.field key.field }
  524. FUNCTION {init.field.constants}
  525. { #0 'author.field :=
  526. #1 'editor.field :=
  527. #2 'organization.field :=
  528. #3 'title.field :=
  529. #4 'key.field :=
  530. }
  531. FUNCTION {make.list.label}
  532. { author.field field.used =
  533. { format.authors }
  534. { editor.field field.used =
  535. { format.editors }
  536. { organization.field field.used =
  537. { "The " #4 organization chop.word #3 text.prefix$ }
  538. { title.field field.used =
  539. { format.btitle }
  540. { key.field field.used =
  541. { key #3 text.prefix$ }
  542. { "Internal error :001 on " cite$ * " label" * warning$ }
  543. if$
  544. }
  545. if$
  546. }
  547. if$
  548. }
  549. if$
  550. }
  551. if$
  552. }
  553. FUNCTION {make.full.label}
  554. { author.field field.used =
  555. { author format.lab.names.full }
  556. { editor.field field.used =
  557. { editor format.lab.names.full }
  558. { organization.field field.used =
  559. { "The " #4 organization chop.word #3 text.prefix$ }
  560. { title.field field.used =
  561. { format.btitle }
  562. { key.field field.used =
  563. { key #3 text.prefix$ }
  564. { "Internal error :001 on " cite$ * " label" * warning$ }
  565. if$
  566. }
  567. if$
  568. }
  569. if$
  570. }
  571. if$
  572. }
  573. if$
  574. }
  575. FUNCTION {make.abbr.label} %%%XXX change
  576. {
  577. etal.allowed
  578. { author.field field.used =
  579. { author format.lab.names.abbr }
  580. { editor.field field.used =
  581. { editor format.lab.names.abbr }
  582. { organization.field field.used =
  583. { "The " #4 organization chop.word #3 text.prefix$ }
  584. { title.field field.used =
  585. { format.btitle }
  586. { key.field field.used =
  587. { key #3 text.prefix$ }
  588. {"Internal error :001 on " cite$ * " label" * warning$ }
  589. if$
  590. }
  591. if$
  592. }
  593. if$
  594. }
  595. if$
  596. }
  597. if$
  598. }
  599. { make.full.label }
  600. if$
  601. }
  602. FUNCTION {output.bibitem}
  603. { newline$
  604. etal.allowed %%%XXX change
  605. etal.required
  606. and
  607. {
  608. "\harvarditem[" write$
  609. make.abbr.label write$
  610. "]{" write$
  611. }
  612. {
  613. "\harvarditem{" write$
  614. }
  615. if$
  616. make.full.label write$
  617. "}{" write$
  618. list.year write$
  619. "}{" write$
  620. cite$ write$
  621. "}" write$
  622. newline$
  623. ""
  624. before.all 'output.state :=
  625. }
  626. FUNCTION {list.label.output}
  627. { make.list.label " " * write$
  628. }
  629. FUNCTION {article}
  630. { output.bibitem
  631. list.label.output
  632. " \harvardyearleft " list.year * "\harvardyearright " * output.nonnull
  633. author "author" item.check
  634. title.field field.used =
  635. { skip$ }
  636. { format.title quote "title" output.check }
  637. if$
  638. crossref missing$
  639. { journal emphasize "journal" duplicate$ item.check
  640. " " * format.vol.num.pages * output
  641. }
  642. { format.article.crossref output.nonnull
  643. format.pages output
  644. }
  645. if$
  646. new.block
  647. note output
  648. fin.entry
  649. write.url
  650. }
  651. FUNCTION {book}
  652. { output.bibitem
  653. list.label.output
  654. " \harvardyearleft " list.year * "\harvardyearright " * output.nonnull
  655. author empty$
  656. { editor "author and editor" item.check }
  657. { crossref missing$
  658. { "author and editor" editor either.or.check }
  659. 'skip$
  660. if$
  661. }
  662. if$
  663. title.field field.used =
  664. { skip$ }
  665. { format.btitle "title" output.check }
  666. if$
  667. crossref missing$
  668. { format.bvolume output
  669. format.number.series output
  670. format.edition output
  671. publisher "publisher" output.check
  672. address output
  673. }
  674. { format.book.crossref output.nonnull
  675. format.edition output
  676. }
  677. if$
  678. new.block
  679. note output
  680. fin.entry
  681. write.url
  682. }
  683. FUNCTION {booklet}
  684. { output.bibitem
  685. list.label.output
  686. " \harvardyearleft " list.year * "\harvardyearright " * output.nonnull
  687. title.field field.used =
  688. { skip$ }
  689. { format.title quote "title" output.check }
  690. if$
  691. howpublished output
  692. address output
  693. new.block
  694. note output
  695. fin.entry
  696. write.url
  697. }
  698. FUNCTION {inbook}
  699. { output.bibitem
  700. list.label.output
  701. " \harvardyearleft " list.year * "\harvardyearright " * output.nonnull
  702. author empty$
  703. { editor "author and editor" item.check }
  704. { crossref missing$
  705. { "author and editor" editor either.or.check }
  706. 'skip$
  707. if$
  708. }
  709. if$
  710. title.field field.used =
  711. { skip$ }
  712. { format.btitle "title" output.check }
  713. if$
  714. crossref missing$
  715. { format.bvolume output
  716. format.number.series output
  717. format.edition output
  718. publisher "publisher" output.check
  719. address output
  720. }
  721. { format.book.crossref output.nonnull
  722. format.edition output
  723. }
  724. if$
  725. format.chapter.pages "chapter and pages" output.check
  726. new.block
  727. note output
  728. fin.entry
  729. write.url
  730. }
  731. FUNCTION {incollection}
  732. { output.bibitem
  733. list.label.output
  734. " \harvardyearleft " list.year * "\harvardyearright " * output.nonnull
  735. title.field field.used =
  736. { skip$ }
  737. { format.title "title" output.check }
  738. if$
  739. author "author" item.check
  740. crossref missing$
  741. { format.in.ed.booktitle "booktitle" output.check
  742. format.edition output
  743. format.bvolume output
  744. format.number.series output
  745. publisher "publisher" output.check
  746. address output
  747. }
  748. { format.incoll.inproc.crossref output.nonnull
  749. }
  750. if$
  751. format.chapter.pages output
  752. new.block
  753. note output
  754. fin.entry
  755. write.url
  756. }
  757. FUNCTION {inproceedings}
  758. { output.bibitem
  759. list.label.output
  760. " \harvardyearleft " list.year * "\harvardyearright " * output.nonnull
  761. title.field field.used =
  762. { skip$ }
  763. { format.title "title" output.check }
  764. if$
  765. author "author" item.check
  766. crossref missing$
  767. { format.in.ed.booktitle "booktitle" output.check
  768. format.bvolume output
  769. format.number.series output
  770. address empty$
  771. { organization output
  772. publisher output
  773. }
  774. { organization output
  775. publisher output
  776. address output.nonnull
  777. }
  778. if$
  779. }
  780. { format.incoll.inproc.crossref output.nonnull
  781. }
  782. if$
  783. format.pages output
  784. new.block
  785. note output
  786. fin.entry
  787. write.url
  788. }
  789. FUNCTION {conference} { inproceedings }
  790. FUNCTION {manual}
  791. { output.bibitem
  792. list.label.output
  793. " \harvardyearleft " list.year * "\harvardyearright " * output.nonnull
  794. title.field field.used =
  795. { skip$ }
  796. { format.btitle "title" output.check }
  797. if$
  798. format.edition output
  799. author empty$
  800. { organization empty$
  801. { address output }
  802. 'skip$
  803. if$
  804. }
  805. { organization output
  806. address output
  807. }
  808. if$
  809. new.block
  810. note output
  811. fin.entry
  812. write.url
  813. }
  814. FUNCTION {mastersthesis}
  815. { output.bibitem
  816. list.label.output
  817. " \harvardyearleft " list.year * "\harvardyearright " * output.nonnull
  818. author "author" item.check
  819. title.field field.used =
  820. { skip$ }
  821. { format.title "title" output.check }
  822. if$
  823. "Master's thesis" format.thesis.type output.nonnull
  824. school "school" output.check
  825. address output
  826. new.block
  827. note output
  828. fin.entry
  829. write.url
  830. }
  831. FUNCTION {misc}
  832. { output.bibitem
  833. list.label.output
  834. " \harvardyearleft " list.year * "\harvardyearright " * output.nonnull
  835. title.field field.used =
  836. { skip$ }
  837. { format.title quote output }
  838. if$
  839. howpublished output
  840. new.block
  841. note output
  842. fin.entry
  843. write.url
  844. empty.misc.check
  845. }
  846. FUNCTION {phdthesis}
  847. { output.bibitem
  848. list.label.output
  849. " \harvardyearleft " list.year * "\harvardyearright " * output.nonnull
  850. author "author" item.check
  851. title.field field.used =
  852. { skip$ }
  853. { title "title" output.check }
  854. if$
  855. "PhD thesis" format.thesis.type output.nonnull
  856. school "school" output.check
  857. address output
  858. new.block
  859. note output
  860. fin.entry
  861. write.url
  862. }
  863. FUNCTION {proceedings}
  864. { output.bibitem
  865. list.label.output
  866. " \harvardyearleft " list.year * "\harvardyearright " * output.nonnull
  867. title.field field.used =
  868. { skip$ }
  869. { format.btitle "title" output.check }
  870. if$
  871. format.bvolume output
  872. format.number.series output
  873. address empty$
  874. { editor empty$
  875. { skip$ }
  876. { organization output
  877. }
  878. if$
  879. publisher output
  880. }
  881. { editor empty$
  882. 'skip$
  883. { organization output }
  884. if$
  885. publisher output
  886. address output.nonnull
  887. }
  888. if$
  889. new.block
  890. note output
  891. fin.entry
  892. write.url
  893. }
  894. FUNCTION {techreport}
  895. { output.bibitem
  896. list.label.output
  897. " \harvardyearleft " list.year * "\harvardyearright " * output.nonnull
  898. author "author" item.check
  899. title.field field.used =
  900. { skip$ }
  901. { format.title "title" output.check }
  902. if$
  903. format.tr.number output.nonnull
  904. institution "institution" output.check
  905. address output
  906. new.block
  907. note output
  908. fin.entry
  909. write.url
  910. }
  911. FUNCTION {unpublished}
  912. { output.bibitem
  913. list.label.output
  914. " \harvardyearleft " list.year * "\harvardyearright " * output.nonnull
  915. author "author" item.check
  916. title.field field.used =
  917. { skip$ }
  918. { format.title "title" output.check }
  919. if$
  920. new.block
  921. note "note" output.check
  922. fin.entry
  923. write.url
  924. }
  925. FUNCTION {default.type} { misc }
  926. MACRO {jan} {"January"}
  927. MACRO {feb} {"February"}
  928. MACRO {mar} {"March"}
  929. MACRO {apr} {"April"}
  930. MACRO {may} {"May"}
  931. MACRO {jun} {"June"}
  932. MACRO {jul} {"July"}
  933. MACRO {aug} {"August"}
  934. MACRO {sep} {"September"}
  935. MACRO {oct} {"October"}
  936. MACRO {nov} {"November"}
  937. MACRO {dec} {"December"}
  938. MACRO {acmcs} {"ACM Computing Surveys"}
  939. MACRO {acta} {"Acta Informatica"}
  940. MACRO {cacm} {"Communications of the ACM"}
  941. MACRO {ibmjrd} {"IBM Journal of Research and Development"}
  942. MACRO {ibmsj} {"IBM Systems Journal"}
  943. MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
  944. MACRO {ieeetc} {"IEEE Transactions on Computers"}
  945. MACRO {ieeetcad}
  946. {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
  947. MACRO {ipl} {"Information Processing Letters"}
  948. MACRO {jacm} {"Journal of the ACM"}
  949. MACRO {jcss} {"Journal of Computer and System Sciences"}
  950. MACRO {scp} {"Science of Computer Programming"}
  951. MACRO {sicomp} {"SIAM Journal on Computing"}
  952. MACRO {tocs} {"ACM Transactions on Computer Systems"}
  953. MACRO {tods} {"ACM Transactions on Database Systems"}
  954. MACRO {tog} {"ACM Transactions on Graphics"}
  955. MACRO {toms} {"ACM Transactions on Mathematical Software"}
  956. MACRO {toois} {"ACM Transactions on Office Information Systems"}
  957. MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
  958. MACRO {tcs} {"Theoretical Computer Science"}
  959. READ
  960. EXECUTE {init.field.constants}
  961. FUNCTION {sortify}
  962. { purify$
  963. "l" change.case$
  964. }
  965. FUNCTION {sortify.names}
  966. { " \harvardand\ " " " replace.substring
  967. " et~al." " zzz" replace.substring
  968. sortify
  969. }
  970. FUNCTION {author.key.label}
  971. { author empty$
  972. { key empty$
  973. { title.field 'field.used := }
  974. { key.field 'field.used := }
  975. if$
  976. }
  977. { author.field 'field.used := }
  978. if$
  979. }
  980. FUNCTION {author.editor.key.label}
  981. { author empty$
  982. { editor empty$
  983. { key empty$
  984. { title.field 'field.used := }
  985. { key.field 'field.used := }
  986. if$
  987. }
  988. { editor.field 'field.used := }
  989. if$
  990. }
  991. { author.field 'field.used := }
  992. if$
  993. }
  994. FUNCTION {author.key.organization.label}
  995. { author empty$
  996. { key empty$
  997. { organization empty$
  998. { title.field 'field.used := }
  999. { organization.field 'field.used := }
  1000. if$
  1001. }
  1002. { key.field 'field.used := }
  1003. if$
  1004. }
  1005. { author.field 'field.used := }
  1006. if$
  1007. }
  1008. FUNCTION {editor.key.organization.label}
  1009. { editor empty$
  1010. { key empty$
  1011. { organization empty$
  1012. { title.field 'field.used := }
  1013. { organization.field 'field.used := }
  1014. if$
  1015. }
  1016. { key.field 'field.used := }
  1017. if$
  1018. }
  1019. { editor.field 'field.used := }
  1020. if$
  1021. }
  1022. FUNCTION {sort.format.title}
  1023. { 't :=
  1024. "A " #2
  1025. "An " #3
  1026. "The " #4 t chop.word
  1027. chop.word
  1028. chop.word
  1029. sortify
  1030. #1 global.max$ substring$
  1031. }
  1032. FUNCTION {calc.label} %%%XXX change
  1033. { make.abbr.label
  1034. title.field field.used =
  1035. { sort.format.title }
  1036. { sortify.names }
  1037. if$
  1038. year field.or.null purify$ #-1 #4 substring$ sortify
  1039. *
  1040. 'sort.label :=
  1041. }
  1042. FUNCTION {preliminaries} %%%XXX change
  1043. { type$ "book" =
  1044. type$ "inbook" =
  1045. or
  1046. 'author.editor.key.label
  1047. { type$ "proceedings" =
  1048. 'editor.key.organization.label
  1049. { type$ "manual" =
  1050. 'author.key.organization.label
  1051. 'author.key.label
  1052. if$
  1053. }
  1054. if$
  1055. }
  1056. if$
  1057. author.field field.used = %%%XXX change
  1058. {
  1059. author num.names$ #2 >
  1060. { #1 }
  1061. { #0 }
  1062. if$
  1063. 'etal.required :=
  1064. }
  1065. {
  1066. editor.field field.used =
  1067. {
  1068. editor num.names$ #2 >
  1069. { #1 }
  1070. { #0 }
  1071. if$
  1072. }
  1073. { #0 }
  1074. if$
  1075. 'etal.required :=
  1076. }
  1077. if$
  1078. #1 'etal.allowed :=
  1079. }
  1080. FUNCTION {first.presort}
  1081. { calc.label
  1082. sort.label
  1083. title.field field.used =
  1084. { skip$ }
  1085. { " "
  1086. *
  1087. make.list.label sortify.names
  1088. *
  1089. " "
  1090. *
  1091. title field.or.null
  1092. sort.format.title
  1093. *
  1094. }
  1095. if$
  1096. #1 entry.max$ substring$
  1097. 'sort.key$ :=
  1098. }
  1099. ITERATE {preliminaries}
  1100. ITERATE {first.presort}
  1101. SORT
  1102. STRINGS { last.sort.label next.extra last.full.label}
  1103. INTEGERS { last.extra.num last.etal.allowed}
  1104. FUNCTION {initialize.confusion}
  1105. { #0 int.to.chr$ 'last.sort.label :=
  1106. #0 int.to.chr$ 'last.full.label :=
  1107. #1 'last.etal.allowed :=
  1108. }
  1109. FUNCTION {confusion.pass}
  1110. { last.sort.label sort.label =
  1111. { last.etal.allowed
  1112. { last.full.label make.full.label sortify.names =
  1113. { skip$ }
  1114. { #0 'etal.allowed :=
  1115. #0 'last.etal.allowed :=
  1116. }
  1117. if$
  1118. }
  1119. { #0 'etal.allowed := }
  1120. if$
  1121. }
  1122. { sort.label 'last.sort.label :=
  1123. make.full.label sortify.names 'last.full.label :=
  1124. #1 'last.etal.allowed :=
  1125. }
  1126. if$
  1127. }
  1128. EXECUTE {initialize.confusion}
  1129. ITERATE {confusion.pass}
  1130. EXECUTE {initialize.confusion}
  1131. REVERSE {confusion.pass}
  1132. FUNCTION {initialize.last.extra.num}
  1133. { #0 int.to.chr$ 'last.sort.label :=
  1134. "" 'next.extra :=
  1135. #0 'last.extra.num :=
  1136. }
  1137. FUNCTION {forward.pass}
  1138. { last.sort.label sort.label =
  1139. { last.extra.num #1 + 'last.extra.num :=
  1140. last.extra.num int.to.chr$ 'extra.label :=
  1141. }
  1142. { "a" chr.to.int$ 'last.extra.num :=
  1143. "" 'extra.label :=
  1144. sort.label 'last.sort.label :=
  1145. }
  1146. if$
  1147. }
  1148. FUNCTION {reverse.pass}
  1149. { next.extra "b" =
  1150. { "a" 'extra.label := }
  1151. 'skip$
  1152. if$
  1153. year empty$
  1154. { "n.d." extra.label emphasize * 'list.year := }
  1155. { year extra.label emphasize * 'list.year := }
  1156. if$
  1157. extra.label 'next.extra :=
  1158. }
  1159. ITERATE {first.presort}
  1160. SORT
  1161. EXECUTE {initialize.last.extra.num}
  1162. ITERATE {forward.pass}
  1163. REVERSE {reverse.pass}
  1164. FUNCTION {second.presort}
  1165. { make.list.label
  1166. title.field field.used =
  1167. { sort.format.title }
  1168. { sortify.names }
  1169. if$
  1170. " "
  1171. *
  1172. list.year field.or.null sortify
  1173. *
  1174. " "
  1175. *
  1176. title.field field.used =
  1177. { skip$ }
  1178. { title field.or.null
  1179. sort.format.title
  1180. *
  1181. }
  1182. if$
  1183. #1 entry.max$ substring$
  1184. 'sort.key$ :=
  1185. }
  1186. ITERATE {second.presort}
  1187. SORT
  1188. FUNCTION {begin.bib}
  1189. { preamble$ empty$
  1190. 'skip$
  1191. { "\harvardpreambledefs{%" write$ newline$
  1192. preamble$ write$ "}" write$ newline$
  1193. "\harvardpreambletext{%" write$ newline$
  1194. preamble$ write$ "}" write$ newline$ }
  1195. if$
  1196. "\begin{thebibliography}{xx}" write$ newline$
  1197. }
  1198. EXECUTE {begin.bib}
  1199. EXECUTE {init.state.consts}
  1200. ITERATE {call.type$}
  1201. FUNCTION {end.bib}
  1202. { newline$
  1203. "\end{thebibliography}" write$ newline$
  1204. }
  1205. EXECUTE {end.bib}