Advertisement
Guest User

unsrt_abbrv_link_it.bst

a guest
Apr 9th, 2015
556
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
BibTeX 25.93 KB | None | 0 0
  1. %% File: `unsrtnat.bst'
  2. %% A modification of `unsrt.bst' for use with natbib package
  3. %%
  4. %% This file was further modified to set the doi/url link, if given, on the journal
  5. %% volume-number-page entry or ISBN instead of displaying the doi/url directly.
  6. %% See laclaro.wordpress.com for more information.
  7. %% Henning Hollermann
  8. %% E-Mail: laclaro@mail.com
  9. %%
  10. %% Copyright 1993-2007 Patrick W Daly
  11. %% Max-Planck-Institut f\"ur Sonnensystemforschung
  12. %% Max-Planck-Str. 2
  13. %% D-37191 Katlenburg-Lindau
  14. %% Germany
  15. %% E-mail: daly@mps.mpg.de
  16. %%
  17. %% This program can be redistributed and/or modified under the terms
  18. %% of the LaTeX Project Public License Distributed from CTAN
  19. %% archives in directory macros/latex/base/lppl.txt; either
  20. %% version 1 of the License, or any later version.
  21. %%
  22.  % Version and source file information:
  23.  % \ProvidesFile{natbst.mbs}[2007/11/26 1.93 (PWD)]
  24.  %
  25.  % BibTeX `plainnat' family
  26.  %   version 0.99b for BibTeX versions 0.99a or later,
  27.  %   for LaTeX versions 2.09 and 2e.
  28.  %
  29.  % For use with the `natbib.sty' package; emulates the corresponding
  30.  %   member of the `plain' family, but with author-year citations.
  31.  %
  32.  % With version 6.0 of `natbib.sty', it may also be used for numerical
  33.  %   citations, while retaining the commands \citeauthor, \citefullauthor,
  34.  %   and \citeyear to print the corresponding information.
  35.  %
  36.  % For version 7.0 of `natbib.sty', the KEY field replaces missing
  37.  %   authors/editors, and the date is left blank in \bibitem.
  38.  %
  39.  % Includes field EID for the sequence/citation number of electronic journals
  40.  %  which is used instead of page numbers.
  41.  %
  42.  % Includes fields ISBN and ISSN.
  43.  %
  44.  % Includes field URL for Internet addresses.
  45.  %
  46.  % Includes field DOI for Digital Object Idenfifiers.
  47.  %
  48.  % Works best with the url.sty package of Donald Arseneau.
  49.  %
  50.  % Works with identical authors and year are further sorted by
  51.  %    title text, as in the standard plain.bst etc.
  52.  %
  53. ENTRY
  54.   { address
  55.    author
  56.    booktitle
  57.    chapter
  58.    doi
  59.    eid
  60.    edition
  61.    editor
  62.    howpublished
  63.    institution
  64.    isbn
  65.    issn
  66.    journal
  67.    key
  68.    month
  69.    note
  70.    number
  71.    organization
  72.    pages
  73.    publisher
  74.    school
  75.    series
  76.    title
  77.    type
  78.    url
  79.    volume
  80.    year
  81.  }
  82.   {}
  83.   { label extra.label sort.label short.list }
  84.  
  85. INTEGERS { output.state before.all mid.sentence after.sentence after.block }
  86.  
  87. FUNCTION {init.state.consts}
  88. { #0 'before.all :=
  89.  #1 'mid.sentence :=
  90.  #2 'after.sentence :=
  91.  #3 'after.block :=
  92. }
  93.  
  94. STRINGS { s t }
  95.  
  96. FUNCTION {output.nonnull}
  97. { 's :=
  98.  output.state mid.sentence =
  99.    { ", " * write$ }
  100.    { output.state after.block =
  101.        { add.period$ write$
  102.          newline$
  103.          "\newblock " write$
  104.        }
  105.        { output.state before.all =
  106.            'write$
  107.            { add.period$ " " * write$ }
  108.          if$
  109.        }
  110.      if$
  111.      mid.sentence 'output.state :=
  112.    }
  113.  if$
  114.  s
  115. }
  116.  
  117. FUNCTION {output}
  118. { duplicate$ empty$
  119.    'pop$
  120.    'output.nonnull
  121.  if$
  122. }
  123.  
  124. FUNCTION {output.check}
  125. { 't :=
  126.  duplicate$ empty$
  127.    { pop$ "empty " t * " in " * cite$ * warning$ }
  128.    'output.nonnull
  129.  if$
  130. }
  131.  
  132. FUNCTION {fin.entry}
  133. { add.period$
  134.  write$
  135.  newline$
  136. }
  137.  
  138. FUNCTION {new.block}
  139. { output.state before.all =
  140.    'skip$
  141.    { after.block 'output.state := }
  142.  if$
  143. }
  144.  
  145. FUNCTION {new.sentence}
  146. { output.state after.block =
  147.    'skip$
  148.    { output.state before.all =
  149.        'skip$
  150.        { after.sentence 'output.state := }
  151.      if$
  152.    }
  153.  if$
  154. }
  155.  
  156. FUNCTION {not}
  157. {   { #0 }
  158.    { #1 }
  159.  if$
  160. }
  161.  
  162. FUNCTION {and}
  163. {   'skip$
  164.    { pop$ #0 }
  165.  if$
  166. }
  167.  
  168. FUNCTION {or}
  169. {   { pop$ #1 }
  170.    'skip$
  171.  if$
  172. }
  173.  
  174. FUNCTION {new.block.checka}
  175. { empty$
  176.    'skip$
  177.    'new.block
  178.  if$
  179. }
  180.  
  181. FUNCTION {new.block.checkb}
  182. { empty$
  183.  swap$ empty$
  184.  and
  185.    'skip$
  186.    'new.block
  187.  if$
  188. }
  189.  
  190. FUNCTION {new.sentence.checka}
  191. { empty$
  192.    'skip$
  193.    'new.sentence
  194.  if$
  195. }
  196.  
  197. FUNCTION {new.sentence.checkb}
  198. { empty$
  199.  swap$ empty$
  200.  and
  201.    'skip$
  202.    'new.sentence
  203.  if$
  204. }
  205.  
  206. FUNCTION {field.or.null}
  207. { duplicate$ empty$
  208.    { pop$ "" }
  209.    'skip$
  210.  if$
  211. }
  212.  
  213. FUNCTION {emphasize}
  214. { duplicate$ empty$
  215.    { pop$ "" }
  216.    { "\emph{" swap$ * "}" * }
  217.  if$
  218. }
  219.  
  220. INTEGERS { nameptr namesleft numnames }
  221.  
  222. FUNCTION {format.names}
  223. { 's :=
  224.  #1 'nameptr :=
  225.  s num.names$ 'numnames :=
  226.  numnames 'namesleft :=
  227.    { namesleft #0 > }
  228.    % via "{ff~}" and "{f.~}" you can toggle abbrv.
  229.    { s nameptr "{f.~}{vv~}{ll}{, jj}" format.name$ 't :=
  230.      nameptr #1 >
  231.        { namesleft #1 >
  232.            { ", " * t * }
  233.            { numnames #2 >
  234.                { "," * }
  235.                'skip$
  236.              if$
  237.              t "others" =
  238.                { " et~al." * }
  239.                { " and " * t * }
  240.              if$
  241.            }
  242.          if$
  243.        }
  244.        't
  245.      if$
  246.      nameptr #1 + 'nameptr :=
  247.      namesleft #1 - 'namesleft :=
  248.    }
  249.  while$
  250. }
  251.  
  252. FUNCTION {format.key}
  253. { empty$
  254.    { key field.or.null }
  255.    { "" }
  256.  if$
  257. }
  258.  
  259. FUNCTION {format.authors}
  260. { author empty$
  261.    { "" }
  262.    { author format.names }
  263.  if$
  264. }
  265.  
  266. FUNCTION {format.editors}
  267. { editor empty$
  268.    { "" }
  269.    { editor format.names
  270.      editor num.names$ #1 >
  271.        { ", Editoren" * }
  272.        { ", Editor" * }
  273.      if$
  274.    }
  275.  if$
  276. }
  277.  
  278. FUNCTION {format.isbn}
  279. { isbn empty$
  280.    { "" }
  281.    { new.block "ISBN " isbn * }
  282.  if$
  283. }
  284.  
  285. FUNCTION {format.issn}
  286. { issn empty$
  287.    { "" }
  288.    { new.block "ISSN " issn * }
  289.  if$
  290. }
  291.  
  292. FUNCTION {format.url}
  293. { url empty$
  294.    { "" }
  295.    { new.block "URL \url{" url * "}" * }
  296.  if$
  297. }
  298.  
  299. FUNCTION {format.doi}
  300. { doi empty$
  301.    { "" }
  302.    { new.block "\doi{" doi * "}" * }
  303.  if$
  304. }
  305.  
  306. FUNCTION {format.title}
  307. { title empty$
  308.    { "" }
  309.    { title "t" change.case$ }
  310.  if$
  311. }
  312.  
  313. FUNCTION {format.full.names}
  314. {'s :=
  315.  #1 'nameptr :=
  316.  s num.names$ 'numnames :=
  317.  numnames 'namesleft :=
  318.    { namesleft #0 > }
  319.    { s nameptr
  320.      "{vv~}{ll}" format.name$ 't :=
  321.      nameptr #1 >
  322.        {
  323.          namesleft #1 >
  324.            { ", " * t * }
  325.            {
  326.              numnames #2 >
  327.                { "," * }
  328.                'skip$
  329.              if$
  330.              t "others" =
  331.                { " et~al." * }
  332.                { " and " * t * }
  333.              if$
  334.            }
  335.          if$
  336.        }
  337.        't
  338.      if$
  339.      nameptr #1 + 'nameptr :=
  340.      namesleft #1 - 'namesleft :=
  341.    }
  342.  while$
  343. }
  344.  
  345. FUNCTION {author.editor.full}
  346. { author empty$
  347.    { editor empty$
  348.        { "" }
  349.        { editor format.full.names }
  350.      if$
  351.    }
  352.    { author format.full.names }
  353.  if$
  354. }
  355.  
  356. FUNCTION {author.full}
  357. { author empty$
  358.    { "" }
  359.    { author format.full.names }
  360.  if$
  361. }
  362.  
  363. FUNCTION {editor.full}
  364. { editor empty$
  365.    { "" }
  366.    { editor format.full.names }
  367.  if$
  368. }
  369.  
  370. FUNCTION {make.full.names}
  371. { type$ "book" =
  372.  type$ "inbook" =
  373.  or
  374.    'author.editor.full
  375.    { type$ "proceedings" =
  376.        'editor.full
  377.        'author.full
  378.      if$
  379.    }
  380.  if$
  381. }
  382.  
  383. FUNCTION {output.bibitem}
  384. { newline$
  385.  "\bibitem[" write$
  386.  label write$
  387.  ")" make.full.names duplicate$ short.list =
  388.     { pop$ }
  389.     { * }
  390.   if$
  391.  "]{" * write$
  392.  cite$ write$
  393.  "}" write$
  394.  newline$
  395.  ""
  396.  before.all 'output.state :=
  397. }
  398.  
  399. FUNCTION {n.dashify}
  400. { 't :=
  401.  ""
  402.    { t empty$ not }
  403.    { t #1 #1 substring$ "-" =
  404.        { t #1 #2 substring$ "--" = not
  405.            { "--" *
  406.              t #2 global.max$ substring$ 't :=
  407.            }
  408.            {   { t #1 #1 substring$ "-" = }
  409.                { "-" *
  410.                  t #2 global.max$ substring$ 't :=
  411.                }
  412.              while$
  413.            }
  414.          if$
  415.        }
  416.        { t #1 #1 substring$ *
  417.          t #2 global.max$ substring$ 't :=
  418.        }
  419.      if$
  420.    }
  421.  while$
  422. }
  423.  
  424. FUNCTION {format.date}
  425. { year duplicate$ empty$
  426.    { "empty year in " cite$ * warning$
  427.       pop$ "" }
  428.    'skip$
  429.  if$
  430.  month empty$
  431.    'skip$
  432.    { month
  433.      " " * swap$ *
  434.    }
  435.  if$
  436.  extra.label *
  437. }
  438.  
  439. FUNCTION {format.btitle}
  440. { title emphasize
  441. }
  442.  
  443. FUNCTION {tie.or.space.connect}
  444. { duplicate$ text.length$ #3 <
  445.    { "~" }
  446.    { " " }
  447.  if$
  448.  swap$ * *
  449. }
  450.  
  451. FUNCTION {either.or.check}
  452. { empty$
  453.    'pop$
  454.    { "can't use both " swap$ * " fields in " * cite$ * warning$ }
  455.  if$
  456. }
  457.  
  458. FUNCTION {format.bvolume}
  459. { volume empty$
  460.    { "" }
  461.    { "volume" volume tie.or.space.connect
  462.      series empty$
  463.        'skip$
  464.        { " of " * series emphasize * }
  465.      if$
  466.      "volume and number" number either.or.check
  467.    }
  468.  if$
  469. }
  470.  
  471. FUNCTION {format.number.series}
  472. { volume empty$
  473.    { number empty$
  474.        { series field.or.null }
  475.        { output.state mid.sentence =
  476.            { "number" }
  477.            { "Number" }
  478.          if$
  479.          number tie.or.space.connect
  480.          series empty$
  481.            { "there's a number but no series in " cite$ * warning$ }
  482.            { " in " * series * }
  483.          if$
  484.        }
  485.      if$
  486.    }
  487.    { "" }
  488.  if$
  489. }
  490.  
  491. FUNCTION {format.edition}
  492. { edition empty$
  493.    { "" }
  494.    { output.state mid.sentence =
  495.        { edition "l" change.case$ " edition" * }
  496.        { edition "t" change.case$ " edition" * }
  497.      if$
  498.    }
  499.  if$
  500. }
  501.  
  502. INTEGERS { multiresult }
  503.  
  504. FUNCTION {multi.page.check}
  505. { 't :=
  506.  #0 'multiresult :=
  507.    { multiresult not
  508.      t empty$ not
  509.      and
  510.    }
  511.    { t #1 #1 substring$
  512.      duplicate$ "-" =
  513.      swap$ duplicate$ "," =
  514.      swap$ "+" =
  515.      or or
  516.        { #1 'multiresult := }
  517.        { t #2 global.max$ substring$ 't := }
  518.      if$
  519.    }
  520.  while$
  521.  multiresult
  522. }
  523.  
  524. FUNCTION {format.pages}
  525. { pages empty$
  526.    { "" }
  527.    { pages multi.page.check
  528.        { "pages" pages n.dashify tie.or.space.connect }
  529.        { "page" pages tie.or.space.connect }
  530.      if$
  531.    }
  532.  if$
  533. }
  534.  
  535. FUNCTION {format.eid}
  536. { eid empty$
  537.    { "" }
  538.    { "art." eid tie.or.space.connect }
  539.  if$
  540. }
  541.  
  542. FUNCTION {format.vol.num.pages}
  543. { volume field.or.null
  544.  number empty$
  545.    'skip$
  546.    { "\penalty0 (" number * ")" * *
  547.      volume empty$
  548.        { "there's a number but no volume in " cite$ * warning$ }
  549.        'skip$
  550.      if$
  551.    }
  552.  if$
  553.  pages empty$
  554.    'skip$
  555.    { duplicate$ empty$
  556.        { pop$ format.pages }
  557.        { ":\penalty0 " * pages n.dashify * }
  558.      if$
  559.    }
  560.  if$
  561. }
  562.  
  563. FUNCTION {format.vol.num.eid}
  564. { volume field.or.null
  565.  number empty$
  566.    'skip$
  567.    { "\penalty0 (" number * ")" * *
  568.      volume empty$
  569.        { "there's a number but no volume in " cite$ * warning$ }
  570.        'skip$
  571.      if$
  572.    }
  573.  if$
  574.  eid empty$
  575.    'skip$
  576.    { duplicate$ empty$
  577.        { pop$ format.eid }
  578.        { ":\penalty0 " * eid * }
  579.      if$
  580.    }
  581.  if$
  582. }
  583.  
  584. FUNCTION {format.chapter.pages}
  585. { chapter empty$
  586.    'format.pages
  587.    { type empty$
  588.        { "chapter" }
  589.        { type "l" change.case$ }
  590.      if$
  591.      chapter tie.or.space.connect
  592.      pages empty$
  593.        'skip$
  594.        { ", " * format.pages * }
  595.      if$
  596.    }
  597.  if$
  598. }
  599.  
  600. FUNCTION {format.in.ed.booktitle}
  601. { booktitle empty$
  602.    { "" }
  603.    { editor empty$
  604.        { "In " booktitle emphasize * }
  605.        { "In " format.editors * ", " * booktitle emphasize * }
  606.      if$
  607.    }
  608.  if$
  609. }
  610.  
  611. FUNCTION {empty.misc.check}
  612. { author empty$ title empty$ howpublished empty$
  613.  month empty$ year empty$ note empty$
  614.  and and and and and
  615.  key empty$ not and
  616.    { "all relevant fields are empty in " cite$ * warning$ }
  617.    'skip$
  618.  if$
  619. }
  620.  
  621. FUNCTION {format.thesis.type}
  622. { type empty$
  623.    'skip$
  624.    { pop$
  625.      type "t" change.case$
  626.    }
  627.  if$
  628. }
  629.  
  630. FUNCTION {format.tr.number}
  631. { type empty$
  632.    { "Technical Report" }
  633.    'type
  634.  if$
  635.  number empty$
  636.    { "t" change.case$ }
  637.    { number tie.or.space.connect }
  638.  if$
  639. }
  640.  
  641. FUNCTION {format.article.crossref}
  642. { key empty$
  643.    { journal empty$
  644.        { "need key or journal for " cite$ * " to crossref " * crossref *
  645.          warning$
  646.          ""
  647.        }
  648.        { "In \emph{" journal * "}" * }
  649.      if$
  650.    }
  651.    { "In " }
  652.  if$
  653.  " \citet{" * crossref * "}" *
  654. }
  655.  
  656. FUNCTION {format.book.crossref}
  657. { volume empty$
  658.    { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
  659.      "In "
  660.    }
  661.    { "Volume" volume tie.or.space.connect
  662.      " of " *
  663.    }
  664.  if$
  665.  editor empty$
  666.  editor field.or.null author field.or.null =
  667.  or
  668.    { key empty$
  669.        { series empty$
  670.            { "need editor, key, or series for " cite$ * " to crossref " *
  671.              crossref * warning$
  672.              "" *
  673.            }
  674.            { "\emph{" * series * "}" * }
  675.          if$
  676.        }
  677.        'skip$
  678.      if$
  679.    }
  680.    'skip$
  681.  if$
  682.  " \citet{" * crossref * "}" *
  683. }
  684.  
  685. FUNCTION {format.incoll.inproc.crossref}
  686. { editor empty$
  687.  editor field.or.null author field.or.null =
  688.  or
  689.    { key empty$
  690.        { booktitle empty$
  691.            { "need editor, key, or booktitle for " cite$ * " to crossref " *
  692.              crossref * warning$
  693.              ""
  694.            }
  695.            { "In \emph{" booktitle * "}" * }
  696.          if$
  697.        }
  698.        { "In " }
  699.      if$
  700.    }
  701.    { "In " }
  702.  if$
  703.  " \citet{" * crossref * "}" *
  704. }
  705.  
  706. FUNCTION {link_it}
  707. { duplicate$ empty$
  708. { pop$ "" }
  709. { doi empty$
  710.    { url empty$
  711.        { skip$ }
  712.        { "\href{" url * "}{" * swap$ * "}" * }
  713.      if$
  714.    }
  715.    { "\href{http://dx.doi.org/" doi * "}{" * swap$ * "}" * }
  716.  if$
  717. }
  718. if$
  719. }
  720.  
  721. FUNCTION {article}
  722. { output.bibitem
  723.  format.authors "author" output.check
  724.  author format.key output
  725.  new.block
  726.  format.title "title" output.check
  727.  new.block
  728.  crossref missing$
  729.    { journal emphasize "journal" output.check
  730.      eid empty$
  731.        { format.vol.num.pages link_it output }
  732.        { format.vol.num.eid link_it output }
  733.      if$
  734.      format.date "year" output.check
  735.    }
  736.    { format.article.crossref output.nonnull
  737.      eid empty$
  738.        { format.pages link_it output }
  739.        { format.eid link_it output }
  740.      if$
  741.    }
  742.  if$
  743. %  format.issn output
  744. %  format.doi output
  745. %  format.url output
  746. %  new.block
  747. %  note output
  748.  fin.entry
  749. }
  750.  
  751. FUNCTION {book}
  752. { output.bibitem
  753.  author empty$
  754.    { format.editors "author and editor" output.check
  755.      editor format.key output
  756.    }
  757.    { format.authors output.nonnull
  758.      crossref missing$
  759.        { "author and editor" editor either.or.check }
  760.        'skip$
  761.      if$
  762.    }
  763.  if$
  764.  new.block
  765.  format.btitle "title" output.check
  766.  crossref missing$
  767.    { format.bvolume output
  768.      new.block
  769.      format.number.series output
  770.      new.sentence
  771.      publisher "publisher" output.check
  772.      address output
  773.    }
  774.    { new.block
  775.      format.book.crossref output.nonnull
  776.    }
  777.  if$
  778.  format.edition output
  779.  format.date "year" output.check
  780.  format.isbn link_it output
  781. %  format.doi output
  782. %  format.url output
  783.  new.block
  784.  note output
  785.  fin.entry
  786. }
  787.  
  788. FUNCTION {booklet}
  789. { output.bibitem
  790.  format.authors output
  791.  author format.key output
  792.  new.block
  793.  format.title "title" output.check
  794.  howpublished address new.block.checkb
  795.  howpublished output
  796.  address output
  797.  format.date output
  798.  format.isbn link_it output
  799. %  format.doi output
  800. %  format.url output
  801.  new.block
  802.  note output
  803.  fin.entry
  804. }
  805.  
  806. FUNCTION {inbook}
  807. { output.bibitem
  808.  author empty$
  809.    { format.editors "author and editor" output.check
  810.      editor format.key output
  811.    }
  812.    { format.authors output.nonnull
  813.      crossref missing$
  814.        { "author and editor" editor either.or.check }
  815.        'skip$
  816.      if$
  817.    }
  818.  if$
  819.  new.block
  820.  format.btitle "title" output.check
  821.  crossref missing$
  822.    { format.bvolume output
  823.      format.chapter.pages "chapter and pages" output.check
  824.      new.block
  825.      format.number.series output
  826.      new.sentence
  827.      publisher "publisher" output.check
  828.      address output
  829.    }
  830.    { format.chapter.pages "chapter and pages" output.check
  831.      new.block
  832.      format.book.crossref output.nonnull
  833.    }
  834.  if$
  835.  format.edition output
  836.  format.date "year" output.check
  837.  format.isbn link_it output
  838. %  format.doi output
  839. %  format.url output
  840.  new.block
  841.  note output
  842.  fin.entry
  843. }
  844.  
  845. FUNCTION {incollection}
  846. { output.bibitem
  847.  format.authors "author" output.check
  848.  author format.key output
  849.  new.block
  850.  format.title "title" output.check
  851.  new.block
  852.  crossref missing$
  853.    { format.in.ed.booktitle "booktitle" output.check
  854.      format.bvolume output
  855.      format.number.series output
  856.      format.chapter.pages output
  857.      new.sentence
  858.      publisher "publisher" output.check
  859.      address output
  860.      format.edition output
  861.      format.date "year" output.check
  862.    }
  863.    { format.incoll.inproc.crossref output.nonnull
  864.      format.chapter.pages output
  865.    }
  866.  if$
  867.  format.isbn link_it output
  868.  %format.doi output
  869.  %format.url output
  870.  new.block
  871.  note output
  872.  fin.entry
  873. }
  874.  
  875. FUNCTION {inproceedings}
  876. { output.bibitem
  877.  format.authors "author" output.check
  878.  author format.key output
  879.  new.block
  880.  format.title "title" output.check
  881.  new.block
  882.  crossref missing$
  883.    { format.in.ed.booktitle "booktitle" output.check
  884.      format.bvolume output
  885.      format.number.series output
  886.      format.pages output
  887.      address empty$
  888.        { organization publisher new.sentence.checkb
  889.          organization output
  890.          publisher output
  891.          format.date "year" output.check
  892.        }
  893.        { address output.nonnull
  894.          format.date "year" output.check
  895.          new.sentence
  896.          organization output
  897.          publisher output
  898.        }
  899.      if$
  900.    }
  901.    { format.incoll.inproc.crossref output.nonnull
  902.      format.pages output
  903.    }
  904.  if$
  905.  format.isbn link_it output
  906. %  format.doi output
  907. %  format.url output
  908.  new.block
  909.  note output
  910.  fin.entry
  911. }
  912.  
  913. FUNCTION {conference} { inproceedings }
  914.  
  915. FUNCTION {manual}
  916. { output.bibitem
  917.  format.authors output
  918.  author format.key output
  919.  new.block
  920.  format.btitle "title" output.check
  921.  organization address new.block.checkb
  922.  organization output
  923.  address output
  924.  format.edition output
  925.  format.date output
  926.  format.url output
  927.  new.block
  928.  note output
  929.  fin.entry
  930. }
  931.  
  932. FUNCTION {mastersthesis}
  933. { output.bibitem
  934.  format.authors "author" output.check
  935.  author format.key output
  936.  new.block
  937.  format.title "title" output.check
  938.  new.block
  939.  "Master's thesis" format.thesis.type output.nonnull
  940.  school "school" output.check
  941.  address output
  942.  format.date "year" output.check
  943.  format.url output
  944.  new.block
  945.  note output
  946.  fin.entry
  947. }
  948.  
  949. FUNCTION {misc}
  950. { output.bibitem
  951.  format.authors output
  952.  author format.key output
  953.  title howpublished new.block.checkb
  954.  format.title output
  955.  howpublished new.block.checka
  956.  howpublished output
  957.  format.date output
  958.  format.issn output
  959.  format.url link_it output
  960.  new.block
  961.  note output
  962.  fin.entry
  963.  empty.misc.check
  964. }
  965.  
  966. FUNCTION {phdthesis}
  967. { output.bibitem
  968.  format.authors "author" output.check
  969.  author format.key output
  970.  new.block
  971.  format.btitle "title" output.check
  972.  new.block
  973.  "PhD thesis" format.thesis.type output.nonnull
  974.  school "school" output.check
  975.  address output
  976.  format.date "year" output.check
  977.  format.url output
  978.  new.block
  979.  note output
  980.  fin.entry
  981. }
  982.  
  983. FUNCTION {proceedings}
  984. { output.bibitem
  985.  format.editors output
  986.  editor format.key output
  987.  new.block
  988.  format.btitle "title" output.check
  989.  format.bvolume output
  990.  format.number.series output
  991.  address output
  992.  format.date "year" output.check
  993.  new.sentence
  994.  organization output
  995.  publisher output
  996.  format.isbn output
  997.  format.doi output
  998.  format.url output
  999.  new.block
  1000.  note output
  1001.  fin.entry
  1002. }
  1003.  
  1004. FUNCTION {techreport}
  1005. { output.bibitem
  1006.  format.authors "author" output.check
  1007.  author format.key output
  1008.  new.block
  1009.  format.title "title" output.check
  1010.  new.block
  1011.  format.tr.number output.nonnull
  1012.  institution "institution" output.check
  1013.  address output
  1014.  format.date "year" output.check
  1015.  format.url output
  1016.  new.block
  1017.  note output
  1018.  fin.entry
  1019. }
  1020.  
  1021. FUNCTION {unpublished}
  1022. { output.bibitem
  1023.  format.authors "author" output.check
  1024.  author format.key output
  1025.  new.block
  1026.  format.title "title" output.check
  1027.  new.block
  1028.  note "note" output.check
  1029.  format.date output
  1030.  format.url output
  1031.  fin.entry
  1032. }
  1033.  
  1034. FUNCTION {default.type} { misc }
  1035.  
  1036.  
  1037. MACRO {jan} {"January"}
  1038.  
  1039. MACRO {feb} {"February"}
  1040.  
  1041. MACRO {mar} {"March"}
  1042.  
  1043. MACRO {apr} {"April"}
  1044.  
  1045. MACRO {may} {"May"}
  1046.  
  1047. MACRO {jun} {"June"}
  1048.  
  1049. MACRO {jul} {"July"}
  1050.  
  1051. MACRO {aug} {"August"}
  1052.  
  1053. MACRO {sep} {"September"}
  1054.  
  1055. MACRO {oct} {"October"}
  1056.  
  1057. MACRO {nov} {"November"}
  1058.  
  1059. MACRO {dec} {"December"}
  1060.  
  1061.  
  1062.  
  1063. MACRO {acmcs} {"ACM Computing Surveys"}
  1064.  
  1065. MACRO {acta} {"Acta Informatica"}
  1066.  
  1067. MACRO {cacm} {"Communications of the ACM"}
  1068.  
  1069. MACRO {ibmjrd} {"IBM Journal of Research and Development"}
  1070.  
  1071. MACRO {ibmsj} {"IBM Systems Journal"}
  1072.  
  1073. MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
  1074.  
  1075. MACRO {ieeetc} {"IEEE Transactions on Computers"}
  1076.  
  1077. MACRO {ieeetcad}
  1078.  {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
  1079.  
  1080. MACRO {ipl} {"Information Processing Letters"}
  1081.  
  1082. MACRO {jacm} {"Journal of the ACM"}
  1083.  
  1084. MACRO {jcss} {"Journal of Computer and System Sciences"}
  1085.  
  1086. MACRO {scp} {"Science of Computer Programming"}
  1087.  
  1088. MACRO {sicomp} {"SIAM Journal on Computing"}
  1089.  
  1090. MACRO {tocs} {"ACM Transactions on Computer Systems"}
  1091.  
  1092. MACRO {tods} {"ACM Transactions on Database Systems"}
  1093.  
  1094. MACRO {tog} {"ACM Transactions on Graphics"}
  1095.  
  1096. MACRO {toms} {"ACM Transactions on Mathematical Software"}
  1097.  
  1098. MACRO {toois} {"ACM Transactions on Office Information Systems"}
  1099.  
  1100. MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
  1101.  
  1102. MACRO {tcs} {"Theoretical Computer Science"}
  1103.  
  1104.  
  1105. READ
  1106.  
  1107. FUNCTION {sortify}
  1108. { purify$
  1109.  "l" change.case$
  1110. }
  1111.  
  1112. INTEGERS { len }
  1113.  
  1114. FUNCTION {chop.word}
  1115. { 's :=
  1116.  'len :=
  1117.  s #1 len substring$ =
  1118.    { s len #1 + global.max$ substring$ }
  1119.    's
  1120.  if$
  1121. }
  1122.  
  1123. FUNCTION {format.lab.names}
  1124. { 's :=
  1125.  s #1 "{vv~}{ll}" format.name$
  1126.  s num.names$ duplicate$
  1127.  #2 >
  1128.    { pop$ " et~al." * }
  1129.    { #2 <
  1130.        'skip$
  1131.        { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
  1132.            { " et~al." * }
  1133.            { " and " * s #2 "{vv~}{ll}" format.name$ * }
  1134.          if$
  1135.        }
  1136.      if$
  1137.    }
  1138.  if$
  1139. }
  1140.  
  1141. FUNCTION {author.key.label}
  1142. { author empty$
  1143.    { key empty$
  1144.        { cite$ #1 #3 substring$ }
  1145.        'key
  1146.      if$
  1147.    }
  1148.    { author format.lab.names }
  1149.  if$
  1150. }
  1151.  
  1152. FUNCTION {author.editor.key.label}
  1153. { author empty$
  1154.    { editor empty$
  1155.        { key empty$
  1156.            { cite$ #1 #3 substring$ }
  1157.            'key
  1158.          if$
  1159.        }
  1160.        { editor format.lab.names }
  1161.      if$
  1162.    }
  1163.    { author format.lab.names }
  1164.  if$
  1165. }
  1166.  
  1167. FUNCTION {author.key.organization.label}
  1168. { author empty$
  1169.    { key empty$
  1170.        { organization empty$
  1171.            { cite$ #1 #3 substring$ }
  1172.            { "The " #4 organization chop.word #3 text.prefix$ }
  1173.          if$
  1174.        }
  1175.        'key
  1176.      if$
  1177.    }
  1178.    { author format.lab.names }
  1179.  if$
  1180. }
  1181.  
  1182. FUNCTION {editor.key.organization.label}
  1183. { editor empty$
  1184.    { key empty$
  1185.        { organization empty$
  1186.            { cite$ #1 #3 substring$ }
  1187.            { "The " #4 organization chop.word #3 text.prefix$ }
  1188.          if$
  1189.        }
  1190.        'key
  1191.      if$
  1192.    }
  1193.    { editor format.lab.names }
  1194.  if$
  1195. }
  1196.  
  1197. FUNCTION {calc.short.authors}
  1198. { type$ "book" =
  1199.  type$ "inbook" =
  1200.  or
  1201.    'author.editor.key.label
  1202.    { type$ "proceedings" =
  1203.        'editor.key.organization.label
  1204.        { type$ "manual" =
  1205.            'author.key.organization.label
  1206.            'author.key.label
  1207.          if$
  1208.        }
  1209.      if$
  1210.    }
  1211.  if$
  1212.  'short.list :=
  1213. }
  1214.  
  1215. FUNCTION {calc.label}
  1216. { calc.short.authors
  1217.  short.list
  1218.  "("
  1219.  *
  1220.  year duplicate$ empty$
  1221.  short.list key field.or.null = or
  1222.     { pop$ "" }
  1223.     'skip$
  1224.  if$
  1225.  *
  1226.  'label :=
  1227. }
  1228.  
  1229. INTEGERS { seq.num }
  1230.  
  1231. FUNCTION {init.seq}
  1232. { #0 'seq.num :=}
  1233.  
  1234. EXECUTE {init.seq}
  1235.  
  1236. FUNCTION {int.to.fix}
  1237. { "000000000" swap$ int.to.str$ *
  1238.  #-1 #10 substring$
  1239. }
  1240.  
  1241.  
  1242. FUNCTION {presort}
  1243. { calc.label
  1244.  label sortify
  1245.  "    "
  1246.  *
  1247.  seq.num #1 + 'seq.num :=
  1248.  seq.num  int.to.fix
  1249.  'sort.label :=
  1250.  sort.label *
  1251.  #1 entry.max$ substring$
  1252.  'sort.key$ :=
  1253. }
  1254.  
  1255. ITERATE {presort}
  1256.  
  1257. SORT
  1258.  
  1259. STRINGS { longest.label last.label next.extra }
  1260.  
  1261. INTEGERS { longest.label.width last.extra.num number.label }
  1262.  
  1263. FUNCTION {initialize.longest.label}
  1264. { "" 'longest.label :=
  1265.  #0 int.to.chr$ 'last.label :=
  1266.  "" 'next.extra :=
  1267.  #0 'longest.label.width :=
  1268.  #0 'last.extra.num :=
  1269.  #0 'number.label :=
  1270. }
  1271.  
  1272. FUNCTION {forward.pass}
  1273. { last.label label =
  1274.    { last.extra.num #1 + 'last.extra.num :=
  1275.      last.extra.num int.to.chr$ 'extra.label :=
  1276.    }
  1277.    { "a" chr.to.int$ 'last.extra.num :=
  1278.      "" 'extra.label :=
  1279.      label 'last.label :=
  1280.    }
  1281.  if$
  1282.  number.label #1 + 'number.label :=
  1283. }
  1284.  
  1285. FUNCTION {reverse.pass}
  1286. { next.extra "b" =
  1287.    { "a" 'extra.label := }
  1288.    'skip$
  1289.  if$
  1290.  extra.label 'next.extra :=
  1291.  extra.label
  1292.  duplicate$ empty$
  1293.    'skip$
  1294.    { "{\natexlab{" swap$ * "}}" * }
  1295.  if$
  1296.  'extra.label :=
  1297.  label extra.label * 'label :=
  1298. }
  1299.  
  1300. EXECUTE {initialize.longest.label}
  1301.  
  1302. ITERATE {forward.pass}
  1303.  
  1304. REVERSE {reverse.pass}
  1305.  
  1306. FUNCTION {bib.sort.order}
  1307. { sort.label  'sort.key$ :=
  1308. }
  1309.  
  1310. ITERATE {bib.sort.order}
  1311.  
  1312. SORT
  1313.  
  1314. FUNCTION {begin.bib}
  1315. {   preamble$ empty$
  1316.    'skip$
  1317.    { preamble$ write$ newline$ }
  1318.  if$
  1319.  "\begin{thebibliography}{" number.label int.to.str$ * "}" *
  1320.  write$ newline$
  1321.  "\providecommand{\natexlab}[1]{#1}"
  1322.  write$ newline$
  1323.  "\providecommand{\url}[1]{\texttt{#1}}"
  1324.  write$ newline$
  1325.  "\expandafter\ifx\csname urlstyle\endcsname\relax"
  1326.  write$ newline$
  1327.  "  \providecommand{\doi}[1]{doi: #1}\else"
  1328.  write$ newline$
  1329.  "  \providecommand{\doi}{doi: \begingroup \urlstyle{rm}\Url}\fi"
  1330.  write$ newline$
  1331. }
  1332.  
  1333. EXECUTE {begin.bib}
  1334.  
  1335. EXECUTE {init.state.consts}
  1336.  
  1337. ITERATE {call.type$}
  1338.  
  1339. FUNCTION {end.bib}
  1340. { newline$
  1341.  "\end{thebibliography}" write$ newline$
  1342. }
  1343.  
  1344. EXECUTE {end.bib}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement