acl_natbib.bst 46 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976
  1. %%% acl_natbib.bst
  2. %%% Modification of BibTeX style file acl_natbib_nourl.bst
  3. %%% ... by urlbst, version 0.7 (marked with "% urlbst")
  4. %%% See <http://purl.org/nxg/dist/urlbst>
  5. %%% Added webpage entry type, and url and lastchecked fields.
  6. %%% Added eprint support.
  7. %%% Added DOI support.
  8. %%% Added PUBMED support.
  9. %%% Added hyperref support.
  10. %%% Original headers follow...
  11. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  12. %
  13. % BibTeX style file acl_natbib_nourl.bst
  14. %
  15. % intended as input to urlbst script
  16. % $ ./urlbst --hyperref --inlinelinks acl_natbib_nourl.bst > acl_natbib.bst
  17. %
  18. % adapted from compling.bst
  19. % in order to mimic the style files for ACL conferences prior to 2017
  20. % by making the following three changes:
  21. % - for @incollection, page numbers now follow volume title.
  22. % - for @inproceedings, address now follows conference name.
  23. % (address is intended as location of conference,
  24. % not address of publisher.)
  25. % - for papers with three authors, use et al. in citation
  26. % Dan Gildea 2017/06/08
  27. % - fixed a bug with format.chapter - error given if chapter is empty
  28. % with inbook.
  29. % Shay Cohen 2018/02/16
  30. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  31. %
  32. % BibTeX style file compling.bst
  33. %
  34. % Intended for the journal Computational Linguistics (ACL/MIT Press)
  35. % Created by Ron Artstein on 2005/08/22
  36. % For use with <natbib.sty> for author-year citations.
  37. %
  38. % I created this file in order to allow submissions to the journal
  39. % Computational Linguistics using the <natbib> package for author-year
  40. % citations, which offers a lot more flexibility than <fullname>, CL's
  41. % official citation package. This file adheres strictly to the official
  42. % style guide available from the MIT Press:
  43. %
  44. % http://mitpress.mit.edu/journals/coli/compling_style.pdf
  45. %
  46. % This includes all the various quirks of the style guide, for example:
  47. % - a chapter from a monograph (@inbook) has no page numbers.
  48. % - an article from an edited volume (@incollection) has page numbers
  49. % after the publisher and address.
  50. % - an article from a proceedings volume (@inproceedings) has page
  51. % numbers before the publisher and address.
  52. %
  53. % Where the style guide was inconsistent or not specific enough I
  54. % looked at actual published articles and exercised my own judgment.
  55. % I noticed two inconsistencies in the style guide:
  56. %
  57. % - The style guide gives one example of an article from an edited
  58. % volume with the editor's name spelled out in full, and another
  59. % with the editors' names abbreviated. I chose to accept the first
  60. % one as correct, since the style guide generally shuns abbreviations,
  61. % and editors' names are also spelled out in some recently published
  62. % articles.
  63. %
  64. % - The style guide gives one example of a reference where the word
  65. % "and" between two authors is preceded by a comma. This is most
  66. % likely a typo, since in all other cases with just two authors or
  67. % editors there is no comma before the word "and".
  68. %
  69. % One case where the style guide is not being specific is the placement
  70. % of the edition number, for which no example is given. I chose to put
  71. % it immediately after the title, which I (subjectively) find natural,
  72. % and is also the place of the edition in a few recently published
  73. % articles.
  74. %
  75. % This file correctly reproduces all of the examples in the official
  76. % style guide, except for the two inconsistencies noted above. I even
  77. % managed to get it to correctly format the proceedings example which
  78. % has an organization, a publisher, and two addresses (the conference
  79. % location and the publisher's address), though I cheated a bit by
  80. % putting the conference location and month as part of the title field;
  81. % I feel that in this case the conference location and month can be
  82. % considered as part of the title, and that adding a location field
  83. % is not justified. Note also that a location field is not standard,
  84. % so entries made with this field would not port nicely to other styles.
  85. % However, if authors feel that there's a need for a location field
  86. % then tell me and I'll see what I can do.
  87. %
  88. % The file also produces to my satisfaction all the bibliographical
  89. % entries in my recent (joint) submission to CL (this was the original
  90. % motivation for creating the file). I also tested it by running it
  91. % on a larger set of entries and eyeballing the results. There may of
  92. % course still be errors, especially with combinations of fields that
  93. % are not that common, or with cross-references (which I seldom use).
  94. % If you find such errors please write to me.
  95. %
  96. % I hope people find this file useful. Please email me with comments
  97. % and suggestions.
  98. %
  99. % Ron Artstein
  100. % artstein [at] essex.ac.uk
  101. % August 22, 2005.
  102. %
  103. % Some technical notes.
  104. %
  105. % This file is based on a file generated with the package <custom-bib>
  106. % by Patrick W. Daly (see selected options below), which was then
  107. % manually customized to conform with certain CL requirements which
  108. % cannot be met by <custom-bib>. Departures from the generated file
  109. % include:
  110. %
  111. % Function inbook: moved publisher and address to the end; moved
  112. % edition after title; replaced function format.chapter.pages by
  113. % new function format.chapter to output chapter without pages.
  114. %
  115. % Function inproceedings: moved publisher and address to the end;
  116. % replaced function format.in.ed.booktitle by new function
  117. % format.in.booktitle to output the proceedings title without
  118. % the editor.
  119. %
  120. % Functions book, incollection, manual: moved edition after title.
  121. %
  122. % Function mastersthesis: formatted title as for articles (unlike
  123. % phdthesis which is formatted as book) and added month.
  124. %
  125. % Function proceedings: added new.sentence between organization and
  126. % publisher when both are present.
  127. %
  128. % Function format.lab.names: modified so that it gives all the
  129. % authors' surnames for in-text citations for one, two and three
  130. % authors and only uses "et. al" for works with four authors or more
  131. % (thanks to Ken Shan for convincing me to go through the trouble of
  132. % modifying this function rather than using unreliable hacks).
  133. %
  134. % Changes:
  135. %
  136. % 2006-10-27: Changed function reverse.pass so that the extra label is
  137. % enclosed in parentheses when the year field ends in an uppercase or
  138. % lowercase letter (change modeled after Uli Sauerland's modification
  139. % of nals.bst). RA.
  140. %
  141. %
  142. % The preamble of the generated file begins below:
  143. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  144. %%
  145. %% This is file `compling.bst',
  146. %% generated with the docstrip utility.
  147. %%
  148. %% The original source files were:
  149. %%
  150. %% merlin.mbs (with options: `ay,nat,vonx,nm-revv1,jnrlst,keyxyr,blkyear,dt-beg,yr-per,note-yr,num-xser,pre-pub,xedn,nfss')
  151. %% ----------------------------------------
  152. %% *** Intended for the journal Computational Linguistics ***
  153. %%
  154. %% Copyright 1994-2002 Patrick W Daly
  155. % ===============================================================
  156. % IMPORTANT NOTICE:
  157. % This bibliographic style (bst) file has been generated from one or
  158. % more master bibliographic style (mbs) files, listed above.
  159. %
  160. % This generated file can be redistributed and/or modified under the terms
  161. % of the LaTeX Project Public License Distributed from CTAN
  162. % archives in directory macros/latex/base/lppl.txt; either
  163. % version 1 of the License, or any later version.
  164. % ===============================================================
  165. % Name and version information of the main mbs file:
  166. % \ProvidesFile{merlin.mbs}[2002/10/21 4.05 (PWD, AO, DPC)]
  167. % For use with BibTeX version 0.99a or later
  168. %-------------------------------------------------------------------
  169. % This bibliography style file is intended for texts in ENGLISH
  170. % This is an author-year citation style bibliography. As such, it is
  171. % non-standard LaTeX, and requires a special package file to function properly.
  172. % Such a package is natbib.sty by Patrick W. Daly
  173. % The form of the \bibitem entries is
  174. % \bibitem[Jones et al.(1990)]{key}...
  175. % \bibitem[Jones et al.(1990)Jones, Baker, and Smith]{key}...
  176. % The essential feature is that the label (the part in brackets) consists
  177. % of the author names, as they should appear in the citation, with the year
  178. % in parentheses following. There must be no space before the opening
  179. % parenthesis!
  180. % With natbib v5.3, a full list of authors may also follow the year.
  181. % In natbib.sty, it is possible to define the type of enclosures that is
  182. % really wanted (brackets or parentheses), but in either case, there must
  183. % be parentheses in the label.
  184. % The \cite command functions as follows:
  185. % \citet{key} ==>> Jones et al. (1990)
  186. % \citet*{key} ==>> Jones, Baker, and Smith (1990)
  187. % \citep{key} ==>> (Jones et al., 1990)
  188. % \citep*{key} ==>> (Jones, Baker, and Smith, 1990)
  189. % \citep[chap. 2]{key} ==>> (Jones et al., 1990, chap. 2)
  190. % \citep[e.g.][]{key} ==>> (e.g. Jones et al., 1990)
  191. % \citep[e.g.][p. 32]{key} ==>> (e.g. Jones et al., p. 32)
  192. % \citeauthor{key} ==>> Jones et al.
  193. % \citeauthor*{key} ==>> Jones, Baker, and Smith
  194. % \citeyear{key} ==>> 1990
  195. %---------------------------------------------------------------------
  196. ENTRY
  197. { address
  198. author
  199. booktitle
  200. chapter
  201. edition
  202. editor
  203. howpublished
  204. institution
  205. journal
  206. key
  207. month
  208. note
  209. number
  210. organization
  211. pages
  212. publisher
  213. school
  214. series
  215. title
  216. type
  217. volume
  218. year
  219. eprint % urlbst
  220. doi % urlbst
  221. pubmed % urlbst
  222. url % urlbst
  223. lastchecked % urlbst
  224. }
  225. {}
  226. { label extra.label sort.label short.list }
  227. INTEGERS { output.state before.all mid.sentence after.sentence after.block }
  228. % urlbst...
  229. % urlbst constants and state variables
  230. STRINGS { urlintro
  231. eprinturl eprintprefix doiprefix doiurl pubmedprefix pubmedurl
  232. citedstring onlinestring linktextstring
  233. openinlinelink closeinlinelink }
  234. INTEGERS { hrefform inlinelinks makeinlinelink
  235. addeprints adddoiresolver addpubmedresolver }
  236. FUNCTION {init.urlbst.variables}
  237. {
  238. % The following constants may be adjusted by hand, if desired
  239. % The first set allow you to enable or disable certain functionality.
  240. #1 'addeprints := % 0=no eprints; 1=include eprints
  241. #1 'adddoiresolver := % 0=no DOI resolver; 1=include it
  242. #1 'addpubmedresolver := % 0=no PUBMED resolver; 1=include it
  243. #2 'hrefform := % 0=no crossrefs; 1=hypertex xrefs; 2=hyperref refs
  244. #1 'inlinelinks := % 0=URLs explicit; 1=URLs attached to titles
  245. % String constants, which you _might_ want to tweak.
  246. "URL: " 'urlintro := % prefix before URL; typically "Available from:" or "URL":
  247. "online" 'onlinestring := % indication that resource is online; typically "online"
  248. "cited " 'citedstring := % indicator of citation date; typically "cited "
  249. "[link]" 'linktextstring := % dummy link text; typically "[link]"
  250. "http://arxiv.org/abs/" 'eprinturl := % prefix to make URL from eprint ref
  251. "arXiv:" 'eprintprefix := % text prefix printed before eprint ref; typically "arXiv:"
  252. "https://doi.org/" 'doiurl := % prefix to make URL from DOI
  253. "doi:" 'doiprefix := % text prefix printed before DOI ref; typically "doi:"
  254. "http://www.ncbi.nlm.nih.gov/pubmed/" 'pubmedurl := % prefix to make URL from PUBMED
  255. "PMID:" 'pubmedprefix := % text prefix printed before PUBMED ref; typically "PMID:"
  256. % The following are internal state variables, not configuration constants,
  257. % so they shouldn't be fiddled with.
  258. #0 'makeinlinelink := % state variable managed by possibly.setup.inlinelink
  259. "" 'openinlinelink := % ditto
  260. "" 'closeinlinelink := % ditto
  261. }
  262. INTEGERS {
  263. bracket.state
  264. outside.brackets
  265. open.brackets
  266. within.brackets
  267. close.brackets
  268. }
  269. % ...urlbst to here
  270. FUNCTION {init.state.consts}
  271. { #0 'outside.brackets := % urlbst...
  272. #1 'open.brackets :=
  273. #2 'within.brackets :=
  274. #3 'close.brackets := % ...urlbst to here
  275. #0 'before.all :=
  276. #1 'mid.sentence :=
  277. #2 'after.sentence :=
  278. #3 'after.block :=
  279. }
  280. STRINGS { s t}
  281. % urlbst
  282. FUNCTION {output.nonnull.original}
  283. { 's :=
  284. output.state mid.sentence =
  285. { ", " * write$ }
  286. { output.state after.block =
  287. { add.period$ write$
  288. newline$
  289. "\newblock " write$
  290. }
  291. { output.state before.all =
  292. 'write$
  293. { add.period$ " " * write$ }
  294. if$
  295. }
  296. if$
  297. mid.sentence 'output.state :=
  298. }
  299. if$
  300. s
  301. }
  302. % urlbst...
  303. % The following three functions are for handling inlinelink. They wrap
  304. % a block of text which is potentially output with write$ by multiple
  305. % other functions, so we don't know the content a priori.
  306. % They communicate between each other using the variables makeinlinelink
  307. % (which is true if a link should be made), and closeinlinelink (which holds
  308. % the string which should close any current link. They can be called
  309. % at any time, but start.inlinelink will be a no-op unless something has
  310. % previously set makeinlinelink true, and the two ...end.inlinelink functions
  311. % will only do their stuff if start.inlinelink has previously set
  312. % closeinlinelink to be non-empty.
  313. % (thanks to 'ijvm' for suggested code here)
  314. FUNCTION {uand}
  315. { 'skip$ { pop$ #0 } if$ } % 'and' (which isn't defined at this point in the file)
  316. FUNCTION {possibly.setup.inlinelink}
  317. { makeinlinelink hrefform #0 > uand
  318. { doi empty$ adddoiresolver uand
  319. { pubmed empty$ addpubmedresolver uand
  320. { eprint empty$ addeprints uand
  321. { url empty$
  322. { "" }
  323. { url }
  324. if$ }
  325. { eprinturl eprint * }
  326. if$ }
  327. { pubmedurl pubmed * }
  328. if$ }
  329. { doiurl doi * }
  330. if$
  331. % an appropriately-formatted URL is now on the stack
  332. hrefform #1 = % hypertex
  333. { "\special {html:<a href=" quote$ * swap$ * quote$ * "> }{" * 'openinlinelink :=
  334. "\special {html:</a>}" 'closeinlinelink := }
  335. { "\href {" swap$ * "} {" * 'openinlinelink := % hrefform=#2 -- hyperref
  336. % the space between "} {" matters: a URL of just the right length can cause "\% newline em"
  337. "}" 'closeinlinelink := }
  338. if$
  339. #0 'makeinlinelink :=
  340. }
  341. 'skip$
  342. if$ % makeinlinelink
  343. }
  344. FUNCTION {add.inlinelink}
  345. { openinlinelink empty$
  346. 'skip$
  347. { openinlinelink swap$ * closeinlinelink *
  348. "" 'openinlinelink :=
  349. }
  350. if$
  351. }
  352. FUNCTION {output.nonnull}
  353. { % Save the thing we've been asked to output
  354. 's :=
  355. % If the bracket-state is close.brackets, then add a close-bracket to
  356. % what is currently at the top of the stack, and set bracket.state
  357. % to outside.brackets
  358. bracket.state close.brackets =
  359. { "]" *
  360. outside.brackets 'bracket.state :=
  361. }
  362. 'skip$
  363. if$
  364. bracket.state outside.brackets =
  365. { % We're outside all brackets -- this is the normal situation.
  366. % Write out what's currently at the top of the stack, using the
  367. % original output.nonnull function.
  368. s
  369. add.inlinelink
  370. output.nonnull.original % invoke the original output.nonnull
  371. }
  372. { % Still in brackets. Add open-bracket or (continuation) comma, add the
  373. % new text (in s) to the top of the stack, and move to the close-brackets
  374. % state, ready for next time (unless inbrackets resets it). If we come
  375. % into this branch, then output.state is carefully undisturbed.
  376. bracket.state open.brackets =
  377. { " [" * }
  378. { ", " * } % bracket.state will be within.brackets
  379. if$
  380. s *
  381. close.brackets 'bracket.state :=
  382. }
  383. if$
  384. }
  385. % Call this function just before adding something which should be presented in
  386. % brackets. bracket.state is handled specially within output.nonnull.
  387. FUNCTION {inbrackets}
  388. { bracket.state close.brackets =
  389. { within.brackets 'bracket.state := } % reset the state: not open nor closed
  390. { open.brackets 'bracket.state := }
  391. if$
  392. }
  393. FUNCTION {format.lastchecked}
  394. { lastchecked empty$
  395. { "" }
  396. { inbrackets citedstring lastchecked * }
  397. if$
  398. }
  399. % ...urlbst to here
  400. FUNCTION {output}
  401. { duplicate$ empty$
  402. 'pop$
  403. 'output.nonnull
  404. if$
  405. }
  406. FUNCTION {output.check}
  407. { 't :=
  408. duplicate$ empty$
  409. { pop$ "empty " t * " in " * cite$ * warning$ }
  410. 'output.nonnull
  411. if$
  412. }
  413. FUNCTION {fin.entry.original} % urlbst (renamed from fin.entry, so it can be wrapped below)
  414. { add.period$
  415. write$
  416. newline$
  417. }
  418. FUNCTION {new.block}
  419. { output.state before.all =
  420. 'skip$
  421. { after.block 'output.state := }
  422. if$
  423. }
  424. FUNCTION {new.sentence}
  425. { output.state after.block =
  426. 'skip$
  427. { output.state before.all =
  428. 'skip$
  429. { after.sentence 'output.state := }
  430. if$
  431. }
  432. if$
  433. }
  434. FUNCTION {add.blank}
  435. { " " * before.all 'output.state :=
  436. }
  437. FUNCTION {date.block}
  438. {
  439. new.block
  440. }
  441. FUNCTION {not}
  442. { { #0 }
  443. { #1 }
  444. if$
  445. }
  446. FUNCTION {and}
  447. { 'skip$
  448. { pop$ #0 }
  449. if$
  450. }
  451. FUNCTION {or}
  452. { { pop$ #1 }
  453. 'skip$
  454. if$
  455. }
  456. FUNCTION {new.block.checkb}
  457. { empty$
  458. swap$ empty$
  459. and
  460. 'skip$
  461. 'new.block
  462. if$
  463. }
  464. FUNCTION {field.or.null}
  465. { duplicate$ empty$
  466. { pop$ "" }
  467. 'skip$
  468. if$
  469. }
  470. FUNCTION {emphasize}
  471. { duplicate$ empty$
  472. { pop$ "" }
  473. { "\emph{" swap$ * "}" * }
  474. if$
  475. }
  476. FUNCTION {tie.or.space.prefix}
  477. { duplicate$ text.length$ #3 <
  478. { "~" }
  479. { " " }
  480. if$
  481. swap$
  482. }
  483. FUNCTION {capitalize}
  484. { "u" change.case$ "t" change.case$ }
  485. FUNCTION {space.word}
  486. { " " swap$ * " " * }
  487. % Here are the language-specific definitions for explicit words.
  488. % Each function has a name bbl.xxx where xxx is the English word.
  489. % The language selected here is ENGLISH
  490. FUNCTION {bbl.and}
  491. { "and"}
  492. FUNCTION {bbl.etal}
  493. { "et~al." }
  494. FUNCTION {bbl.editors}
  495. { "editors" }
  496. FUNCTION {bbl.editor}
  497. { "editor" }
  498. FUNCTION {bbl.edby}
  499. { "edited by" }
  500. FUNCTION {bbl.edition}
  501. { "edition" }
  502. FUNCTION {bbl.volume}
  503. { "volume" }
  504. FUNCTION {bbl.of}
  505. { "of" }
  506. FUNCTION {bbl.number}
  507. { "number" }
  508. FUNCTION {bbl.nr}
  509. { "no." }
  510. FUNCTION {bbl.in}
  511. { "in" }
  512. FUNCTION {bbl.pages}
  513. { "pages" }
  514. FUNCTION {bbl.page}
  515. { "page" }
  516. FUNCTION {bbl.chapter}
  517. { "chapter" }
  518. FUNCTION {bbl.techrep}
  519. { "Technical Report" }
  520. FUNCTION {bbl.mthesis}
  521. { "Master's thesis" }
  522. FUNCTION {bbl.phdthesis}
  523. { "Ph.D. thesis" }
  524. MACRO {jan} {"January"}
  525. MACRO {feb} {"February"}
  526. MACRO {mar} {"March"}
  527. MACRO {apr} {"April"}
  528. MACRO {may} {"May"}
  529. MACRO {jun} {"June"}
  530. MACRO {jul} {"July"}
  531. MACRO {aug} {"August"}
  532. MACRO {sep} {"September"}
  533. MACRO {oct} {"October"}
  534. MACRO {nov} {"November"}
  535. MACRO {dec} {"December"}
  536. MACRO {acmcs} {"ACM Computing Surveys"}
  537. MACRO {acta} {"Acta Informatica"}
  538. MACRO {cacm} {"Communications of the ACM"}
  539. MACRO {ibmjrd} {"IBM Journal of Research and Development"}
  540. MACRO {ibmsj} {"IBM Systems Journal"}
  541. MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
  542. MACRO {ieeetc} {"IEEE Transactions on Computers"}
  543. MACRO {ieeetcad}
  544. {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
  545. MACRO {ipl} {"Information Processing Letters"}
  546. MACRO {jacm} {"Journal of the ACM"}
  547. MACRO {jcss} {"Journal of Computer and System Sciences"}
  548. MACRO {scp} {"Science of Computer Programming"}
  549. MACRO {sicomp} {"SIAM Journal on Computing"}
  550. MACRO {tocs} {"ACM Transactions on Computer Systems"}
  551. MACRO {tods} {"ACM Transactions on Database Systems"}
  552. MACRO {tog} {"ACM Transactions on Graphics"}
  553. MACRO {toms} {"ACM Transactions on Mathematical Software"}
  554. MACRO {toois} {"ACM Transactions on Office Information Systems"}
  555. MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
  556. MACRO {tcs} {"Theoretical Computer Science"}
  557. FUNCTION {bibinfo.check}
  558. { swap$
  559. duplicate$ missing$
  560. {
  561. pop$ pop$
  562. ""
  563. }
  564. { duplicate$ empty$
  565. {
  566. swap$ pop$
  567. }
  568. { swap$
  569. pop$
  570. }
  571. if$
  572. }
  573. if$
  574. }
  575. FUNCTION {bibinfo.warn}
  576. { swap$
  577. duplicate$ missing$
  578. {
  579. swap$ "missing " swap$ * " in " * cite$ * warning$ pop$
  580. ""
  581. }
  582. { duplicate$ empty$
  583. {
  584. swap$ "empty " swap$ * " in " * cite$ * warning$
  585. }
  586. { swap$
  587. pop$
  588. }
  589. if$
  590. }
  591. if$
  592. }
  593. STRINGS { bibinfo}
  594. INTEGERS { nameptr namesleft numnames }
  595. FUNCTION {format.names}
  596. { 'bibinfo :=
  597. duplicate$ empty$ 'skip$ {
  598. 's :=
  599. "" 't :=
  600. #1 'nameptr :=
  601. s num.names$ 'numnames :=
  602. numnames 'namesleft :=
  603. { namesleft #0 > }
  604. { s nameptr
  605. duplicate$ #1 >
  606. { "{ff~}{vv~}{ll}{, jj}" }
  607. { "{ff~}{vv~}{ll}{, jj}" } % first name first for first author
  608. % { "{vv~}{ll}{, ff}{, jj}" } % last name first for first author
  609. if$
  610. format.name$
  611. bibinfo bibinfo.check
  612. 't :=
  613. nameptr #1 >
  614. {
  615. namesleft #1 >
  616. { ", " * t * }
  617. {
  618. numnames #2 >
  619. { "," * }
  620. 'skip$
  621. if$
  622. s nameptr "{ll}" format.name$ duplicate$ "others" =
  623. { 't := }
  624. { pop$ }
  625. if$
  626. t "others" =
  627. {
  628. " " * bbl.etal *
  629. }
  630. {
  631. bbl.and
  632. space.word * t *
  633. }
  634. if$
  635. }
  636. if$
  637. }
  638. 't
  639. if$
  640. nameptr #1 + 'nameptr :=
  641. namesleft #1 - 'namesleft :=
  642. }
  643. while$
  644. } if$
  645. }
  646. FUNCTION {format.names.ed}
  647. {
  648. 'bibinfo :=
  649. duplicate$ empty$ 'skip$ {
  650. 's :=
  651. "" 't :=
  652. #1 'nameptr :=
  653. s num.names$ 'numnames :=
  654. numnames 'namesleft :=
  655. { namesleft #0 > }
  656. { s nameptr
  657. "{ff~}{vv~}{ll}{, jj}"
  658. format.name$
  659. bibinfo bibinfo.check
  660. 't :=
  661. nameptr #1 >
  662. {
  663. namesleft #1 >
  664. { ", " * t * }
  665. {
  666. numnames #2 >
  667. { "," * }
  668. 'skip$
  669. if$
  670. s nameptr "{ll}" format.name$ duplicate$ "others" =
  671. { 't := }
  672. { pop$ }
  673. if$
  674. t "others" =
  675. {
  676. " " * bbl.etal *
  677. }
  678. {
  679. bbl.and
  680. space.word * t *
  681. }
  682. if$
  683. }
  684. if$
  685. }
  686. 't
  687. if$
  688. nameptr #1 + 'nameptr :=
  689. namesleft #1 - 'namesleft :=
  690. }
  691. while$
  692. } if$
  693. }
  694. FUNCTION {format.key}
  695. { empty$
  696. { key field.or.null }
  697. { "" }
  698. if$
  699. }
  700. FUNCTION {format.authors}
  701. { author "author" format.names
  702. }
  703. FUNCTION {get.bbl.editor}
  704. { editor num.names$ #1 > 'bbl.editors 'bbl.editor if$ }
  705. FUNCTION {format.editors}
  706. { editor "editor" format.names duplicate$ empty$ 'skip$
  707. {
  708. "," *
  709. " " *
  710. get.bbl.editor
  711. *
  712. }
  713. if$
  714. }
  715. FUNCTION {format.note}
  716. {
  717. note empty$
  718. { "" }
  719. { note #1 #1 substring$
  720. duplicate$ "{" =
  721. 'skip$
  722. { output.state mid.sentence =
  723. { "l" }
  724. { "u" }
  725. if$
  726. change.case$
  727. }
  728. if$
  729. note #2 global.max$ substring$ * "note" bibinfo.check
  730. }
  731. if$
  732. }
  733. FUNCTION {format.title}
  734. { title
  735. duplicate$ empty$ 'skip$
  736. { "t" change.case$ }
  737. if$
  738. "title" bibinfo.check
  739. }
  740. FUNCTION {format.full.names}
  741. {'s :=
  742. "" 't :=
  743. #1 'nameptr :=
  744. s num.names$ 'numnames :=
  745. numnames 'namesleft :=
  746. { namesleft #0 > }
  747. { s nameptr
  748. "{vv~}{ll}" format.name$
  749. 't :=
  750. nameptr #1 >
  751. {
  752. namesleft #1 >
  753. { ", " * t * }
  754. {
  755. s nameptr "{ll}" format.name$ duplicate$ "others" =
  756. { 't := }
  757. { pop$ }
  758. if$
  759. t "others" =
  760. {
  761. " " * bbl.etal *
  762. }
  763. {
  764. numnames #2 >
  765. { "," * }
  766. 'skip$
  767. if$
  768. bbl.and
  769. space.word * t *
  770. }
  771. if$
  772. }
  773. if$
  774. }
  775. 't
  776. if$
  777. nameptr #1 + 'nameptr :=
  778. namesleft #1 - 'namesleft :=
  779. }
  780. while$
  781. }
  782. FUNCTION {author.editor.key.full}
  783. { author empty$
  784. { editor empty$
  785. { key empty$
  786. { cite$ #1 #3 substring$ }
  787. 'key
  788. if$
  789. }
  790. { editor format.full.names }
  791. if$
  792. }
  793. { author format.full.names }
  794. if$
  795. }
  796. FUNCTION {author.key.full}
  797. { author empty$
  798. { key empty$
  799. { cite$ #1 #3 substring$ }
  800. 'key
  801. if$
  802. }
  803. { author format.full.names }
  804. if$
  805. }
  806. FUNCTION {editor.key.full}
  807. { editor empty$
  808. { key empty$
  809. { cite$ #1 #3 substring$ }
  810. 'key
  811. if$
  812. }
  813. { editor format.full.names }
  814. if$
  815. }
  816. FUNCTION {make.full.names}
  817. { type$ "book" =
  818. type$ "inbook" =
  819. or
  820. 'author.editor.key.full
  821. { type$ "proceedings" =
  822. 'editor.key.full
  823. 'author.key.full
  824. if$
  825. }
  826. if$
  827. }
  828. FUNCTION {output.bibitem.original} % urlbst (renamed from output.bibitem, so it can be wrapped below)
  829. { newline$
  830. "\bibitem[{" write$
  831. label write$
  832. ")" make.full.names duplicate$ short.list =
  833. { pop$ }
  834. { * }
  835. if$
  836. "}]{" * write$
  837. cite$ write$
  838. "}" write$
  839. newline$
  840. ""
  841. before.all 'output.state :=
  842. }
  843. FUNCTION {n.dashify}
  844. {
  845. 't :=
  846. ""
  847. { t empty$ not }
  848. { t #1 #1 substring$ "-" =
  849. { t #1 #2 substring$ "--" = not
  850. { "--" *
  851. t #2 global.max$ substring$ 't :=
  852. }
  853. { { t #1 #1 substring$ "-" = }
  854. { "-" *
  855. t #2 global.max$ substring$ 't :=
  856. }
  857. while$
  858. }
  859. if$
  860. }
  861. { t #1 #1 substring$ *
  862. t #2 global.max$ substring$ 't :=
  863. }
  864. if$
  865. }
  866. while$
  867. }
  868. FUNCTION {word.in}
  869. { bbl.in capitalize
  870. " " * }
  871. FUNCTION {format.date}
  872. { year "year" bibinfo.check duplicate$ empty$
  873. {
  874. }
  875. 'skip$
  876. if$
  877. extra.label *
  878. before.all 'output.state :=
  879. after.sentence 'output.state :=
  880. }
  881. FUNCTION {format.btitle}
  882. { title "title" bibinfo.check
  883. duplicate$ empty$ 'skip$
  884. {
  885. emphasize
  886. }
  887. if$
  888. }
  889. FUNCTION {either.or.check}
  890. { empty$
  891. 'pop$
  892. { "can't use both " swap$ * " fields in " * cite$ * warning$ }
  893. if$
  894. }
  895. FUNCTION {format.bvolume}
  896. { volume empty$
  897. { "" }
  898. { bbl.volume volume tie.or.space.prefix
  899. "volume" bibinfo.check * *
  900. series "series" bibinfo.check
  901. duplicate$ empty$ 'pop$
  902. { swap$ bbl.of space.word * swap$
  903. emphasize * }
  904. if$
  905. "volume and number" number either.or.check
  906. }
  907. if$
  908. }
  909. FUNCTION {format.number.series}
  910. { volume empty$
  911. { number empty$
  912. { series field.or.null }
  913. { series empty$
  914. { number "number" bibinfo.check }
  915. { output.state mid.sentence =
  916. { bbl.number }
  917. { bbl.number capitalize }
  918. if$
  919. number tie.or.space.prefix "number" bibinfo.check * *
  920. bbl.in space.word *
  921. series "series" bibinfo.check *
  922. }
  923. if$
  924. }
  925. if$
  926. }
  927. { "" }
  928. if$
  929. }
  930. FUNCTION {format.edition}
  931. { edition duplicate$ empty$ 'skip$
  932. {
  933. output.state mid.sentence =
  934. { "l" }
  935. { "t" }
  936. if$ change.case$
  937. "edition" bibinfo.check
  938. " " * bbl.edition *
  939. }
  940. if$
  941. }
  942. INTEGERS { multiresult }
  943. FUNCTION {multi.page.check}
  944. { 't :=
  945. #0 'multiresult :=
  946. { multiresult not
  947. t empty$ not
  948. and
  949. }
  950. { t #1 #1 substring$
  951. duplicate$ "-" =
  952. swap$ duplicate$ "," =
  953. swap$ "+" =
  954. or or
  955. { #1 'multiresult := }
  956. { t #2 global.max$ substring$ 't := }
  957. if$
  958. }
  959. while$
  960. multiresult
  961. }
  962. FUNCTION {format.pages}
  963. { pages duplicate$ empty$ 'skip$
  964. { duplicate$ multi.page.check
  965. {
  966. bbl.pages swap$
  967. n.dashify
  968. }
  969. {
  970. bbl.page swap$
  971. }
  972. if$
  973. tie.or.space.prefix
  974. "pages" bibinfo.check
  975. * *
  976. }
  977. if$
  978. }
  979. FUNCTION {format.journal.pages}
  980. { pages duplicate$ empty$ 'pop$
  981. { swap$ duplicate$ empty$
  982. { pop$ pop$ format.pages }
  983. {
  984. ":" *
  985. swap$
  986. n.dashify
  987. "pages" bibinfo.check
  988. *
  989. }
  990. if$
  991. }
  992. if$
  993. }
  994. FUNCTION {format.vol.num.pages}
  995. { volume field.or.null
  996. duplicate$ empty$ 'skip$
  997. {
  998. "volume" bibinfo.check
  999. }
  1000. if$
  1001. number "number" bibinfo.check duplicate$ empty$ 'skip$
  1002. {
  1003. swap$ duplicate$ empty$
  1004. { "there's a number but no volume in " cite$ * warning$ }
  1005. 'skip$
  1006. if$
  1007. swap$
  1008. "(" swap$ * ")" *
  1009. }
  1010. if$ *
  1011. format.journal.pages
  1012. }
  1013. FUNCTION {format.chapter}
  1014. { chapter empty$
  1015. 'format.pages
  1016. { type empty$
  1017. { bbl.chapter }
  1018. { type "l" change.case$
  1019. "type" bibinfo.check
  1020. }
  1021. if$
  1022. chapter tie.or.space.prefix
  1023. "chapter" bibinfo.check
  1024. * *
  1025. }
  1026. if$
  1027. }
  1028. FUNCTION {format.chapter.pages}
  1029. { chapter empty$
  1030. 'format.pages
  1031. { type empty$
  1032. { bbl.chapter }
  1033. { type "l" change.case$
  1034. "type" bibinfo.check
  1035. }
  1036. if$
  1037. chapter tie.or.space.prefix
  1038. "chapter" bibinfo.check
  1039. * *
  1040. pages empty$
  1041. 'skip$
  1042. { ", " * format.pages * }
  1043. if$
  1044. }
  1045. if$
  1046. }
  1047. FUNCTION {format.booktitle}
  1048. {
  1049. booktitle "booktitle" bibinfo.check
  1050. emphasize
  1051. }
  1052. FUNCTION {format.in.booktitle}
  1053. { format.booktitle duplicate$ empty$ 'skip$
  1054. {
  1055. word.in swap$ *
  1056. }
  1057. if$
  1058. }
  1059. FUNCTION {format.in.ed.booktitle}
  1060. { format.booktitle duplicate$ empty$ 'skip$
  1061. {
  1062. editor "editor" format.names.ed duplicate$ empty$ 'pop$
  1063. {
  1064. "," *
  1065. " " *
  1066. get.bbl.editor
  1067. ", " *
  1068. * swap$
  1069. * }
  1070. if$
  1071. word.in swap$ *
  1072. }
  1073. if$
  1074. }
  1075. FUNCTION {format.thesis.type}
  1076. { type duplicate$ empty$
  1077. 'pop$
  1078. { swap$ pop$
  1079. "t" change.case$ "type" bibinfo.check
  1080. }
  1081. if$
  1082. }
  1083. FUNCTION {format.tr.number}
  1084. { number "number" bibinfo.check
  1085. type duplicate$ empty$
  1086. { pop$ bbl.techrep }
  1087. 'skip$
  1088. if$
  1089. "type" bibinfo.check
  1090. swap$ duplicate$ empty$
  1091. { pop$ "t" change.case$ }
  1092. { tie.or.space.prefix * * }
  1093. if$
  1094. }
  1095. FUNCTION {format.article.crossref}
  1096. {
  1097. word.in
  1098. " \cite{" * crossref * "}" *
  1099. }
  1100. FUNCTION {format.book.crossref}
  1101. { volume duplicate$ empty$
  1102. { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
  1103. pop$ word.in
  1104. }
  1105. { bbl.volume
  1106. capitalize
  1107. swap$ tie.or.space.prefix "volume" bibinfo.check * * bbl.of space.word *
  1108. }
  1109. if$
  1110. " \cite{" * crossref * "}" *
  1111. }
  1112. FUNCTION {format.incoll.inproc.crossref}
  1113. {
  1114. word.in
  1115. " \cite{" * crossref * "}" *
  1116. }
  1117. FUNCTION {format.org.or.pub}
  1118. { 't :=
  1119. ""
  1120. address empty$ t empty$ and
  1121. 'skip$
  1122. {
  1123. t empty$
  1124. { address "address" bibinfo.check *
  1125. }
  1126. { t *
  1127. address empty$
  1128. 'skip$
  1129. { ", " * address "address" bibinfo.check * }
  1130. if$
  1131. }
  1132. if$
  1133. }
  1134. if$
  1135. }
  1136. FUNCTION {format.publisher.address}
  1137. { publisher "publisher" bibinfo.warn format.org.or.pub
  1138. }
  1139. FUNCTION {format.organization.address}
  1140. { organization "organization" bibinfo.check format.org.or.pub
  1141. }
  1142. % urlbst...
  1143. % Functions for making hypertext links.
  1144. % In all cases, the stack has (link-text href-url)
  1145. %
  1146. % make 'null' specials
  1147. FUNCTION {make.href.null}
  1148. {
  1149. pop$
  1150. }
  1151. % make hypertex specials
  1152. FUNCTION {make.href.hypertex}
  1153. {
  1154. "\special {html:<a href=" quote$ *
  1155. swap$ * quote$ * "> }" * swap$ *
  1156. "\special {html:</a>}" *
  1157. }
  1158. % make hyperref specials
  1159. FUNCTION {make.href.hyperref}
  1160. {
  1161. "\href {" swap$ * "} {\path{" * swap$ * "}}" *
  1162. }
  1163. FUNCTION {make.href}
  1164. { hrefform #2 =
  1165. 'make.href.hyperref % hrefform = 2
  1166. { hrefform #1 =
  1167. 'make.href.hypertex % hrefform = 1
  1168. 'make.href.null % hrefform = 0 (or anything else)
  1169. if$
  1170. }
  1171. if$
  1172. }
  1173. % If inlinelinks is true, then format.url should be a no-op, since it's
  1174. % (a) redundant, and (b) could end up as a link-within-a-link.
  1175. FUNCTION {format.url}
  1176. { inlinelinks #1 = url empty$ or
  1177. { "" }
  1178. { hrefform #1 =
  1179. { % special case -- add HyperTeX specials
  1180. urlintro "\url{" url * "}" * url make.href.hypertex * }
  1181. { urlintro "\url{" * url * "}" * }
  1182. if$
  1183. }
  1184. if$
  1185. }
  1186. FUNCTION {format.eprint}
  1187. { eprint empty$
  1188. { "" }
  1189. { eprintprefix eprint * eprinturl eprint * make.href }
  1190. if$
  1191. }
  1192. FUNCTION {format.doi}
  1193. { doi empty$
  1194. { "" }
  1195. { doiprefix doi * doiurl doi * make.href }
  1196. if$
  1197. }
  1198. FUNCTION {format.pubmed}
  1199. { pubmed empty$
  1200. { "" }
  1201. { pubmedprefix pubmed * pubmedurl pubmed * make.href }
  1202. if$
  1203. }
  1204. % Output a URL. We can't use the more normal idiom (something like
  1205. % `format.url output'), because the `inbrackets' within
  1206. % format.lastchecked applies to everything between calls to `output',
  1207. % so that `format.url format.lastchecked * output' ends up with both
  1208. % the URL and the lastchecked in brackets.
  1209. FUNCTION {output.url}
  1210. { url empty$
  1211. 'skip$
  1212. { new.block
  1213. format.url output
  1214. format.lastchecked output
  1215. }
  1216. if$
  1217. }
  1218. FUNCTION {output.web.refs}
  1219. {
  1220. new.block
  1221. inlinelinks
  1222. 'skip$ % links were inline -- don't repeat them
  1223. {
  1224. output.url
  1225. addeprints eprint empty$ not and
  1226. { format.eprint output.nonnull }
  1227. 'skip$
  1228. if$
  1229. adddoiresolver doi empty$ not and
  1230. { format.doi output.nonnull }
  1231. 'skip$
  1232. if$
  1233. addpubmedresolver pubmed empty$ not and
  1234. { format.pubmed output.nonnull }
  1235. 'skip$
  1236. if$
  1237. }
  1238. if$
  1239. }
  1240. % Wrapper for output.bibitem.original.
  1241. % If the URL field is not empty, set makeinlinelink to be true,
  1242. % so that an inline link will be started at the next opportunity
  1243. FUNCTION {output.bibitem}
  1244. { outside.brackets 'bracket.state :=
  1245. output.bibitem.original
  1246. inlinelinks url empty$ not doi empty$ not or pubmed empty$ not or eprint empty$ not or and
  1247. { #1 'makeinlinelink := }
  1248. { #0 'makeinlinelink := }
  1249. if$
  1250. }
  1251. % Wrapper for fin.entry.original
  1252. FUNCTION {fin.entry}
  1253. { output.web.refs % urlbst
  1254. makeinlinelink % ooops, it appears we didn't have a title for inlinelink
  1255. { possibly.setup.inlinelink % add some artificial link text here, as a fallback
  1256. linktextstring output.nonnull }
  1257. 'skip$
  1258. if$
  1259. bracket.state close.brackets = % urlbst
  1260. { "]" * }
  1261. 'skip$
  1262. if$
  1263. fin.entry.original
  1264. }
  1265. % Webpage entry type.
  1266. % Title and url fields required;
  1267. % author, note, year, month, and lastchecked fields optional
  1268. % See references
  1269. % ISO 690-2 http://www.nlc-bnc.ca/iso/tc46sc9/standard/690-2e.htm
  1270. % http://www.classroom.net/classroom/CitingNetResources.html
  1271. % http://neal.ctstateu.edu/history/cite.html
  1272. % http://www.cas.usf.edu/english/walker/mla.html
  1273. % for citation formats for web pages.
  1274. FUNCTION {webpage}
  1275. { output.bibitem
  1276. author empty$
  1277. { editor empty$
  1278. 'skip$ % author and editor both optional
  1279. { format.editors output.nonnull }
  1280. if$
  1281. }
  1282. { editor empty$
  1283. { format.authors output.nonnull }
  1284. { "can't use both author and editor fields in " cite$ * warning$ }
  1285. if$
  1286. }
  1287. if$
  1288. new.block
  1289. title empty$ 'skip$ 'possibly.setup.inlinelink if$
  1290. format.title "title" output.check
  1291. inbrackets onlinestring output
  1292. new.block
  1293. year empty$
  1294. 'skip$
  1295. { format.date "year" output.check }
  1296. if$
  1297. % We don't need to output the URL details ('lastchecked' and 'url'),
  1298. % because fin.entry does that for us, using output.web.refs. The only
  1299. % reason we would want to put them here is if we were to decide that
  1300. % they should go in front of the rather miscellaneous information in 'note'.
  1301. new.block
  1302. note output
  1303. fin.entry
  1304. }
  1305. % ...urlbst to here
  1306. FUNCTION {article}
  1307. { output.bibitem
  1308. format.authors "author" output.check
  1309. author format.key output
  1310. format.date "year" output.check
  1311. date.block
  1312. title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst
  1313. format.title "title" output.check
  1314. new.block
  1315. crossref missing$
  1316. {
  1317. journal
  1318. "journal" bibinfo.check
  1319. emphasize
  1320. "journal" output.check
  1321. possibly.setup.inlinelink format.vol.num.pages output% urlbst
  1322. }
  1323. { format.article.crossref output.nonnull
  1324. format.pages output
  1325. }
  1326. if$
  1327. new.block
  1328. format.note output
  1329. fin.entry
  1330. }
  1331. FUNCTION {book}
  1332. { output.bibitem
  1333. author empty$
  1334. { format.editors "author and editor" output.check
  1335. editor format.key output
  1336. }
  1337. { format.authors output.nonnull
  1338. crossref missing$
  1339. { "author and editor" editor either.or.check }
  1340. 'skip$
  1341. if$
  1342. }
  1343. if$
  1344. format.date "year" output.check
  1345. date.block
  1346. title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst
  1347. format.btitle "title" output.check
  1348. format.edition output
  1349. crossref missing$
  1350. { format.bvolume output
  1351. new.block
  1352. format.number.series output
  1353. new.sentence
  1354. format.publisher.address output
  1355. }
  1356. {
  1357. new.block
  1358. format.book.crossref output.nonnull
  1359. }
  1360. if$
  1361. new.block
  1362. format.note output
  1363. fin.entry
  1364. }
  1365. FUNCTION {booklet}
  1366. { output.bibitem
  1367. format.authors output
  1368. author format.key output
  1369. format.date "year" output.check
  1370. date.block
  1371. title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst
  1372. format.title "title" output.check
  1373. new.block
  1374. howpublished "howpublished" bibinfo.check output
  1375. address "address" bibinfo.check output
  1376. new.block
  1377. format.note output
  1378. fin.entry
  1379. }
  1380. FUNCTION {inbook}
  1381. { output.bibitem
  1382. author empty$
  1383. { format.editors "author and editor" output.check
  1384. editor format.key output
  1385. }
  1386. { format.authors output.nonnull
  1387. crossref missing$
  1388. { "author and editor" editor either.or.check }
  1389. 'skip$
  1390. if$
  1391. }
  1392. if$
  1393. format.date "year" output.check
  1394. date.block
  1395. title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst
  1396. format.btitle "title" output.check
  1397. format.edition output
  1398. crossref missing$
  1399. {
  1400. format.bvolume output
  1401. format.number.series output
  1402. format.chapter "chapter" output.check
  1403. new.sentence
  1404. format.publisher.address output
  1405. new.block
  1406. }
  1407. {
  1408. format.chapter "chapter" output.check
  1409. new.block
  1410. format.book.crossref output.nonnull
  1411. }
  1412. if$
  1413. new.block
  1414. format.note output
  1415. fin.entry
  1416. }
  1417. FUNCTION {incollection}
  1418. { output.bibitem
  1419. format.authors "author" output.check
  1420. author format.key output
  1421. format.date "year" output.check
  1422. date.block
  1423. title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst
  1424. format.title "title" output.check
  1425. new.block
  1426. crossref missing$
  1427. { format.in.ed.booktitle "booktitle" output.check
  1428. format.edition output
  1429. format.bvolume output
  1430. format.number.series output
  1431. format.chapter.pages output
  1432. new.sentence
  1433. format.publisher.address output
  1434. }
  1435. { format.incoll.inproc.crossref output.nonnull
  1436. format.chapter.pages output
  1437. }
  1438. if$
  1439. new.block
  1440. format.note output
  1441. fin.entry
  1442. }
  1443. FUNCTION {inproceedings}
  1444. { output.bibitem
  1445. format.authors "author" output.check
  1446. author format.key output
  1447. format.date "year" output.check
  1448. date.block
  1449. title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst
  1450. format.title "title" output.check
  1451. new.block
  1452. crossref missing$
  1453. { format.in.booktitle "booktitle" output.check
  1454. format.bvolume output
  1455. format.number.series output
  1456. format.pages output
  1457. address "address" bibinfo.check output
  1458. new.sentence
  1459. organization "organization" bibinfo.check output
  1460. publisher "publisher" bibinfo.check output
  1461. }
  1462. { format.incoll.inproc.crossref output.nonnull
  1463. format.pages output
  1464. }
  1465. if$
  1466. new.block
  1467. format.note output
  1468. fin.entry
  1469. }
  1470. FUNCTION {conference} { inproceedings }
  1471. FUNCTION {manual}
  1472. { output.bibitem
  1473. format.authors output
  1474. author format.key output
  1475. format.date "year" output.check
  1476. date.block
  1477. title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst
  1478. format.btitle "title" output.check
  1479. format.edition output
  1480. organization address new.block.checkb
  1481. organization "organization" bibinfo.check output
  1482. address "address" bibinfo.check output
  1483. new.block
  1484. format.note output
  1485. fin.entry
  1486. }
  1487. FUNCTION {mastersthesis}
  1488. { output.bibitem
  1489. format.authors "author" output.check
  1490. author format.key output
  1491. format.date "year" output.check
  1492. date.block
  1493. title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst
  1494. format.title
  1495. "title" output.check
  1496. new.block
  1497. bbl.mthesis format.thesis.type output.nonnull
  1498. school "school" bibinfo.warn output
  1499. address "address" bibinfo.check output
  1500. month "month" bibinfo.check output
  1501. new.block
  1502. format.note output
  1503. fin.entry
  1504. }
  1505. FUNCTION {misc}
  1506. { output.bibitem
  1507. format.authors output
  1508. author format.key output
  1509. format.date "year" output.check
  1510. date.block
  1511. title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst
  1512. format.title output
  1513. new.block
  1514. howpublished "howpublished" bibinfo.check output
  1515. new.block
  1516. format.note output
  1517. fin.entry
  1518. }
  1519. FUNCTION {phdthesis}
  1520. { output.bibitem
  1521. format.authors "author" output.check
  1522. author format.key output
  1523. format.date "year" output.check
  1524. date.block
  1525. title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst
  1526. format.btitle
  1527. "title" output.check
  1528. new.block
  1529. bbl.phdthesis format.thesis.type output.nonnull
  1530. school "school" bibinfo.warn output
  1531. address "address" bibinfo.check output
  1532. new.block
  1533. format.note output
  1534. fin.entry
  1535. }
  1536. FUNCTION {proceedings}
  1537. { output.bibitem
  1538. format.editors output
  1539. editor format.key output
  1540. format.date "year" output.check
  1541. date.block
  1542. title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst
  1543. format.btitle "title" output.check
  1544. format.bvolume output
  1545. format.number.series output
  1546. new.sentence
  1547. publisher empty$
  1548. { format.organization.address output }
  1549. { organization "organization" bibinfo.check output
  1550. new.sentence
  1551. format.publisher.address output
  1552. }
  1553. if$
  1554. new.block
  1555. format.note output
  1556. fin.entry
  1557. }
  1558. FUNCTION {techreport}
  1559. { output.bibitem
  1560. format.authors "author" output.check
  1561. author format.key output
  1562. format.date "year" output.check
  1563. date.block
  1564. title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst
  1565. format.title
  1566. "title" output.check
  1567. new.block
  1568. format.tr.number output.nonnull
  1569. institution "institution" bibinfo.warn output
  1570. address "address" bibinfo.check output
  1571. new.block
  1572. format.note output
  1573. fin.entry
  1574. }
  1575. FUNCTION {unpublished}
  1576. { output.bibitem
  1577. format.authors "author" output.check
  1578. author format.key output
  1579. format.date "year" output.check
  1580. date.block
  1581. title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst
  1582. format.title "title" output.check
  1583. new.block
  1584. format.note "note" output.check
  1585. fin.entry
  1586. }
  1587. FUNCTION {default.type} { misc }
  1588. READ
  1589. FUNCTION {sortify}
  1590. { purify$
  1591. "l" change.case$
  1592. }
  1593. INTEGERS { len }
  1594. FUNCTION {chop.word}
  1595. { 's :=
  1596. 'len :=
  1597. s #1 len substring$ =
  1598. { s len #1 + global.max$ substring$ }
  1599. 's
  1600. if$
  1601. }
  1602. FUNCTION {format.lab.names}
  1603. { 's :=
  1604. "" 't :=
  1605. s #1 "{vv~}{ll}" format.name$
  1606. s num.names$ duplicate$
  1607. #2 >
  1608. { pop$
  1609. " " * bbl.etal *
  1610. }
  1611. { #2 <
  1612. 'skip$
  1613. { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
  1614. {
  1615. " " * bbl.etal *
  1616. }
  1617. { bbl.and space.word * s #2 "{vv~}{ll}" format.name$
  1618. * }
  1619. if$
  1620. }
  1621. if$
  1622. }
  1623. if$
  1624. }
  1625. FUNCTION {author.key.label}
  1626. { author empty$
  1627. { key empty$
  1628. { cite$ #1 #3 substring$ }
  1629. 'key
  1630. if$
  1631. }
  1632. { author format.lab.names }
  1633. if$
  1634. }
  1635. FUNCTION {author.editor.key.label}
  1636. { author empty$
  1637. { editor empty$
  1638. { key empty$
  1639. { cite$ #1 #3 substring$ }
  1640. 'key
  1641. if$
  1642. }
  1643. { editor format.lab.names }
  1644. if$
  1645. }
  1646. { author format.lab.names }
  1647. if$
  1648. }
  1649. FUNCTION {editor.key.label}
  1650. { editor empty$
  1651. { key empty$
  1652. { cite$ #1 #3 substring$ }
  1653. 'key
  1654. if$
  1655. }
  1656. { editor format.lab.names }
  1657. if$
  1658. }
  1659. FUNCTION {calc.short.authors}
  1660. { type$ "book" =
  1661. type$ "inbook" =
  1662. or
  1663. 'author.editor.key.label
  1664. { type$ "proceedings" =
  1665. 'editor.key.label
  1666. 'author.key.label
  1667. if$
  1668. }
  1669. if$
  1670. 'short.list :=
  1671. }
  1672. FUNCTION {calc.label}
  1673. { calc.short.authors
  1674. short.list
  1675. "("
  1676. *
  1677. year duplicate$ empty$
  1678. short.list key field.or.null = or
  1679. { pop$ "" }
  1680. 'skip$
  1681. if$
  1682. *
  1683. 'label :=
  1684. }
  1685. FUNCTION {sort.format.names}
  1686. { 's :=
  1687. #1 'nameptr :=
  1688. ""
  1689. s num.names$ 'numnames :=
  1690. numnames 'namesleft :=
  1691. { namesleft #0 > }
  1692. { s nameptr
  1693. "{ll{ }}{ ff{ }}{ jj{ }}"
  1694. format.name$ 't :=
  1695. nameptr #1 >
  1696. {
  1697. " " *
  1698. namesleft #1 = t "others" = and
  1699. { "zzzzz" * }
  1700. { t sortify * }
  1701. if$
  1702. }
  1703. { t sortify * }
  1704. if$
  1705. nameptr #1 + 'nameptr :=
  1706. namesleft #1 - 'namesleft :=
  1707. }
  1708. while$
  1709. }
  1710. FUNCTION {sort.format.title}
  1711. { 't :=
  1712. "A " #2
  1713. "An " #3
  1714. "The " #4 t chop.word
  1715. chop.word
  1716. chop.word
  1717. sortify
  1718. #1 global.max$ substring$
  1719. }
  1720. FUNCTION {author.sort}
  1721. { author empty$
  1722. { key empty$
  1723. { "to sort, need author or key in " cite$ * warning$
  1724. ""
  1725. }
  1726. { key sortify }
  1727. if$
  1728. }
  1729. { author sort.format.names }
  1730. if$
  1731. }
  1732. FUNCTION {author.editor.sort}
  1733. { author empty$
  1734. { editor empty$
  1735. { key empty$
  1736. { "to sort, need author, editor, or key in " cite$ * warning$
  1737. ""
  1738. }
  1739. { key sortify }
  1740. if$
  1741. }
  1742. { editor sort.format.names }
  1743. if$
  1744. }
  1745. { author sort.format.names }
  1746. if$
  1747. }
  1748. FUNCTION {editor.sort}
  1749. { editor empty$
  1750. { key empty$
  1751. { "to sort, need editor or key in " cite$ * warning$
  1752. ""
  1753. }
  1754. { key sortify }
  1755. if$
  1756. }
  1757. { editor sort.format.names }
  1758. if$
  1759. }
  1760. FUNCTION {presort}
  1761. { calc.label
  1762. label sortify
  1763. " "
  1764. *
  1765. type$ "book" =
  1766. type$ "inbook" =
  1767. or
  1768. 'author.editor.sort
  1769. { type$ "proceedings" =
  1770. 'editor.sort
  1771. 'author.sort
  1772. if$
  1773. }
  1774. if$
  1775. #1 entry.max$ substring$
  1776. 'sort.label :=
  1777. sort.label
  1778. *
  1779. " "
  1780. *
  1781. title field.or.null
  1782. sort.format.title
  1783. *
  1784. #1 entry.max$ substring$
  1785. 'sort.key$ :=
  1786. }
  1787. ITERATE {presort}
  1788. SORT
  1789. STRINGS { last.label next.extra }
  1790. INTEGERS { last.extra.num number.label }
  1791. FUNCTION {initialize.extra.label.stuff}
  1792. { #0 int.to.chr$ 'last.label :=
  1793. "" 'next.extra :=
  1794. #0 'last.extra.num :=
  1795. #0 'number.label :=
  1796. }
  1797. FUNCTION {forward.pass}
  1798. { last.label label =
  1799. { last.extra.num #1 + 'last.extra.num :=
  1800. last.extra.num int.to.chr$ 'extra.label :=
  1801. }
  1802. { "a" chr.to.int$ 'last.extra.num :=
  1803. "" 'extra.label :=
  1804. label 'last.label :=
  1805. }
  1806. if$
  1807. number.label #1 + 'number.label :=
  1808. }
  1809. FUNCTION {reverse.pass}
  1810. { next.extra "b" =
  1811. { "a" 'extra.label := }
  1812. 'skip$
  1813. if$
  1814. extra.label 'next.extra :=
  1815. extra.label
  1816. duplicate$ empty$
  1817. 'skip$
  1818. { year field.or.null #-1 #1 substring$ chr.to.int$ #65 <
  1819. { "{\natexlab{" swap$ * "}}" * }
  1820. { "{(\natexlab{" swap$ * "})}" * }
  1821. if$ }
  1822. if$
  1823. 'extra.label :=
  1824. label extra.label * 'label :=
  1825. }
  1826. EXECUTE {initialize.extra.label.stuff}
  1827. ITERATE {forward.pass}
  1828. REVERSE {reverse.pass}
  1829. FUNCTION {bib.sort.order}
  1830. { sort.label
  1831. " "
  1832. *
  1833. year field.or.null sortify
  1834. *
  1835. " "
  1836. *
  1837. title field.or.null
  1838. sort.format.title
  1839. *
  1840. #1 entry.max$ substring$
  1841. 'sort.key$ :=
  1842. }
  1843. ITERATE {bib.sort.order}
  1844. SORT
  1845. FUNCTION {begin.bib}
  1846. { preamble$ empty$
  1847. 'skip$
  1848. { preamble$ write$ newline$ }
  1849. if$
  1850. "\begin{thebibliography}{" number.label int.to.str$ * "}" *
  1851. write$ newline$
  1852. "\expandafter\ifx\csname natexlab\endcsname\relax\def\natexlab#1{#1}\fi"
  1853. write$ newline$
  1854. }
  1855. EXECUTE {begin.bib}
  1856. EXECUTE {init.urlbst.variables} % urlbst
  1857. EXECUTE {init.state.consts}
  1858. ITERATE {call.type$}
  1859. FUNCTION {end.bib}
  1860. { newline$
  1861. "\end{thebibliography}" write$ newline$
  1862. }
  1863. EXECUTE {end.bib}
  1864. %% End of customized bst file
  1865. %%
  1866. %% End of file `compling.bst'.