RS.bst 20 KB

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