jas99.bst 27 KB

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