Advertisement
TheDragonborn

mystyle.bst

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