Advertisement
Guest User

test-companion.bst

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