amsalpha.bst 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383
  1. %%% ====================================================================
  2. %%% @BibTeX-style-file{
  3. %%% filename = "amsalpha.bst",
  4. %%% version = "1.2b",
  5. %%% date = "28 October 1996",
  6. %%% time = "12:51:45 EST",
  7. %%% checksum = "15779 1382 4072 29381",
  8. %%% author = "American Mathematical Society",
  9. %%% address = "American Mathematical Society,
  10. %%% Technical Support,
  11. %%% Electronic Products and Services,
  12. %%% P. O. Box 6248,
  13. %%% Providence, RI 02940,
  14. %%% USA",
  15. %%% telephone = "401-455-4080 or (in the USA and Canada)
  16. %%% 800-321-4AMS (321-4267)",
  17. %%% FAX = "401-331-3842",
  18. %%% email = "tech-support@ams.org (Internet)",
  19. %%% copyright = "Copyright (C) 1995 American Mathematical Society,
  20. %%% all rights reserved. Copying of this file is
  21. %%% authorized only if either:
  22. %%% (1) you make absolutely no changes to your copy,
  23. %%% including name; OR
  24. %%% (2) if you do make changes, you first rename it
  25. %%% to some other name.",
  26. %%% codetable = "ISO/ASCII",
  27. %%% keywords = "bibtex, bibliography, amslatex, ams-latex",
  28. %%% supported = "yes",
  29. %%% abstract = "BibTeX bibliography style `amsalpha' for BibTeX
  30. %%% versions 0.99a or later and LaTeX version 2e.
  31. %%% Produces alphabetic-label bibliography items in
  32. %%% a form typical for American Mathematical Society
  33. %%% publications.",
  34. %%% docstring = "The checksum field above contains a CRC-16
  35. %%% checksum as the first value, followed by the
  36. %%% equivalent of the standard UNIX wc (word
  37. %%% count) utility output of lines, words, and
  38. %%% characters. This is produced by Robert
  39. %%% Solovay's checksum utility.",
  40. %%% }
  41. %%% ====================================================================
  42. % See the file btxbst.doc for extra documentation other than
  43. % what is included here. And see btxhak.tex for a description
  44. % of the BibTeX language and how to use it.
  45. % This defines the types of fields that can occur in a database entry
  46. % for this particular bibliography style. Except for `language',
  47. % this is the standard list from alpha.bst.
  48. %% Types of entries currently allowed in a BibTeX file:
  49. %%
  50. %% ARTICLE -- An article from a journal or magazine.
  51. %%
  52. %% BOOK -- A book with an explicit publisher.
  53. %%
  54. %% BOOKLET -- A work that is printed and bound,
  55. %% but without a named publisher or sponsoring institution.
  56. %%
  57. %% CONFERENCE -- The same as INPROCEEDINGS,
  58. %% included for Scribe compatibility.
  59. %%
  60. %% INBOOK -- A part of a book,
  61. %% which may be a chapter (or section or whatever) and/or a range of pages.
  62. %%
  63. %% INCOLLECTION -- A part of a book having its own title.
  64. %%
  65. %% INPROCEEDINGS -- An article in a conference proceedings.
  66. %%
  67. %% MANUAL -- Technical documentation.
  68. %%
  69. %% MASTERSTHESIS -- A Master's thesis.
  70. %%
  71. %% MISC -- Use this type when nothing else fits.
  72. %%
  73. %% PHDTHESIS -- A PhD thesis.
  74. %%
  75. %% PROCEEDINGS -- The proceedings of a conference.
  76. %%
  77. %% TECHREPORT -- A report published by a school or other institution,
  78. %% usually numbered within a series.
  79. %%
  80. %% UNPUBLISHED -- A document having an author and title, but not formally
  81. %% published.
  82. ENTRY
  83. { address
  84. author
  85. booktitle
  86. chapter
  87. edition
  88. editor
  89. howpublished
  90. institution
  91. journal
  92. key
  93. language
  94. month
  95. note
  96. number
  97. organization
  98. pages
  99. publisher
  100. school
  101. series
  102. title
  103. type
  104. volume
  105. year
  106. }
  107. {}
  108. { label extra.label sort.label }
  109. % Removed after.sentence, after.block---not needed.
  110. INTEGERS { output.state before.all mid.sentence }
  111. FUNCTION {init.state.consts}
  112. { #0 'before.all :=
  113. #1 'mid.sentence :=
  114. }
  115. % Scratch variables:
  116. STRINGS { s t }
  117. % Utility functions
  118. FUNCTION {shows}
  119. { duplicate$ ":::: `" swap$ * "'" * top$
  120. }
  121. FUNCTION {showstack}
  122. {"STACK====================================================================="
  123. top$
  124. stack$
  125. "ENDSTACK=================================================================="
  126. top$
  127. }
  128. FUNCTION {not}
  129. { { #0 }
  130. { #1 }
  131. if$
  132. }
  133. FUNCTION {and}
  134. { 'skip$
  135. { pop$ #0 }
  136. if$
  137. }
  138. FUNCTION {or}
  139. { { pop$ #1 }
  140. 'skip$
  141. if$
  142. }
  143. FUNCTION {field.or.null}
  144. { duplicate$ empty$
  145. { pop$ "" }
  146. 'skip$
  147. if$
  148. }
  149. FUNCTION {emphasize}
  150. { duplicate$ empty$
  151. { pop$ "" }
  152. { "\emph{" swap$ * "}" * }
  153. if$
  154. }
  155. % n.dashify is used to make sure page ranges get the TeX code
  156. % (two hyphens) for en-dashes.
  157. FUNCTION {n.dashify}
  158. { 't :=
  159. ""
  160. { t empty$ not }
  161. { t #1 #1 substring$ "-" =
  162. { t #1 #2 substring$ "--" = not
  163. { "--" *
  164. t #2 global.max$ substring$ 't :=
  165. }
  166. { { t #1 #1 substring$ "-" = }
  167. { "-" *
  168. t #2 global.max$ substring$ 't :=
  169. }
  170. while$
  171. }
  172. if$
  173. }
  174. { t #1 #1 substring$ *
  175. t #2 global.max$ substring$ 't :=
  176. }
  177. if$
  178. }
  179. while$
  180. }
  181. % tie.or.space.connect connects two items with a ~ if the
  182. % second item is less than 3 letters long, otherwise it just puts an
  183. % ordinary space.
  184. FUNCTION {tie.or.space.connect}
  185. { duplicate$ text.length$ #3 <
  186. { "~" }
  187. { " " }
  188. if$
  189. swap$ * *
  190. }
  191. FUNCTION {add.space.if.necessary}
  192. { duplicate$ "" =
  193. 'skip$
  194. { " " * }
  195. if$
  196. }
  197. % either.or.check gives a warning if two mutually exclusive fields
  198. % were used in the database.
  199. FUNCTION {either.or.check}
  200. { empty$
  201. 'pop$
  202. { "can't use both " swap$ * " fields in " * cite$ * warning$ }
  203. if$
  204. }
  205. % output.nonnull is called by output.
  206. FUNCTION {output.nonnull}
  207. % remove the top item from the stack because it's in the way.
  208. { 's :=
  209. output.state mid.sentence =
  210. % If we're in mid-sentence, add a comma to the new top item and write it
  211. { ", " * write$ }
  212. % Otherwise, if we're at the beginning of a bibitem,
  213. { output.state before.all =
  214. % just write out the top item from the stack;
  215. 'write$
  216. % and the last alternative is that we're at the end of the current
  217. % bibitem, so we add a period to the top stack item and write it out.
  218. { add.period$ " " * write$ }
  219. if$
  220. mid.sentence 'output.state :=
  221. }
  222. if$
  223. % Put the top item back on the stack that we removed earlier.
  224. s
  225. }
  226. % Output checks to see if the stack top is empty; if not, it
  227. % calls output.nonnull to write it out.
  228. FUNCTION {output}
  229. { duplicate$ empty$
  230. 'pop$
  231. 'output.nonnull
  232. if$
  233. }
  234. % Standard warning message for a missing or empty field. For the user
  235. % we call any such field `missing' without respect to the distinction
  236. % made by BibTeX between missing and empty.
  237. FUNCTION {missing.warning}
  238. { "missing " swap$ * " in " * cite$ * warning$ }
  239. % Output.check is like output except that it gives a warning on-screen
  240. % if the given field in the database entry is empty. t is the field
  241. % name.
  242. FUNCTION {output.check}
  243. { 't :=
  244. duplicate$ empty$
  245. { pop$ t missing.warning }
  246. 'output.nonnull
  247. if$
  248. }
  249. FUNCTION {output.bibitem}
  250. { newline$
  251. "\bibitem[" write$
  252. label write$
  253. "]{" write$
  254. cite$ write$
  255. "}" write$
  256. newline$
  257. % This empty string is the first thing that will be written
  258. % the next time write$ is called. Done this way because each
  259. % item is saved on the stack until we find out what punctuation
  260. % should be added after it. Therefore we need an empty first item.
  261. ""
  262. before.all 'output.state :=
  263. }
  264. FUNCTION {fin.entry}
  265. { add.period$
  266. write$
  267. newline$
  268. }
  269. % Removed new.block, new.block.checka, new.block.checkb, new.sentence,
  270. % new.sentence.checka, and new.sentence.checkb functions here, since they
  271. % don't seem to be needed in the AMS style. Also moved some real
  272. % basic functions like `and' and 'or' earlier in the file.
  273. INTEGERS { nameptr namesleft numnames }
  274. % The extra section to write out a language field was added
  275. % for AMSPLAIN.BST. Not present in plain.bst.
  276. FUNCTION {format.language}
  277. { language empty$
  278. { "" }
  279. { " (" language * ")" * }
  280. if$
  281. }
  282. % This version of format.names puts names in the format
  283. %
  284. % First von Last, Jr.
  285. %
  286. % (i.e., first name first, no abbreviating to initials).
  287. FUNCTION {format.names}
  288. { 's :=
  289. #1 'nameptr :=
  290. s num.names$ 'numnames :=
  291. numnames 'namesleft :=
  292. { namesleft #0 > }
  293. { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
  294. nameptr #1 >
  295. { namesleft #1 >
  296. { ", " * t * }
  297. { numnames #2 >
  298. { "," * }
  299. 'skip$
  300. if$
  301. t "others" =
  302. { " et~al." * }
  303. { " and " * t * }
  304. if$
  305. }
  306. if$
  307. }
  308. 't
  309. if$
  310. nameptr #1 + 'nameptr :=
  311. namesleft #1 - 'namesleft :=
  312. }
  313. while$
  314. }
  315. FUNCTION {format.authors}
  316. { author empty$
  317. { "" }
  318. { extra.label "\bysame" =
  319. {"\bysame"}
  320. { author format.names }
  321. if$
  322. }
  323. if$
  324. }
  325. FUNCTION {format.editors}
  326. { editor empty$
  327. { "" }
  328. { editor format.names
  329. editor num.names$ #1 >
  330. { " (eds.)" * }
  331. { " (ed.)" * }
  332. if$
  333. }
  334. if$
  335. }
  336. FUNCTION {format.nonauthor.editors}
  337. { editor empty$
  338. { "" }
  339. { editor format.names
  340. editor num.names$ #1 >
  341. { ", eds." * }
  342. { ", ed." * }
  343. if$
  344. }
  345. if$
  346. }
  347. FUNCTION {format.title}
  348. { title empty$
  349. { "" }
  350. { title "t" change.case$ emphasize }
  351. if$
  352. }
  353. FUNCTION {format.journal.vol.year}
  354. { journal empty$
  355. { "" "journal name" missing.warning }
  356. { journal
  357. volume empty$
  358. 'skip$
  359. { " \textbf{" * volume * "}" * }
  360. if$
  361. year empty$
  362. { "year" missing.warning }
  363. { " (" * year * ")" * }
  364. if$
  365. }
  366. if$
  367. }
  368. % For formatting the issue number for a journal article.
  369. FUNCTION {format.number}
  370. { number empty$
  371. { "" }
  372. { "no.~" number * }
  373. if$
  374. }
  375. % For formatting miscellaneous dates
  376. FUNCTION {format.date}
  377. { year empty$
  378. { month empty$
  379. { "" }
  380. { "there's a month but no year in " cite$ * warning$
  381. month
  382. }
  383. if$
  384. }
  385. { month empty$
  386. 'year
  387. { month " " * year * }
  388. if$
  389. }
  390. if$
  391. }
  392. %% The volume, series and number information is sort of tricky.
  393. %% This code handles it as follows:
  394. %% If the series is present, and the volume, but not the number,
  395. %% then we do "\emph{Book title}, Series Name, vol. 000"
  396. %% If the series is present, and the number, but not the volume,
  397. %% then we do "\emph{Book title}, Series Name, no. 000"
  398. %% If the series is present, and both number and volume,
  399. %% then we do "\emph{Book title}, vol. XX, Series Name, no. 000"
  400. %% Finally, if the series is absent,
  401. %% then we do "\emph{Book title}, vol. XX"
  402. %% or "\emph{Book title}, no. 000"
  403. %% and if both volume and number are present, give a warning message.
  404. FUNCTION {format.bookvolume.series.number}
  405. { volume empty$
  406. { "" % Push the empty string as a placeholder in case everything else
  407. % is empty too.
  408. series empty$
  409. 'skip$
  410. { pop$ series } % if series is not empty put in stack
  411. if$
  412. number empty$
  413. 'skip$
  414. { duplicate$ empty$ % if no preceding material,
  415. 'skip$ % do nothing, otherwise
  416. { ", " * } % add a comma and space to separate.
  417. if$
  418. "no." number tie.or.space.connect * % add the number information
  419. }
  420. if$
  421. }
  422. %% If the volume is NOT EMPTY:
  423. { "vol." volume tie.or.space.connect % vol. XX
  424. number empty$
  425. { series empty$
  426. 'skip$
  427. { series ", " * swap$ *} % Series Name, vol. XX
  428. if$
  429. }
  430. { series empty$
  431. { "can't use both volume and number if series info is missing"
  432. warning$
  433. "in BibTeX entry type `" type$ * "'" * top$
  434. }
  435. { ", " * series * ", no." * number tie.or.space.connect }
  436. if$
  437. }
  438. if$
  439. }
  440. if$
  441. } % end of format.bookvolume.series.number
  442. %% format.inproc.title.where.editors is used by inproceedings entry types
  443. %% No case changing or emphasizing for the title. We want initial
  444. %% caps, roman.
  445. %% We add parentheses around the address (place where conference
  446. %% was held).
  447. %% Likewise we add parentheses around the editors' names.
  448. FUNCTION {format.inproc.title.address.editors}
  449. { booktitle empty$
  450. { "" }
  451. { booktitle
  452. address empty$
  453. 'skip$
  454. { add.space.if.necessary "(" * address * ")" * }
  455. if$
  456. editor empty$
  457. 'skip$
  458. { add.space.if.necessary "(" * format.nonauthor.editors * ")" * }
  459. if$
  460. }
  461. if$
  462. }
  463. %% format.incoll.title.editors is similar to format.inproc... but
  464. %% omits the address. For collections that are not proceedings volumes.
  465. FUNCTION {format.incoll.title.editors}
  466. { booktitle empty$
  467. { "" }
  468. { editor empty$
  469. { booktitle }
  470. { booktitle
  471. add.space.if.necessary "(" * format.nonauthor.editors * ")" *
  472. }
  473. if$
  474. }
  475. if$
  476. }
  477. % Desired output for format.number.series:
  478. %
  479. % Lecture Notes in Math., no.~1224
  480. FUNCTION {format.number.series}
  481. { series empty$
  482. { number empty$
  483. { "" }
  484. { "there's a number but no series in " cite$ * warning$ }
  485. if$
  486. }
  487. { series
  488. number empty$
  489. 'skip$
  490. { ", no.~" * number * }
  491. if$
  492. }
  493. if$
  494. }
  495. FUNCTION {format.edition}
  496. { edition empty$
  497. { "" }
  498. { output.state mid.sentence =
  499. { edition "l" change.case$ " ed." * }
  500. { edition "t" change.case$ " ed." * }
  501. if$
  502. }
  503. if$
  504. }
  505. INTEGERS { multiresult }
  506. FUNCTION {multi.page.check}
  507. { 't :=
  508. #0 'multiresult :=
  509. { multiresult not
  510. t empty$ not
  511. and
  512. }
  513. { t #1 #1 substring$
  514. duplicate$ "-" =
  515. swap$ duplicate$ "," =
  516. swap$ "+" =
  517. or or
  518. { #1 'multiresult := }
  519. { t #2 global.max$ substring$ 't := }
  520. if$
  521. }
  522. while$
  523. multiresult
  524. }
  525. FUNCTION {format.pages}
  526. { pages empty$
  527. { "" }
  528. { pages n.dashify }
  529. if$
  530. }
  531. FUNCTION {format.book.pages}
  532. { pages empty$
  533. { "" }
  534. { pages multi.page.check
  535. { "pp.~" pages n.dashify * }
  536. { "p.~" pages * }
  537. if$
  538. }
  539. if$
  540. }
  541. FUNCTION {format.chapter.pages}
  542. { chapter empty$
  543. 'format.book.pages
  544. { type empty$
  545. { "ch.~" }
  546. { type "l" change.case$ " " * }
  547. if$
  548. chapter *
  549. pages empty$
  550. 'skip$
  551. { ", " * format.book.pages * }
  552. if$
  553. }
  554. if$
  555. }
  556. FUNCTION {empty.misc.check}
  557. { author empty$ title empty$ howpublished empty$
  558. month empty$ year empty$ note empty$
  559. and and and and and
  560. key empty$ not and
  561. { "all relevant fields are empty in " cite$ * warning$ }
  562. 'skip$
  563. if$
  564. }
  565. FUNCTION {format.thesis.type}
  566. { type empty$
  567. 'skip$
  568. { pop$
  569. type "t" change.case$
  570. }
  571. if$
  572. }
  573. FUNCTION {format.tr.number}
  574. { type empty$
  575. { "Tech. Report" }
  576. 'type
  577. if$
  578. number empty$
  579. { "t" change.case$ }
  580. { number tie.or.space.connect }
  581. if$
  582. }
  583. % The format.crossref functions haven't been paid much attention
  584. % at the present time (June 1990) and could probably use some
  585. % work. MJD
  586. FUNCTION {format.article.crossref}
  587. { key empty$
  588. { journal empty$
  589. { "need key or journal for " cite$ * " to crossref " * crossref *
  590. warning$
  591. ""
  592. }
  593. { "In " journal * }
  594. if$
  595. }
  596. { "In " key * }
  597. if$
  598. " \cite{" * crossref * "}" *
  599. }
  600. FUNCTION {format.crossref.editor}
  601. { editor #1 "{vv~}{ll}" format.name$
  602. editor num.names$ duplicate$
  603. #2 >
  604. { pop$ " et~al." * }
  605. { #2 <
  606. 'skip$
  607. { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
  608. { " et~al." * }
  609. { " and " * editor #2 "{vv~}{ll}" format.name$ * }
  610. if$
  611. }
  612. if$
  613. }
  614. if$
  615. }
  616. FUNCTION {format.book.crossref}
  617. { volume empty$
  618. { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
  619. "In "
  620. }
  621. { "Vol." volume tie.or.space.connect
  622. " of " *
  623. }
  624. if$
  625. editor empty$
  626. editor field.or.null author field.or.null =
  627. or
  628. { key empty$
  629. { series empty$
  630. { "need editor, key, or series for " cite$ * " to crossref " *
  631. crossref * warning$
  632. "" *
  633. }
  634. { series * }
  635. if$
  636. }
  637. { key * }
  638. if$
  639. }
  640. { format.crossref.editor * }
  641. if$
  642. " \cite{" * crossref * "}" *
  643. }
  644. FUNCTION {format.incoll.inproc.crossref}
  645. { editor empty$
  646. editor field.or.null author field.or.null =
  647. or
  648. { key empty$
  649. { booktitle empty$
  650. { "need editor, key, or booktitle for " cite$ * " to crossref " *
  651. crossref * warning$
  652. ""
  653. }
  654. { "In \emph{" booktitle * "}" * }
  655. if$
  656. }
  657. { "In " key * }
  658. if$
  659. }
  660. { "In " format.crossref.editor * }
  661. if$
  662. " \cite{" * crossref * "}" *
  663. }
  664. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  665. % The main functions for each entry type.
  666. % journal, vol and year are formatted together because they are
  667. % not separated by commas.
  668. FUNCTION {article}
  669. { output.bibitem
  670. format.authors "author" output.check
  671. format.title "title" output.check
  672. crossref missing$
  673. { format.journal.vol.year "journal, volume, and year" output.check
  674. format.number output
  675. format.pages "pages" output.check
  676. }
  677. { format.article.crossref output.nonnull
  678. format.pages output
  679. }
  680. if$
  681. format.language *
  682. note output
  683. fin.entry
  684. }
  685. FUNCTION {book}
  686. { output.bibitem
  687. author empty$
  688. { format.editors "author and editor" output.check }
  689. { format.authors output.nonnull
  690. crossref missing$
  691. { "author and editor" editor either.or.check }
  692. 'skip$
  693. if$
  694. }
  695. if$
  696. format.title "title" output.check
  697. format.edition output
  698. crossref missing$
  699. { format.bookvolume.series.number output
  700. publisher "publisher" output.check
  701. address output
  702. }
  703. { format.book.crossref output.nonnull
  704. }
  705. if$
  706. format.date "year" output.check
  707. format.language *
  708. note output
  709. fin.entry
  710. }
  711. FUNCTION {booklet}
  712. { output.bibitem
  713. format.authors output
  714. format.title "title" output.check
  715. howpublished output
  716. address output
  717. format.date output
  718. note output
  719. fin.entry
  720. }
  721. FUNCTION {inbook}
  722. { output.bibitem
  723. author empty$
  724. { format.editors "author and editor" output.check }
  725. { format.authors output.nonnull
  726. crossref missing$
  727. { "author and editor" editor either.or.check }
  728. 'skip$
  729. if$
  730. }
  731. if$
  732. format.title "title" output.check
  733. format.edition output
  734. crossref missing$
  735. { format.bookvolume.series.number output
  736. format.chapter.pages "chapter and pages" output.check
  737. publisher "publisher" output.check
  738. address output
  739. }
  740. { format.chapter.pages "chapter and pages" output.check
  741. format.book.crossref output.nonnull
  742. }
  743. if$
  744. format.date "year" output.check
  745. format.language *
  746. note output
  747. fin.entry
  748. }
  749. FUNCTION {incollection}
  750. { output.bibitem
  751. format.authors "author" output.check
  752. format.title "title" output.check
  753. crossref missing$
  754. { format.incoll.title.editors "booktitle" output.check
  755. format.bookvolume.series.number output
  756. publisher "publisher" output.check
  757. address output
  758. format.edition output
  759. format.date "year" output.check
  760. }
  761. { format.incoll.inproc.crossref output.nonnull
  762. }
  763. if$
  764. note output
  765. format.book.pages output
  766. format.language *
  767. fin.entry
  768. }
  769. FUNCTION {inproceedings}
  770. { output.bibitem
  771. format.authors "author" output.check
  772. format.title "title" output.check
  773. crossref missing$
  774. { format.inproc.title.address.editors "booktitle" output.check
  775. format.bookvolume.series.number output
  776. organization output
  777. publisher output
  778. format.date "year" output.check
  779. }
  780. { format.incoll.inproc.crossref output.nonnull
  781. }
  782. if$
  783. note output
  784. format.book.pages output
  785. format.language *
  786. fin.entry
  787. }
  788. FUNCTION {conference} { inproceedings }
  789. FUNCTION {manual}
  790. { output.bibitem
  791. author empty$
  792. { organization empty$
  793. 'skip$
  794. { organization output.nonnull
  795. address output
  796. }
  797. if$
  798. }
  799. { format.authors output.nonnull }
  800. if$
  801. format.title "title" output.check
  802. author empty$
  803. { organization empty$
  804. { address output }
  805. 'skip$
  806. if$
  807. }
  808. { organization output
  809. address output
  810. }
  811. if$
  812. format.edition output
  813. format.date output
  814. note output
  815. fin.entry
  816. }
  817. FUNCTION {mastersthesis}
  818. { output.bibitem
  819. format.authors "author" output.check
  820. format.title "title" output.check
  821. "Master's thesis" format.thesis.type output.nonnull
  822. school "school" output.check
  823. address output
  824. format.date "year" output.check
  825. note output
  826. format.book.pages output
  827. fin.entry
  828. }
  829. FUNCTION {misc}
  830. { output.bibitem
  831. format.authors output
  832. format.title output
  833. howpublished output
  834. format.date output
  835. note output
  836. format.book.pages output
  837. fin.entry
  838. empty.misc.check
  839. }
  840. FUNCTION {phdthesis}
  841. { output.bibitem
  842. format.authors "author" output.check
  843. format.title "title" output.check
  844. "Ph.D. thesis" format.thesis.type output.nonnull
  845. school "school" output.check
  846. address output
  847. format.date "year" output.check
  848. note output
  849. format.book.pages output
  850. fin.entry
  851. }
  852. FUNCTION {proceedings}
  853. { output.bibitem
  854. editor empty$
  855. { organization output }
  856. { format.editors output.nonnull }
  857. if$
  858. format.title "title" output.check
  859. format.bookvolume.series.number output
  860. address empty$
  861. { editor empty$
  862. 'skip$
  863. { organization output }
  864. if$
  865. publisher output
  866. format.date "year" output.check
  867. }
  868. { address output.nonnull
  869. editor empty$
  870. 'skip$
  871. { organization output }
  872. if$
  873. publisher output
  874. format.date "year" output.check
  875. }
  876. if$
  877. note output
  878. fin.entry
  879. }
  880. FUNCTION {techreport}
  881. { output.bibitem
  882. format.authors "author" output.check
  883. format.title "title" output.check
  884. format.tr.number output.nonnull
  885. institution "institution" output.check
  886. address output
  887. format.date "year" output.check
  888. note output
  889. fin.entry
  890. }
  891. FUNCTION {unpublished}
  892. { output.bibitem
  893. format.authors "author" output.check
  894. format.title "title" output.check
  895. note "note" output.check
  896. format.date output
  897. fin.entry
  898. }
  899. FUNCTION {default.type} { misc }
  900. MACRO {jan} {"January"}
  901. MACRO {feb} {"February"}
  902. MACRO {mar} {"March"}
  903. MACRO {apr} {"April"}
  904. MACRO {may} {"May"}
  905. MACRO {jun} {"June"}
  906. MACRO {jul} {"July"}
  907. MACRO {aug} {"August"}
  908. MACRO {sep} {"September"}
  909. MACRO {oct} {"October"}
  910. MACRO {nov} {"November"}
  911. MACRO {dec} {"December"}
  912. READ
  913. FUNCTION {sortify}
  914. { purify$
  915. "l" change.case$
  916. }
  917. INTEGERS { len }
  918. FUNCTION {chop.word}
  919. { 's :=
  920. 'len :=
  921. s #1 len substring$ =
  922. { s len #1 + global.max$ substring$ }
  923. 's
  924. if$
  925. }
  926. INTEGERS { et.al.char.used }
  927. FUNCTION {initialize.et.al.char.used}
  928. { #0 'et.al.char.used :=
  929. }
  930. EXECUTE {initialize.et.al.char.used}
  931. FUNCTION {format.lab.names}
  932. { 's :=
  933. s num.names$ 'numnames :=
  934. numnames #1 >
  935. { numnames #4 >
  936. { #3 'namesleft := }
  937. { numnames 'namesleft := }
  938. if$
  939. #1 'nameptr :=
  940. ""
  941. { namesleft #0 > }
  942. { nameptr numnames =
  943. { s nameptr "{ff }{vv }{ll}{ jj}" format.name$ "others" =
  944. { "{\etalchar{+}}" *
  945. #1 'et.al.char.used :=
  946. }
  947. { s nameptr "{v{}}{l{}}" format.name$ * }
  948. if$
  949. }
  950. { s nameptr "{v{}}{l{}}" format.name$ * }
  951. if$
  952. nameptr #1 + 'nameptr :=
  953. namesleft #1 - 'namesleft :=
  954. }
  955. while$
  956. numnames #4 >
  957. { "{\etalchar{+}}" *
  958. #1 'et.al.char.used :=
  959. }
  960. 'skip$
  961. if$
  962. }
  963. { s #1 "{v{}}{l{}}" format.name$
  964. duplicate$ text.length$ #2 <
  965. { pop$ s #1 "{ll}" format.name$ #3 text.prefix$ }
  966. 'skip$
  967. if$
  968. }
  969. if$
  970. }
  971. FUNCTION {author.key.label}
  972. { author empty$
  973. { key empty$
  974. { cite$ #1 #3 substring$ }
  975. { key #3 text.prefix$ }
  976. if$
  977. }
  978. { author format.lab.names }
  979. if$
  980. }
  981. FUNCTION {author.editor.key.label}
  982. { author empty$
  983. { editor empty$
  984. { key empty$
  985. { cite$ #1 #3 substring$ }
  986. { key #3 text.prefix$ }
  987. if$
  988. }
  989. { editor format.lab.names }
  990. if$
  991. }
  992. { author format.lab.names }
  993. if$
  994. }
  995. FUNCTION {author.key.organization.label}
  996. { author empty$
  997. { key empty$
  998. { organization empty$
  999. { cite$ #1 #3 substring$ }
  1000. { "The " #4 organization chop.word #3 text.prefix$ }
  1001. if$
  1002. }
  1003. { key #3 text.prefix$ }
  1004. if$
  1005. }
  1006. { author format.lab.names }
  1007. if$
  1008. }
  1009. FUNCTION {editor.key.organization.label}
  1010. { editor empty$
  1011. { key empty$
  1012. { organization empty$
  1013. { cite$ #1 #3 substring$ }
  1014. { "The " #4 organization chop.word #3 text.prefix$ }
  1015. if$
  1016. }
  1017. { key #3 text.prefix$ }
  1018. if$
  1019. }
  1020. { editor format.lab.names }
  1021. if$
  1022. }
  1023. FUNCTION {calc.label}
  1024. { type$ "book" =
  1025. type$ "inbook" =
  1026. or
  1027. 'author.editor.key.label
  1028. { type$ "proceedings" =
  1029. 'editor.key.organization.label
  1030. { type$ "manual" =
  1031. 'author.key.organization.label
  1032. 'author.key.label
  1033. if$
  1034. }
  1035. if$
  1036. }
  1037. if$
  1038. duplicate$
  1039. year field.or.null purify$ #-1 #2 substring$
  1040. *
  1041. 'label :=
  1042. year field.or.null purify$ #-1 #4 substring$
  1043. *
  1044. sortify 'sort.label :=
  1045. }
  1046. FUNCTION {sort.format.names}
  1047. { 's :=
  1048. #1 'nameptr :=
  1049. ""
  1050. s num.names$ 'numnames :=
  1051. numnames 'namesleft :=
  1052. { namesleft #0 > }
  1053. { nameptr #1 >
  1054. { " " * }
  1055. 'skip$
  1056. if$
  1057. s nameptr "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}" format.name$ 't :=
  1058. nameptr numnames = t "others" = and
  1059. { "et al" * }
  1060. { t sortify * }
  1061. if$
  1062. nameptr #1 + 'nameptr :=
  1063. namesleft #1 - 'namesleft :=
  1064. }
  1065. while$
  1066. }
  1067. FUNCTION {sort.format.title}
  1068. { 't :=
  1069. "A " #2
  1070. "An " #3
  1071. "The " #4 t chop.word
  1072. chop.word
  1073. chop.word
  1074. sortify
  1075. #1 global.max$ substring$
  1076. }
  1077. FUNCTION {author.sort}
  1078. { author empty$
  1079. { key empty$
  1080. { "to sort, need author or key in " cite$ * warning$
  1081. ""
  1082. }
  1083. { key sortify }
  1084. if$
  1085. }
  1086. { author sort.format.names }
  1087. if$
  1088. }
  1089. FUNCTION {author.editor.sort}
  1090. { author empty$
  1091. { editor empty$
  1092. { key empty$
  1093. { "to sort, need author, editor, or key in " cite$ * warning$
  1094. ""
  1095. }
  1096. { key sortify }
  1097. if$
  1098. }
  1099. { editor sort.format.names }
  1100. if$
  1101. }
  1102. { author sort.format.names }
  1103. if$
  1104. }
  1105. FUNCTION {author.organization.sort}
  1106. { author empty$
  1107. { organization empty$
  1108. { key empty$
  1109. { "to sort, need author, organization, or key in " cite$ * warning$
  1110. ""
  1111. }
  1112. { key sortify }
  1113. if$
  1114. }
  1115. { "The " #4 organization chop.word sortify }
  1116. if$
  1117. }
  1118. { author sort.format.names }
  1119. if$
  1120. }
  1121. FUNCTION {editor.organization.sort}
  1122. { editor empty$
  1123. { organization empty$
  1124. { key empty$
  1125. { "to sort, need editor, organization, or key in " cite$ * warning$
  1126. ""
  1127. }
  1128. { key sortify }
  1129. if$
  1130. }
  1131. { "The " #4 organization chop.word sortify }
  1132. if$
  1133. }
  1134. { editor sort.format.names }
  1135. if$
  1136. }
  1137. FUNCTION {presort}
  1138. { calc.label
  1139. sort.label
  1140. " "
  1141. *
  1142. type$ "book" =
  1143. type$ "inbook" =
  1144. or
  1145. 'author.editor.sort
  1146. { type$ "proceedings" =
  1147. 'editor.organization.sort
  1148. { type$ "manual" =
  1149. 'author.organization.sort
  1150. 'author.sort
  1151. if$
  1152. }
  1153. if$
  1154. }
  1155. if$
  1156. *
  1157. " "
  1158. *
  1159. year field.or.null sortify
  1160. *
  1161. " "
  1162. *
  1163. title field.or.null
  1164. sort.format.title
  1165. *
  1166. #1 entry.max$ substring$
  1167. 'sort.key$ :=
  1168. }
  1169. ITERATE {presort}
  1170. SORT
  1171. STRINGS { longest.label last.sort.label next.extra }
  1172. INTEGERS { longest.label.width last.extra.num }
  1173. FUNCTION {initialize.longest.label}
  1174. { "" 'longest.label :=
  1175. #0 int.to.chr$ 'last.sort.label :=
  1176. "" 'next.extra :=
  1177. #0 'longest.label.width :=
  1178. #0 'last.extra.num :=
  1179. }
  1180. FUNCTION {forward.pass}
  1181. { last.sort.label sort.label =
  1182. { last.extra.num #1 + 'last.extra.num :=
  1183. last.extra.num int.to.chr$ 'extra.label :=
  1184. }
  1185. { "a" chr.to.int$ 'last.extra.num :=
  1186. "" 'extra.label :=
  1187. sort.label 'last.sort.label :=
  1188. }
  1189. if$
  1190. }
  1191. FUNCTION {reverse.pass}
  1192. { next.extra "b" =
  1193. { "a" 'extra.label := }
  1194. 'skip$
  1195. if$
  1196. label extra.label * 'label :=
  1197. label width$ longest.label.width >
  1198. { label 'longest.label :=
  1199. label width$ 'longest.label.width :=
  1200. }
  1201. 'skip$
  1202. if$
  1203. extra.label 'next.extra :=
  1204. }
  1205. EXECUTE {initialize.longest.label}
  1206. ITERATE {forward.pass}
  1207. REVERSE {reverse.pass}
  1208. FUNCTION {begin.bib}
  1209. { et.al.char.used
  1210. { "\newcommand{\etalchar}[1]{$^{#1}$}" write$ newline$ }
  1211. 'skip$
  1212. if$
  1213. preamble$ empty$
  1214. 'skip$
  1215. { preamble$ write$ newline$ }
  1216. if$
  1217. "\providecommand{\bysame}{\leavevmode\hbox to3em{\hrulefill}\thinspace}"
  1218. write$ newline$
  1219. "\begin{thebibliography}{" longest.label * "}" * write$ newline$
  1220. }
  1221. EXECUTE {begin.bib}
  1222. EXECUTE {init.state.consts}
  1223. ITERATE {call.type$}
  1224. FUNCTION {end.bib}
  1225. { newline$
  1226. "\end{thebibliography}" write$ newline$
  1227. }
  1228. EXECUTE {end.bib}
  1229. %% \CharacterTable
  1230. %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
  1231. %% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
  1232. %% Digits \0\1\2\3\4\5\6\7\8\9
  1233. %% Exclamation \! Double quote \" Hash (number) \#
  1234. %% Dollar \$ Percent \% Ampersand \&
  1235. %% Acute accent \' Left paren \( Right paren \)
  1236. %% Asterisk \* Plus \+ Comma \,
  1237. %% Minus \- Point \. Solidus \/
  1238. %% Colon \: Semicolon \; Less than \<
  1239. %% Equals \= Greater than \> Question mark \?
  1240. %% Commercial at \@ Left bracket \[ Backslash \\
  1241. %% Right bracket \] Circumflex \^ Underscore \_
  1242. %% Grave accent \` Left brace \{ Vertical bar \|
  1243. %% Right brace \} Tilde \~}