Advertisement
Guest User

ecta_url.bst

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