	% $Id: html-btxbst.doc,v 1.13 1998/04/24 22:13:17 hull Exp hull $
	% 
	% This file is either "html-btxbst.doc" or was derived from
	% "html-btxbst.doc" using cpp.  "html-btxbst.doc" itself was edited
	% from "btxbst.doc" and "named.bst".
	% The following copyright information is from btxbst.doc:
	% version 0.99b for BibTeX versions 0.99a or later, LaTeX version 2.09.
	% Copyright (C) 1985, all rights reserved.
	% Copying of this file is authorized only if either
	% (1) you make absolutely no changes to your copy, including name, or
	% (2) if you do make changes, you name it something other than
	% btxbst.doc, plain.bst, unsrt.bst, alpha.bst, and abbrv.bst.
	% This restriction helps ensure that all standard styles are identical.
	% The file btxbst.doc has the documentation for this style.
 % "named" style (sorted keys of the form [name, year])
 % Some code for this was taken from "named.bst".

ENTRY
  { address
    author
    booktitle
    chapter
    edition
    editor
    howpublished
    institution
    journal
    key
    month
    note
    number
    organization
    pages
	articleno
	numpages
    publisher
    school
    series
    title
    type
    volume
    year
    dvi
    html
    keywords
    pdf
    slides
    poster
    postscript
    doi
    oagold
    ccicon
    ccurl
    hal
    halnooa
    arxiv
	preprint
    acmauthorizer
    osf
    osf2
    osf3
	github
	github2
	github3
	gitlab
	gitlab2
	gitlab3
	replicability
    url
    url2
    video
    citeseer
    mailto
    pubimage
  }
  {}
  { label extra.label sort.label }

INTEGERS { output.state before.all mid.sentence after.sentence after.block }

FUNCTION {init.state.consts}
{ #0 'before.all :=
  #1 'mid.sentence :=
  #2 'after.sentence :=
  #3 'after.block :=
}

STRINGS { s t yearlabel }

FUNCTION {output.nonnull}
{ 's :=
  output.state mid.sentence =
    { ", " * write$ }
    { output.state after.block =
	{ add.period$ write$
	  newline$
	}
	{ output.state before.all =
	    'write$
	    { add.period$ " " * write$ }
	  if$
	}
      if$
      mid.sentence 'output.state :=
    }
  if$
  s
}

FUNCTION {output}
{ duplicate$ empty$
    'pop$
    'output.nonnull
  if$
}

FUNCTION {output.check}
{ 't :=
  duplicate$ empty$
    { pop$ "empty " t * " in " * cite$ * warning$ }
    'output.nonnull
  if$
}

FUNCTION {output.bibitem}
{ newline$
  author empty$
    { editor empty$
	{ organization empty$
	    'skip$
	    { "<!-- Authors: " organization purify$ * " -->" * write$ newline$ }
          if$
	} 
        { "<!-- Authors: " editor purify$ * " -->" * write$ newline$ }
      if$
    }
    { "<!-- Authors: " author purify$ * " -->" * write$ newline$ }
  if$
  keywords empty$
    'skip$
    { "<!-- Keywords: " keywords * " -->" * write$ newline$ }
  if$
  pubimage empty$
    { "<TR valign=top><TD><SPAN ID=" quote$ * cite$ * quote$ * "><IMG SRC=" * quote$ * "files/nopubimage.png" * quote$ * " WIDTH=" * quote$ * "200" * quote$ * " HEIGHT=" * quote$ * "150" * quote$ * " ALT=" * quote$ * label * quote$ * "></SPAN></TD><TD>" * write$ }
    { url empty$
        { pdf empty$
            { doi empty$
                { "<TR valign=top><TD><SPAN ID=" quote$ * cite$ * quote$ * "><IMG SRC=" * quote$ * pubimage * quote$ * " WIDTH=" * quote$ * "200" * quote$ * " HEIGHT=" * quote$ * "150" * quote$ * " ALT=" * quote$ * label * quote$ * "></SPAN></TD><TD>" * write$ }
                { "<TR valign=top><TD><SPAN ID=" quote$ * cite$ * quote$ * "><A HREF=" * quote$ * doi * quote$ * "><IMG SRC=" * quote$ * pubimage * quote$ * " WIDTH=" * quote$ * "200" * quote$ * " HEIGHT=" * quote$ * "150" * quote$ * " ALT=" * quote$ * label * quote$ * "></A></SPAN></TD><TD>" * write$ }
              if$ }
            { "<TR valign=top><TD><SPAN ID=" quote$ * cite$ * quote$ * "><A HREF=" * quote$ * pdf * quote$ * "><IMG SRC=" * quote$ * pubimage * quote$ * " WIDTH=" * quote$ * "200" * quote$ * " HEIGHT=" * quote$ * "150" * quote$ * " ALT=" * quote$ * label * quote$ * "></A></SPAN></TD><TD>" * write$ }
          if$ }
        { "<TR valign=top><TD><SPAN ID=" quote$ * cite$ * quote$ * "><A HREF=" * quote$ * url * quote$ * "><IMG SRC=" * quote$ * pubimage * quote$ * " WIDTH=" * quote$ * "200" * quote$ * " HEIGHT=" * quote$ * "150" * quote$ * " ALT=" * quote$ * label * quote$ * "></A></SPAN></TD><TD>" * write$ }
      if$
    }
  if$
  ""
  before.all 'output.state :=
}

FUNCTION {add.bibtex.front}
{
  %newline$ "(<a style=" quote$ * "color:#134A86; cursor: pointer;" * quote$ * " onclick='overlay(" * quote$ * cite$ * "-bibtex" * quote$ * ")'>BibTeX</a>)" * write$
  newline$ "<a style=" quote$ * "color:#134A86; cursor: pointer;" * quote$ * " onclick='overlay(" * quote$ * cite$ * "-bibtex" * quote$ * ")'><img src=" * quote$ * "/uploads/Publications/bibtex.png" * quote$ * " style=" * quote$ * "vertical-align: sub;" * quote$ * "></a>" * write$
  
  newline$ "<div class=" quote$ * "overlay" * quote$ * " id=" * quote$ * cite$ * "-bibtex" * quote$ * "><div>" * write$
  newline$ "<span class=" quote$ * "closebutton" * quote$ * " style=" * quote$ * "cursor: pointer;" * quote$ * " onclick='overlay(" * quote$ * cite$ * "-bibtex" * quote$ * ")'>&times;</span>" * write$
  newline$ "<p>BibTeX entry:</p>" write$
  newline$ "<pre style=" quote$ * "white-space: pre-wrap;" * quote$ * "><br>" * write$
}

FUNCTION {add.bibtex.author}
{
  author empty$
    {}
    { newline$ "  author      = {" author * "}," * write$ }
  if$
}

FUNCTION {add.bibtex.editor}
{
  editor empty$
    {}
    { 
      type$ "inproceedings" =
        { newline$ "  OPTeditor   = {" editor * "}," * write$ }
        { newline$ "  editor      = {" editor * "}," * write$ }
      if$
	}
  if$
}

FUNCTION {add.bibtex.title}
{
  %hack for logial and
  title #1 #1 substring$ "{" = 
  title #-1 #1 substring$ "}" =
  + #2 =
    {
      % explicitly without the curly brackets since all my entries are double-curly
      newline$ "  title       = " title * "," * write$
	}
	{
      newline$ "  title       = {" title * "}," * write$
	}
  if$
}

FUNCTION {add.bibtex.year}
{
  newline$ "  year        = {" year * "}," * write$
}

FUNCTION {add.bibtex.booktitle}
{
  booktitle empty$
    {}
    { newline$ "  booktitle   = {" booktitle * "}," * write$ }
  if$
}

FUNCTION {add.bibtex.series}
{
  series empty$
    {}
    { newline$ "  series      = {" series * "}," * write$ }
  if$
}

FUNCTION {add.bibtex.chapter}
{
  chapter empty$
    {}
    { newline$ "  chapter     = {" chapter * "}," * write$ }
  if$
}

FUNCTION {add.bibtex.edition}
{
  edition empty$
    {}
    { newline$ "  edition     = {" edition * "}," * write$ }
  if$
}

FUNCTION {add.bibtex.type}
{
  type empty$
    {}
    { newline$ "  type        = {" type * "}," * write$ }
  if$
}

FUNCTION {add.bibtex.journal}
{
  journal empty$
    {}
    { newline$ "  journal     = {" journal * "}," * write$ }
  if$
}

STRINGS { month.a month.b month.c raute.str }

INTEGERS { month.index month.length month.indexa month.indexb month.parity }

FUNCTION {add.bibtex.month}
{
  month empty$
    {}
    {
	  % we go through the month string, character by character
	  % we assume that there is only one segment with / or -- between two months
	  #0 'month.index :=
	  #0 'month.indexa :=
	  % we end when we have gone trough all characters
	  month text.length$ 'month.length :=
	  % we will check by parity
	  #0 'month.parity :=
	  % while loop test
	  { month.index month.length < }
	  {
	    % increment current index by one
		#1 month.index + 'month.index :=
		% test if we found a /  or a - (hack for the or)
		month month.index #1 substring$ "/" =
		month month.index #1 substring$ "-" =
		+ #0 >
		{
		  #0 month.parity =
		    { month.index 'month.indexa := }
		    {}
		  if$
		  #1 'month.parity :=
		}
		{
		  #1 month.parity =
		    { month.index 'month.indexb := }
		    {}
		  if$
		  #0 'month.parity :=
		}
		if$
	  }
	  while$
	  month.indexa #0 =
	    % this part uses a hack several times to use the change case function: it first adds "A " in front, then changes case, and then cuts from pos. 3 to pos. 5
	    { 
		  % this is for cases that the month field does not contain a real month (e.g., "Winter"), but it only works if a single entry is used; no concatenations with #
		  month "January" =
		  month "February" = +
		  month "March" = +
		  month "April" = +
		  month "May" = +
		  month "June" = +
		  month "July" = +
		  month "August" = +
		  month "September" = +
		  month "October" = +
		  month "November" = +
		  month "December" = +
		  #0 >
		  { newline$ "  month       = " "A " month * "t" change.case$ #3 #3 substring$ * "," * write$ }
		  { newline$ "  month       = {" month * "}," * write$ }
		  if$
		}
		{
		  newline$ "  month       = " "A " month #1 month.indexa substring$ * "t" change.case$ #3 #3 substring$ * write$
		  " #{" month month.indexa month.indexb month.indexa - substring$ * "}# " * write$
		  "A " month month.indexb month.index month.indexb - substring$ * "t" change.case$ #3 #3 substring$ write$
		  "," write$
		}
	  if$
	}
  if$
}

FUNCTION {add.bibtex.pages}
{
  pages empty$
    {
      articleno empty$
        {}
        {
          numpages empty$
            {}
            {
              newline$ "  articleno   = {" articleno * "}," * write$
              newline$ "  numpages    = {" numpages * "}," * write$
            }
          if$
        }
      if$
    }
    { 
      articleno empty$
        {
          newline$ "  pages       = {" pages * "}," * write$
        }
        {
          numpages empty$
            {
              newline$ "  pages       = {" pages * "}," * write$
            }
            {
              newline$ "  pages       = {" pages * "}," * write$
              newline$ "  articleno   = {" articleno * "}," * write$
              newline$ "  numpages    = {" numpages * "}," * write$
            }
          if$
        }
      if$
	}
  if$
}

FUNCTION {add.bibtex.howpublished}
{
  howpublished empty$
    {}
    { newline$ "  howpublished= {" howpublished * "}," * write$ }
  if$
}

FUNCTION {add.bibtex.volume-number}
{
  volume empty$
    {}
    { newline$ "  volume      = {" volume * "}," * write$ }
  if$
  number empty$
    {}
    { newline$ "  number      = {" number * "}," * write$ }
  if$
}

INTEGERS { doi.index nth.dash preprint.index}

STRINGS { doi.cut preprint.start }

FUNCTION {add.bibtex.links}
{
  doi empty$
    {}
    { 
	  doi #1 #4 substring$ "http" =
	    {
		  #0 'nth.dash :=
		  #1 'doi.index :=
		  { nth.dash #3 < }
		  {
		    doi doi.index #1 substring$ "/" =
			  { #1 nth.dash + 'nth.dash := }
			  {}
			if$
			#1 doi.index + 'doi.index :=
		  }
		  while$
		  doi doi.index doi text.length$ doi.index - #1 + substring$ 'doi.cut :=
		}
		{ doi 'doi.cut := }
	  if$
	  newline$ "  doi         = {" doi.cut * "}," * write$
	  newline$ "  doi_url     = {<a href=" quote$ * "https://doi.org/" * doi.cut * quote$ * ">https://doi.org/" * doi.cut * "</a>}," * write$
	}
  if$
  oagold empty$
    {}
    {
      newline$ "  oa_gold_url = {<a href=" quote$ * oagold * quote$ * ">" * oagold * "</a>}," * write$
    }
  if$
  hal empty$
    {}
    {
      newline$ "  oa_hal_url  = {<a href=" quote$ * "https://hal.science/" * hal * quote$ * ">https://hal.science/" * hal * "</a>}," * write$
    }
  if$
  preprint empty$
    {
      arxiv empty$
        {}
        {
          newline$ "  arxiv_url   = {<a href=" quote$ * "https://arxiv.org/abs/" * arxiv * quote$ * ">https://arxiv.org/abs/" * arxiv * "</a>}," * write$
        }
      if$
    }
    {
      newline$ "  preprint    = {<a href=" quote$ * preprint * quote$ * ">" * preprint * "</a>}," * write$
    }	
  if$
  osf empty$
    {}
    {
      newline$ "  osf_url     = {<a href=" quote$ * osf * quote$ * ">" * osf * "</a>}," * write$
    }
  if$
  osf2 empty$
    {}
    {
      newline$ "  osf_url2    = {<a href=" quote$ * osf2 * quote$ * ">" * osf2 * "</a>}," * write$
    }
  if$
  osf3 empty$
    {}
    {
      newline$ "  osf_url3    = {<a href=" quote$ * osf3 * quote$ * ">" * osf3 * "</a>}," * write$
    }
  if$
  url empty$
    {}
    {
	  url #1 #3 substring$ "../" =
	    { 
		  newline$ "  url         = {<a href=" quote$ * "https://tobias.isenberg.cc" * url #3 url text.length$ #2 - substring$ * quote$ * ">https://tobias.isenberg.cc" * url #3 url text.length$ #2 - substring$ * "</a>}," * write$
		}
		{ newline$ "  url         = {<a href=" quote$ * url * quote$ * ">" * url * "</a>}," * write$ }
	  if$
	}
  if$
  url2 empty$
    {}
    { newline$ "  url2        = {<a href=" quote$ * url2 * quote$ * ">" * url2 * "</a>}," * write$ }
  if$
  github empty$
    {}
    { newline$ "  github_url  = {<a href=" quote$ * github * quote$ * ">" * github * "</a>}," * write$ }
  if$
  github2 empty$
    {}
    { newline$ "  github_url2 = {<a href=" quote$ * github2 * quote$ * ">" * github2 * "</a>}," * write$ }
  if$
  github3 empty$
    {}
    { newline$ "  github_url3 = {<a href=" quote$ * github3 * quote$ * ">" * github3 * "</a>}," * write$ }
  if$
  gitlab empty$
    {}
    { newline$ "  gitlab_url  = {<a href=" quote$ * gitlab * quote$ * ">" * gitlab * "</a>}," * write$ }
  if$
  gitlab2 empty$
    {}
    { newline$ "  gitlab_url2 = {<a href=" quote$ * gitlab2 * quote$ * ">" * gitlab2 * "</a>}," * write$ }
  if$
  gitlab3 empty$
    {}
    { newline$ "  gitlab_url3 = {<a href=" quote$ * gitlab3 * quote$ * ">" * gitlab3 * "</a>}," * write$ }
  if$
  pdf empty$
    {}
    {
	  pdf #1 #7 substring$ "papers/" = 
	  pdf #1 #6 substring$ "files/" =
	  + #0 >
	    { 
		  newline$ "  pdf         = {<a href=" quote$ * "https://tobias.isenberg.cc/personal/" * pdf * quote$ * ">https://tobias.isenberg.cc/personal/" * pdf * "</a>}," * write$
		}
		{
		  pdf #1 #23 substring$ "../publications/papers/" =
		  { newline$ "  pdf         = {<a href=" quote$ * "https://tobias.isenberg.cc" * pdf #3 pdf text.length$ #2 - substring$ * quote$ * ">https://tobias.isenberg.cc" * pdf #3 pdf text.length$ #2 - substring$ * "</a>}," * write$ }
		  { newline$ "  pdf         = {<a href=" quote$ * pdf * quote$ * ">" * pdf * "</a>}," * write$ }
		  if$
		}
	  if$
	}
  if$
  video empty$
    {}
    {
	  video #1 #7 substring$ "videos/" =
	    { 
		  newline$ "  video       = {<a href=" quote$ * "https://tobias.isenberg.cc/personal/" * video * quote$ * ">https://tobias.isenberg.cc/personal/" * video * "</a>}," * write$
		}
		{ newline$ "  video       = {<a href=" quote$ * video * quote$ * ">" * video * "</a>}," * write$ }
	  if$
	}
  if$
}

FUNCTION {add.bibtex.publisher}
{
  publisher empty$
    {}
    { newline$ "  publisher   = {" publisher * "}," * write$ }
  if$
  address empty$
    {}
    { newline$ "  address     = {" address * "}," * write$ }
  if$
}

FUNCTION {add.bibtex.institution-school}
{
  institution empty$
    {}
    { newline$ "  institution = {" institution * "}," * write$ }
  if$
  school empty$
    {}
    { newline$ "  school      = {" school * "}," * write$ }
  if$
}

FUNCTION {add.bibtex.note}
{
  note empty$
    {}
    { newline$ "  note        = {" note * "}," * write$ }
  if$
}

FUNCTION {add.bibtex.back}
{
  newline$ "</pre>" write$
  newline$ "</div></div>" write$
}

FUNCTION {add.bibtex}
{
  add.bibtex.front
  
  newline$ "@" type$ * "{" * cite$ * "," * write$
  add.bibtex.author
  add.bibtex.title
  add.bibtex.howpublished
  add.bibtex.booktitle
  add.bibtex.series
  add.bibtex.type
  add.bibtex.journal
  add.bibtex.editor
  add.bibtex.year
  add.bibtex.chapter
  add.bibtex.edition
  add.bibtex.institution-school
  add.bibtex.volume-number
  add.bibtex.month
  add.bibtex.pages
  add.bibtex.publisher
  add.bibtex.links
  %add.bibtex.note
  newline$ "}" write$
  
  add.bibtex.back
}

FUNCTION {add.links.doi}
{
  doi empty$
    {}
    { 
	  doi #1 #4 substring$ "http" =
	    {
		  #0 'nth.dash :=
		  #1 'doi.index :=
		  { nth.dash #3 < }
		  {
		    doi doi.index #1 substring$ "/" =
			  { #1 nth.dash + 'nth.dash := }
			  {}
			if$
			#1 doi.index + 'doi.index :=
		  }
		  while$
		  doi doi.index doi text.length$ doi.index - #1 + substring$ 'doi.cut :=
		}
		{ doi 'doi.cut := }
	  if$
    newline$ "<div style=" quote$ * "height:3px;" * quote$ * "><br></div><nobr>" * "<a href=" * quote$ * doi * quote$ * "><img src=" * quote$ * "/uploads/Publications/doi.jpg" * quote$ * " alt=" * quote$ * "doi:" * quote$ * " width=" * quote$ * "15" * quote$ * " height=" * quote$ * "15" * quote$ * " style=" * quote$ * "vertical-align: sub;" * quote$ * "> " * doi.cut * "</a></nobr>" * write$
	}
  if$
}

FUNCTION {add.links.ccurl}
{
  ccurl empty$
    'skip$
    { 
      ccicon empty$
        'skip$
        { newline$ "<nobr><a href=" quote$ * ccurl * quote$ * "><img src=" * quote$ * "/uploads/Publications/" * ccicon * ".jpg" * quote$ * " alt=" * quote$ * "(" * ccicon * ")" * quote$ * " width=" * quote$ * "64" * quote$ * " height=" * quote$ * "12" * quote$ * "></a></nobr>" * write$ }
      if$
    }
  if$
}

FUNCTION {add.links.oagold}
{
  oagold empty$
    'skip$
    { newline$ "<nobr><a href=" quote$ * oagold * quote$ * "><img src=" * quote$ * "/uploads/Publications/oa.jpg" * quote$ * " alt=" * quote$ * "(Open Access" * quote$ * " width=" * quote$ * "8" * quote$ * " height=" * quote$ * "12" * quote$ * "> <img src=" * quote$ * "/uploads/Publications/oa-gold.jpg" * quote$ * " alt=" * quote$ * "GOLD)" * quote$ * " width=" * quote$ * "50" * quote$ * " height=" * quote$ * "12" * quote$ * "></a></nobr>" * write$ }
  if$
}

FUNCTION {add.links.hal}
{
  hal empty$
    'skip$
    { newline$ "<nobr><a href=" quote$ * "https://hal.science/" * hal * quote$ * "><img src=" * quote$ * "/uploads/Publications/oa.jpg" * quote$ * " alt=" * quote$ * "(Open Access" * quote$ * " width=" * quote$ * "8" * quote$ * " height=" * quote$ * "12" * quote$ * "> <img src=" * quote$ * "/uploads/Publications/hal.jpg" * quote$ * " alt=" * quote$ * "HAL)" * quote$ * " width=" * quote$ * "55" * quote$ * " height=" * quote$ * "15" * quote$ * " style=" * quote$ * "vertical-align: -0.15em;" * quote$ * "></a></nobr>" * write$ }
  if$
}

FUNCTION {add.links.halnooa}
{
  halnooa empty$
    'skip$
    { newline$ "<nobr><a href=" quote$ * "https://hal.science/" * halnooa * quote$ * "><img src=" * quote$ * "/uploads/Publications/hal.jpg" * quote$ * " alt=" * quote$ * "(HAL)" * quote$ * " width=" * quote$ * "55" * quote$ * " height=" * quote$ * "15" * quote$ * " style=" * quote$ * "vertical-align: -0.15em;" * quote$ * "></a></nobr>" * write$ }
  if$
}

FUNCTION {add.links.arxiv}
{
  preprint empty$
    {
      arxiv empty$
        'skip$
        { newline$ "<nobr><a href=" quote$ * "https://arxiv.org/abs/" * arxiv * quote$ * "><img src=" * quote$ * "/uploads/Publications/oa.jpg" * quote$ * " alt=" * quote$ * "(Open Access" * quote$ * " width=" * quote$ * "8" * quote$ * " height=" * quote$ * "12" * quote$ * "> <img src=" * quote$ * "/uploads/Publications/arxiv.jpg" * quote$ * " alt=" * quote$ * "arXiv)" * quote$ * " width=" * quote$ * "34" * quote$ * " height=" * quote$ * "12" * quote$ * "></a></nobr>" * write$ }
      if$
    }
    {
      #0 'nth.dash :=
      #1 'preprint.index :=
      { nth.dash #4 < }
      {
        preprint preprint.index #1 substring$ "/" =
          { #1 nth.dash + 'nth.dash := }
          {}
        if$
        #1 preprint.index + 'preprint.index :=
      }
      while$
      preprint #1 preprint.index #1 - substring$ 'preprint.start :=
      preprint.start "https://doi.org/10.48550/" =
        {
          %%% arXiv
          newline$ "<nobr><a href=" quote$ * preprint * quote$ * "><img src=" * quote$ * "/uploads/Publications/oa.jpg" * quote$ * " alt=" * quote$ * "(Open Access" * quote$ * " width=" * quote$ * "8" * quote$ * " height=" * quote$ * "12" * quote$ * "> <img src=" * quote$ * "/uploads/Publications/arxiv.jpg" * quote$ * " alt=" * quote$ * "arXiv)" * quote$ * " width=" * quote$ * "34" * quote$ * " height=" * quote$ * "12" * quote$ * "></a></nobr>" * write$
        }
        {
          preprint.start "https://doi.org/10.1101/" =
            {
              %%% bioRXiv
              newline$ "<nobr><a href=" quote$ * preprint * quote$ * "><img src=" * quote$ * "/uploads/Publications/oa.jpg" * quote$ * " alt=" * quote$ * "(Open Access" * quote$ * " width=" * quote$ * "8" * quote$ * " height=" * quote$ * "12" * quote$ * "> <img src=" * quote$ * "/uploads/Publications/biorxiv.jpg" * quote$ * " alt=" * quote$ * "bioRXiv)" * quote$ * " width=" * quote$ * "54" * quote$ * " height=" * quote$ * "14" * quote$ " style=" * quote$ * "vertical-align: -0.15em;" * quote$ * * "></a></nobr>" * write$
            }
            {
              %%% other preprint
              newline$ "<nobr><a href=" quote$ * preprint * quote$ * "><img src=" * quote$ * "/uploads/Publications/oa.jpg" * quote$ * " alt=" * quote$ * "(Open Access" * quote$ * " width=" * quote$ * "8" * quote$ * " height=" * quote$ * "12" * quote$ * "> <img src=" * quote$ * "/uploads/Publications/preprint.jpg" * quote$ * " alt=" * quote$ * "preprint)" * quote$ * " width=" * quote$ * "52" * quote$ * " height=" * quote$ * "12" * quote$ * "></a></nobr>" * write$
            }
          if$		
        }
      if$		
    }
  if$
}

FUNCTION {add.links.acmauthorizer}
{
  acmauthorizer empty$
    'skip$
    { newline$ "<nobr><a href=" quote$ * acmauthorizer * quote$ * "><img src=" * quote$ * "/uploads/Publications/acmauthorizer.jpg" * quote$ * " alt=" * quote$ * "(ACM Authorizer" * quote$ * " width=" * quote$ * "41" * quote$ * " height=" * quote$ * "12" * quote$ * "></a></nobr>" * write$ }
  if$
}

FUNCTION {add.links.replicability}
{
  replicability empty$
    'skip$
    { newline$ "<a href=" quote$ * replicability * quote$ * "><img src=" * quote$ * "/uploads/Publications/grs.png" * quote$ * " alt=" * quote$ * "(Replicability)" * quote$ * " width=" * quote$ * "18" * quote$ * " height=" * quote$ * "15" * quote$ * " style=" * quote$ * "vertical-align: -0.15em;" * quote$ * "></a>" * write$ }
  if$
}


FUNCTION {add.links.osf}
{
  osf empty$
    'skip$
    { newline$ "<a href=" quote$ * osf * quote$ * "><img src=" * quote$ * "/uploads/Publications/osf.jpg" * quote$ * " alt=" * quote$ * "(OSF)" * quote$ * " width=" * quote$ * "40" * quote$ * " height=" * quote$ * "12" * quote$ * "></a>" * write$ }
  if$
}

FUNCTION {add.links.osf2}
{
  osf2 empty$
    'skip$
    { newline$ "<a href=" quote$ * osf2 * quote$ * "><img src=" * quote$ * "/uploads/Publications/osf.jpg" * quote$ * " alt=" * quote$ * "(OSF)" * quote$ * " width=" * quote$ * "40" * quote$ * " height=" * quote$ * "12" * quote$ * "></a>" * write$ }
  if$
}

FUNCTION {add.links.osf3}
{
  osf3 empty$
    'skip$
    { newline$ "<a href=" quote$ * osf3 * quote$ * "><img src=" * quote$ * "/uploads/Publications/osf.jpg" * quote$ * " alt=" * quote$ * "(OSF)" * quote$ * " width=" * quote$ * "40" * quote$ * " height=" * quote$ * "12" * quote$ * "></a>" * write$ }
  if$
}

FUNCTION {add.links.url}
{
  url empty$
    'skip$
    { newline$ "<a href=" quote$ * url * quote$ * "><img src=" * quote$ * "/uploads/Publications/url.jpg" * quote$ * " alt=" * quote$ * "(URL)" * quote$ * " width=" * quote$ * "33" * quote$ * " height=" * quote$ * "12" * quote$ * "></a>" * write$ }
  if$
}

FUNCTION {add.links.url2}
{
  url2 empty$
    'skip$
    { newline$ "<a href=" quote$ * url2 * quote$ * "><img src=" * quote$ * "/uploads/Publications/url.jpg" * quote$ * " alt=" * quote$ * "(URL)" * quote$ * " width=" * quote$ * "33" * quote$ * " height=" * quote$ * "12" * quote$ * "></a>" * write$ }
  if$
}

FUNCTION {add.links.pdf}
{
  pdf empty$
    'skip$
    { newline$ "<!-- PDF: " pdf * " -->" * write$ }
  if$
}

FUNCTION {add.links.slides}
{
  slides empty$
    'skip$
    { newline$ "<!-- Slides: " slides * " -->" * write$ }
  if$
}

FUNCTION {add.links.poster}
{
  poster empty$
    'skip$
    { newline$ "<!-- Poster: " poster * " -->" * write$ }
  if$
}

FUNCTION {add.links.video}
{
  video empty$
    'skip$
    { newline$ "<a href=" quote$ * video * quote$ * "><img src=" * quote$ * "/uploads/Publications/video.png" * quote$ * " alt=" * quote$ * "(Video)" * quote$ * " width=" * quote$ * "15" * quote$ * " height=" * quote$ * "15" * quote$ * " style=" * quote$ * "vertical-align: -0.15em;" * quote$ * "></a>" * write$ }
  if$
}

FUNCTION {add.links.github}
{
  github empty$
    'skip$
    { newline$ "<a href=" quote$ * github * quote$ * "><img src=" * quote$ * "/uploads/Publications/github.png" * quote$ * " alt=" * quote$ * "(GitHub)" * quote$ * " width=" * quote$ * "63" * quote$ * " height=" * quote$ * "15" * quote$ * " style=" * quote$ * "vertical-align: -0.07em;" * quote$ * "></a>" * write$ }
  if$
  github2 empty$
    'skip$
    { newline$ "<a href=" quote$ * github2 * quote$ * "><img src=" * quote$ * "/uploads/Publications/github.png" * quote$ * " alt=" * quote$ * "(GitHub)" * quote$ * " width=" * quote$ * "63" * quote$ * " height=" * quote$ * "15" * quote$ * " style=" * quote$ * "vertical-align: -0.07em;" * quote$ * "></a>" * write$ }
  if$
  github3 empty$
    'skip$
    { newline$ "<a href=" quote$ * github3 * quote$ * "><img src=" * quote$ * "/uploads/Publications/github.png" * quote$ * " alt=" * quote$ * "(GitHub)" * quote$ * " width=" * quote$ * "63" * quote$ * " height=" * quote$ * "15" * quote$ * " style=" * quote$ * "vertical-align: -0.07em;" * quote$ * "></a>" * write$ }
  if$
}

FUNCTION {add.links.gitlab}
{
  gitlab empty$
    'skip$
    { newline$ "<a href=" quote$ * gitlab * quote$ * "><img src=" * quote$ * "/uploads/Publications/gitlab.png" * quote$ * " alt=" * quote$ * "(GitLab)" * quote$ * " width=" * quote$ * "69" * quote$ * " height=" * quote$ * "15" * quote$ * " style=" * quote$ * "vertical-align: -0.07em;" * quote$ * "></a>" * write$ }
  if$
  gitlab2 empty$
    'skip$
    { newline$ "<a href=" quote$ * gitlab2 * quote$ * "><img src=" * quote$ * "/uploads/Publications/github.png" * quote$ * " alt=" * quote$ * "(GitLab)" * quote$ * " width=" * quote$ * "69" * quote$ * " height=" * quote$ * "15" * quote$ * " style=" * quote$ * "vertical-align: -0.07em;" * quote$ * "></a>" * write$ }
  if$
  gitlab3 empty$
    'skip$
    { newline$ "<a href=" quote$ * gitlab3 * quote$ * "><img src=" * quote$ * "/uploads/Publications/github.png" * quote$ * " alt=" * quote$ * "(GitLab)" * quote$ * " width=" * quote$ * "69" * quote$ * " height=" * quote$ * "15" * quote$ * " style=" * quote$ * "vertical-align: -0.07em;" * quote$ * "></a>" * write$ }
  if$
}

FUNCTION {fin.entry}
{ add.period$
  write$

  add.links.doi
  
  % add another newline, needed regardless if doi was empty or not because the doi is on a separate line
  newline$ "<div style=" quote$ * "height:3px;" * quote$ * "><br></div>" * write$

  add.links.url
  add.links.url2
  add.links.oagold
  add.links.hal
  add.links.halnooa
  add.links.arxiv
  add.links.acmauthorizer
  add.links.osf
  add.links.osf2
  add.links.osf3
  add.links.github
  add.links.gitlab
  add.links.replicability
  add.links.video

  % only add another newline if all of the block above was empty
  % hack for logical and by means of addition and comparing to the sum of all conditions being true (each == 1)
  url empty$
  url2 empty$ +
  ccurl empty$ +
  oagold empty$ +
  hal empty$ +
  halnooa empty$ +
  arxiv empty$ +
  acmauthorizer empty$ +
  osf empty$ +
  osf2 empty$ +
  video empty$ +
  #11 =
    'skip$
    { newline$ "<div style=" quote$ * "height:3px;" * quote$ * "><br></div>" * write$ }
  if$

  % PDF, slides, and poster link as well as BibTeX will be again on a separate line, at least BibTeX will be populated
  add.links.ccurl
  add.links.pdf
  add.links.slides
  add.links.poster

  add.bibtex
  newline$ "</TD></TR>" write$
  newline$
  newline$
}

FUNCTION {new.block}
{ output.state before.all =
    'skip$
    { after.block 'output.state := }
  if$
}

FUNCTION {new.sentence}
{ output.state after.block =
    'skip$
    { output.state before.all =
	'skip$
	{ after.sentence 'output.state := }
      if$
    }
  if$
}

FUNCTION {not}
{   { #0 }
    { #1 }
  if$
}

FUNCTION {and}
{   'skip$
    { pop$ #0 }
  if$
}

FUNCTION {or}
{   { pop$ #1 }
    'skip$
  if$
}

FUNCTION {str.to.int}
{
  's :=
  #0
    { s empty$ not }
    { % Multiply the number on the top of the stack by 10 = 1010 binary
      duplicate$ +			% x2
      duplicate$			% x2 x2
      duplicate$ + duplicate$ +		% x2 x8
      +
      s #1 #1 substring$ chr.to.int$ #48 - + % #48 is ascii for '0'
      s #2 global.max$ substring$ 's :=
    }
  while$
}

FUNCTION {new.block.checka}
{ empty$
    'skip$
    'new.block
  if$
}

FUNCTION {new.block.checkb}
{ empty$
  swap$ empty$
  and
    'skip$
    'new.block
  if$
}

FUNCTION {new.sentence.checka}
{ empty$
    'skip$
    'new.sentence
  if$
}

FUNCTION {new.sentence.checkb}
{ empty$
  swap$ empty$
  and
    'skip$
    'new.sentence
  if$
}

FUNCTION {field.or.null}
{ duplicate$ empty$
    { pop$ "" }
    'skip$
  if$
}

FUNCTION {emphasize}
{ duplicate$ empty$
    { pop$ "" }
    { "<CITE>" swap$ * "</CITE>" * }
  if$
}

FUNCTION {add.link} % title
{
  't :=
  t empty$
    { "" }
    { url empty$
	{ doi empty$
	    { t }
	    { "<A HREF=" quote$ * doi * quote$ * ">" * t * "</A>" * }
	  if$ }
	{ "<A HREF=" quote$ * url * quote$ * ">" * t * "</A>" * }
      if$
    }
  if$
}

FUNCTION {add.mailto} % authors
{
  't :=
  t empty$
    { "" }
    { mailto empty$
        { t }
        { "<A HREF=" quote$ * "mailto:" * mailto * quote$ * ">" * t * "</A>" * }
      if$
    }
  if$
}

INTEGERS { nameptr namesleft numnames }

FUNCTION {format.names}
{ 's :=
  #1 'nameptr :=
  s num.names$ 'numnames :=
  numnames 'namesleft :=
    { namesleft #0 > }
    { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
      nameptr #1 >
	{ namesleft #1 >
	    { ", " * t * }
	    { numnames #2 >
		{ "," * }
		'skip$
	      if$
	      t "others" =
		{ " et~al." * }
		{ " and " * t * }
	      if$
	    }
	  if$
	}
	't
      if$
      nameptr #1 + 'nameptr :=
      namesleft #1 - 'namesleft :=
    }
  while$
}

FUNCTION {format.authors}
{ ""
  author empty$
    { "" * }
    { author format.names * }
  if$
  add.mailto
  "" *
}

FUNCTION {format.editors}
{ editor empty$
    { "" }
    { editor format.names
      editor num.names$ #1 >
	{ ", editors" * }
	{ ", editor" * }
      if$
    }
  if$
}

FUNCTION {format.editors.bold}
{ ""
  editor empty$
    { "" * }
    { editor format.names *
      editor num.names$ #1 >
	{ ", editors" * }
	{ ", editor" * }
      if$
    }
  if$
  "" *
}

FUNCTION {format.title}
{ "<strong>"
  title empty$
    { "" * }
    { title "t" change.case$ * }
  if$
  "</strong>" *
  add.link
}

FUNCTION {n.dashify}
{ 't :=
  ""
    { t empty$ not }
    { t #1 #1 substring$ "-" =
	{ t #1 #2 substring$ "--" = not
	    { "--" *
	      t #2 global.max$ substring$ 't :=
	    }
	    {   { t #1 #1 substring$ "-" = }
		{ "-" *
		  t #2 global.max$ substring$ 't :=
		}
	      while$
	    }
	  if$
	}
	{ t #1 #1 substring$ *
	  t #2 global.max$ substring$ 't :=
	}
      if$
    }
  while$
}

FUNCTION {format.date}
{ year empty$
    { month empty$
	{ "" }
	{ "there's a month but no year in " cite$ * warning$
	  month
	}
      if$
    }
    { month empty$
	'year
	{ month " " * year * }
      if$
    }
  if$
}

FUNCTION {format.btitle}
{ "<strong>"
  title emphasize *
  "</strong>" *
  add.link
}

FUNCTION {tie.or.space.connect}
{ duplicate$ text.length$ #3 <
    { "~" }
    { " " }
  if$
  swap$ * *
}

FUNCTION {either.or.check}
{ empty$
    'pop$
    { "can't use both " swap$ * " fields in " * cite$ * warning$ }
  if$
}

FUNCTION {format.bvolume}
{ volume empty$
    { "" }
    { "volume" volume tie.or.space.connect
      series empty$
	'skip$
	{ " of " * series emphasize * }
      if$
      "volume and number" number either.or.check
    }
  if$
}

FUNCTION {format.number.series}
{ volume empty$
    { number empty$
	{ series field.or.null }
	{ output.state mid.sentence =
	    { "number" }
	    { "Number" }
	  if$
	  number tie.or.space.connect
	  series empty$
	    { "there's a number but no series in " cite$ * warning$ }
	    { " in " * series * }
	  if$
	}
      if$
    }
    { "" }
  if$
}

FUNCTION {format.edition}
{ edition empty$
    { "" }
    { output.state mid.sentence =
	{ edition "l" change.case$ " edition" * }
	{ edition "t" change.case$ " edition" * }
      if$
    }
  if$
}

INTEGERS { multiresult }

FUNCTION {multi.page.check}
{ 't :=
  #0 'multiresult :=
    { multiresult not
      t empty$ not
      and
    }
    { t #1 #1 substring$
      duplicate$ "-" =
      swap$ duplicate$ "," =
      swap$ "+" =
      or or
	{ #1 'multiresult := }
	{ t #2 global.max$ substring$ 't := }
      if$
    }
  while$
  multiresult
}

FUNCTION {format.pages}
{
  articleno empty$
    {
      pages empty$
        { "" }
		{
          pages multi.page.check
            { "pages" pages n.dashify tie.or.space.connect }
            { "page" pages tie.or.space.connect }
          if$
		}
      if$
    }
    {
      numpages empty$
        {
          pages empty$
            { "" }
		    {
              pages multi.page.check
                { "pages" pages n.dashify tie.or.space.connect }
                { "page" pages tie.or.space.connect }
              if$
            }
          if$
		}
        {
          numpages "1" =
            { "article no. " articleno * ", " * numpages * " page" * }
            { "article no. " articleno * ", " * numpages * " pages" * }
          if$
        }
      if$
    }
  if$
}

FUNCTION {format.vol.num.pages}
{
  volume field.or.null
  number empty$
    'skip$
    { 
      "(" number * ")" * *
      volume empty$
        { "there's a number but no volume in " cite$ * warning$ }
        'skip$
      if$
    }
  if$
  pages empty$
    'skip$
    {
      duplicate$ empty$
        { pop$ format.pages }
        {
          articleno empty$
            { ":" * pages n.dashify * }
            {
              numpages empty$
                { ":" * pages n.dashify * }
                {
                  numpages "1" =
                    { ", article no. " * articleno * ", " * numpages * " page" * }
                    { ", article no. " * articleno * ", " * numpages * " pages" * }
                  if$
                }
              if$
            }
          if$
		}
      if$
    }
  if$
}

FUNCTION {format.chapter.pages}
{ chapter empty$
    'format.pages
    { type empty$
	{ "chapter" }
	{ type "l" change.case$ }
      if$
      chapter tie.or.space.connect
      pages empty$
	'skip$
	{ ", " * format.pages * }
      if$
    }
  if$
}

FUNCTION {format.in.ed.booktitle}
{ booktitle empty$
    { "" }
    { editor empty$
	{ "In " booktitle emphasize * }
	{ "In " format.editors * ", " * booktitle emphasize * }
      if$
    }
  if$
}

FUNCTION {empty.misc.check}
{ author empty$ title empty$ howpublished empty$
  month empty$ year empty$ note empty$
  and and and and and
  key empty$ not and
    { "all relevant fields are empty in " cite$ * warning$ }
    'skip$
  if$
}

FUNCTION {format.thesis.type}
{ type empty$
    'skip$
    { pop$
      type "t" change.case$
    }
  if$
}

FUNCTION {format.tr.number}
{ type empty$
    { "Technical Report" }
    'type
  if$
  number empty$
    { "t" change.case$ }
    { number tie.or.space.connect }
  if$
}

FUNCTION {format.article.crossref}
{
  "In <A HREF=" quote$ * "#" * crossref * quote$ * ">" *
  key empty$
    { journal empty$
	{ "need key or journal for " cite$ * " to crossref " * crossref *
	  warning$
	  ""
	}
        { "<CITE>" * journal * "</CITE>" * }
      if$
    }
    { key * }
  if$
  " \citelabel{" * crossref * "}</A>" *
}

FUNCTION {format.crossref.editor}
{ editor #1 "{vv~}{ll}" format.name$
  editor num.names$ duplicate$
  #2 >
    { pop$ " et~al." * }
    { #2 <
	'skip$
	{ editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
	    { " et~al." * }
	    { " and " * editor #2 "{vv~}{ll}" format.name$ * }
	  if$
	}
      if$
    }
  if$
}

FUNCTION {format.book.crossref}
{ volume empty$
    { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
      "In "
    }
    { "Volume" volume tie.or.space.connect
      " of " *
    }
  if$
  "<A HREF=" * quote$ * "#" * crossref * quote$ * ">" *
  editor empty$
  editor field.or.null author field.or.null =
  or
    { key empty$
	{ series empty$
	    { "need editor, key, or series for " cite$ * " to crossref " *
	      crossref * warning$
	      "" *
	    }
            { "<CITE>" * series * "</CITE>" * }
	  if$
	}
	{ key * }
      if$
    }
    { format.crossref.editor * }
  if$
  " \citelabel{" * crossref * "}</A>" *
}

FUNCTION {format.incoll.inproc.crossref}
{
  "In <A HREF=" quote$ * "#" * crossref * quote$ * ">" *
  editor empty$
  editor field.or.null author field.or.null =
  or
    { key empty$
	{ booktitle empty$
	    { "need editor, key, or booktitle for " cite$ * " to crossref " *
	      crossref * warning$
	      ""
	    }
            { "<CITE>" * booktitle * "</CITE>" * }
	  if$
	}
        { key * }
      if$
    }
    { format.crossref.editor * }
  if$
  " \citelabel{" * crossref * "}</A>" *
}

FUNCTION {label.year}
{ year yearlabel =
    {}
    {
      year 'yearlabel :=
%      "<tr><td colspan=" quote$ * "2" * quote$ * "><h3>" * yearlabel * "</h3></td></tr>" * write$
      "<tr><td colspan=" quote$ * "2" * quote$ * "><div class=" * quote$ * "yearheaderstart" * quote$ * "></div><p class=" * quote$ * "yearheader" * quote$ * "><h3 class=" * quote$ * "yearheader" * quote$ * ">" * "<span id=" * quote$ * "yearlabel" * yearlabel * quote$ * ">" * yearlabel * "</h3><div class=" * quote$ * "yearheaderend" * quote$ * "></div><p class=" * quote$ * "yearheader" * quote$ * "></span></td></tr>" * write$
    }
  if$
}

FUNCTION {article}
{ label.year
  output.bibitem
  format.authors "author" output.check
  new.block
  format.title "title" output.check
  new.block
  crossref missing$
    { journal emphasize "journal" output.check
      format.vol.num.pages output
      format.date "year" output.check
    }
    { format.article.crossref output.nonnull
      format.pages output
    }
  if$
  new.block
  note output
  fin.entry
}

FUNCTION {book}
{ label.year
  output.bibitem
  author empty$
    { format.editors.bold "author and editor" output.check }
    { format.authors output.nonnull
      crossref missing$
	{ "author and editor" editor either.or.check }
	'skip$
      if$
    }
  if$
  new.block
  format.btitle "title" output.check
  crossref missing$
    { format.bvolume output
      new.block
      format.number.series output
      new.sentence
      publisher "publisher" output.check
      address output
    }
    { new.block
      format.book.crossref output.nonnull
    }
  if$
  format.edition output
  format.date "year" output.check
  new.block
  note output
  fin.entry
}

FUNCTION {booklet}
{ label.year
  output.bibitem
  format.authors output
  new.block
  format.title "title" output.check
  howpublished address new.block.checkb
  howpublished output
  address output
  format.date output
  new.block
  note output
  fin.entry
}

FUNCTION {inbook}
{ label.year
  output.bibitem
  author empty$
    { format.editors.bold "author and editor" output.check }
    { format.authors output.nonnull
      crossref missing$
	{ "author and editor" editor either.or.check }
	'skip$
      if$
    }
  if$
  new.block
  format.btitle "title" output.check
  crossref missing$
    { format.bvolume output
      format.chapter.pages "chapter and pages" output.check
      new.block
      format.number.series output
      new.sentence
      publisher "publisher" output.check
      address output
    }
    { format.chapter.pages "chapter and pages" output.check
      new.block
      format.book.crossref output.nonnull
    }
  if$
  format.edition output
  format.date "year" output.check
  new.block
  note output
  fin.entry
}

FUNCTION {incollection}
{ label.year
  output.bibitem
  format.authors "author" output.check
  new.block
  format.title "title" output.check
  new.block
  crossref missing$
    { format.in.ed.booktitle "booktitle" output.check
      format.bvolume output
      format.number.series output
      format.chapter.pages output
      new.sentence
      publisher "publisher" output.check
      address output
      format.edition output
      format.date "year" output.check
    }
    { format.incoll.inproc.crossref output.nonnull
      format.chapter.pages output
    }
  if$
  new.block
  note output
  fin.entry
}

FUNCTION {inproceedings}
{ label.year
  output.bibitem
  format.authors "author" output.check
  new.block
  format.title "title" output.check
  new.block
  crossref missing$
    { format.in.ed.booktitle "booktitle" output.check
      format.bvolume output
      format.number.series output
      format.pages output
      address empty$
	{ organization publisher new.sentence.checkb
	  organization output
	  publisher output
	  format.date "year" output.check
	}
	{ publisher output
	  address output.nonnull
	  format.date "year" output.check
	  new.sentence
	  organization output
	}
      if$
    }
    { format.incoll.inproc.crossref output.nonnull
      format.pages output
    }
  if$
  new.block
  note output
  fin.entry
}

FUNCTION {conference} { inproceedings }

FUNCTION {manual}
{ label.year
  output.bibitem
  author empty$
    { organization empty$
	'skip$
	{ organization output.nonnull
	  address output
	}
      if$
    }
    { format.authors output.nonnull }
  if$
  new.block
  format.btitle "title" output.check
  author empty$
    { organization empty$
	{ address new.block.checka
	  address output
	}
	'skip$
      if$
    }
    { organization address new.block.checkb
      organization output
      address output
    }
  if$
  format.edition output
  format.date output
  new.block
  note output
  fin.entry
}

FUNCTION {mastersthesis}
{ label.year
  output.bibitem
  format.authors "author" output.check
  new.block
  format.title "title" output.check
  new.block
  "Master's thesis" format.thesis.type output.nonnull
  school "school" output.check
  address output
  format.date "year" output.check
  new.block
  note output
  fin.entry
}

FUNCTION {misc}
{ label.year
  output.bibitem
  format.authors output
  title howpublished new.block.checkb
  format.title output
  howpublished new.block.checka
  howpublished output
  format.date output
  new.block
  note output
  fin.entry
  empty.misc.check
}

FUNCTION {phdthesis}
{ label.year
  output.bibitem
  format.authors "author" output.check
  new.block
  format.btitle "title" output.check
  new.block
  "PhD thesis" format.thesis.type output.nonnull
  school "school" output.check
  address output
  format.date "year" output.check
  new.block
  note output
  fin.entry
}

FUNCTION {proceedings}
{ label.year
  output.bibitem
  editor empty$
    { organization output }
    { format.editors.bold output.nonnull }
  if$
  new.block
  format.btitle "title" output.check
  format.bvolume output
  format.number.series output
  address empty$
    { editor empty$
	{ publisher new.sentence.checka }
	{ organization publisher new.sentence.checkb
	  organization output
	}
      if$
      publisher output
      format.date "year" output.check
    }
    { publisher output
      address output.nonnull
      format.date "year" output.check
      new.sentence
      editor empty$
	'skip$
	{ organization output }
      if$
    }
  if$
  new.block
  note output
  fin.entry
}

FUNCTION {techreport}
{ label.year
  output.bibitem
  format.authors "author" output.check
  new.block
  format.title "title" output.check
  new.block
  format.tr.number output.nonnull
  institution "institution" output.check
  address output
  format.date "year" output.check
  new.block
  note output
  fin.entry
}

FUNCTION {unpublished}
{ label.year
  output.bibitem
  format.authors "author" output.check
  new.block
  format.title "title" output.check
  new.block
  note "note" output.check
  format.date output
  fin.entry
}

FUNCTION {default.type} { misc }

MACRO {jan} {"January"}

MACRO {feb} {"February"}

MACRO {mar} {"March"}

MACRO {apr} {"April"}

MACRO {may} {"May"}

MACRO {jun} {"June"}

MACRO {jul} {"July"}

MACRO {aug} {"August"}

MACRO {sep} {"September"}

MACRO {oct} {"October"}

MACRO {nov} {"November"}

MACRO {dec} {"December"}

MACRO {acmcs} {"ACM Computing Surveys"}

MACRO {acta} {"Acta Informatica"}

MACRO {cacm} {"Communications of the ACM"}

MACRO {ibmjrd} {"IBM Journal of Research and Development"}

MACRO {ibmsj} {"IBM Systems Journal"}

MACRO {ieeese} {"IEEE Transactions on Software Engineering"}

MACRO {ieeetc} {"IEEE Transactions on Computers"}

MACRO {ieeetcad}
 {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}

MACRO {ipl} {"Information Processing Letters"}

MACRO {jacm} {"Journal of the ACM"}

MACRO {jcss} {"Journal of Computer and System Sciences"}

MACRO {scp} {"Science of Computer Programming"}

MACRO {sicomp} {"SIAM Journal on Computing"}

MACRO {tocs} {"ACM Transactions on Computer Systems"}

MACRO {tods} {"ACM Transactions on Database Systems"}

MACRO {tog} {"ACM Transactions on Graphics"}

MACRO {toms} {"ACM Transactions on Mathematical Software"}

MACRO {toois} {"ACM Transactions on Office Information Systems"}

MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}

MACRO {tcs} {"Theoretical Computer Science"}

READ

FUNCTION {sortify}
{ purify$
  "l" change.case$
}

INTEGERS { len }

FUNCTION {chop.word}
{ 's :=
  'len :=
  s #1 len substring$ =
    { s len #1 + global.max$ substring$ }
    's
  if$
}


FUNCTION {format.lab.names}
{ 's :=
  s num.names$ 'numnames :=
  numnames #1 =
    { s #1 "{vv }{ll}" format.name$ }
    { numnames #2 =
        { s #1 "{vv }{ll }and " format.name$ s #2 "{vv }{ll}" format.name$ * }
        { s #1 "{vv }{ll }" format.name$ "et~al." * }
      if$
    }
  if$
}

FUNCTION {author.key.label}
{ author empty$
    { key empty$
	{ cite$ #1 #3 substring$ }
	{ key }
      if$
    }
    { author format.lab.names }
  if$
}

FUNCTION {author.editor.key.label}
{ author empty$
    { editor empty$
	{ key empty$
	    { cite$ #1 #3 substring$ }
	    { key }
	  if$
	}
	{ editor format.lab.names }
      if$
    }
    { author format.lab.names }
  if$
}

FUNCTION {author.key.organization.label}
{ author empty$
    { key empty$
	{ organization empty$
	    { cite$ #1 #3 substring$ }
	    { "The " #4 organization chop.word #3 text.prefix$ }
	  if$
	}
	{ key }
      if$
    }
    { author format.lab.names }
  if$
}

FUNCTION {editor.key.organization.label}
{ editor empty$
    { key empty$
	{ organization empty$
	    { cite$ #1 #3 substring$ }
	    { "The " #4 organization chop.word #3 text.prefix$ }
	  if$
	}
	{ key }
      if$
    }
    { editor format.lab.names }
  if$
}

FUNCTION {calc.label}
{ type$ "book" =
  type$ "inbook" =
  or
    'author.editor.key.label
    { type$ "proceedings" =
	'editor.key.organization.label
	{ type$ "manual" =
	    'author.key.organization.label
	    'author.key.label
	  if$
	}
      if$
    }
  if$
  duplicate$
  year empty$
    'skip$
    { ", " * }
  if$
  year field.or.null purify$ *  % CHANGED - pfps - 15 Feb 1989
  'label :=
  year field.or.null purify$
  str.to.int #9999 swap$ - int.to.str$
  swap$
  * sortify 'sort.label :=
}

FUNCTION {sort.format.names}
{ 's :=
  #1 'nameptr :=
  ""
  s num.names$ 'numnames :=
  numnames 'namesleft :=
    { namesleft #0 > }
    { nameptr #1 >
	{ "   " * }
	'skip$
      if$
      s nameptr "{vv{ } }{ll{ }}{  ff{ }}{  jj{ }}" format.name$ 't :=
      nameptr numnames = t "others" = and
	{ "et al." * }
	{ t sortify * }
      if$
      nameptr #1 + 'nameptr :=
      namesleft #1 - 'namesleft :=
    }
  while$
}

FUNCTION {sort.format.title}
{ 't :=
  "A " #2
    "An " #3
      "The " #4 t chop.word
    chop.word
  chop.word
  sortify
  #1 global.max$ substring$
}

FUNCTION {author.sort}
{ author empty$
    { key empty$
	{ "to sort, need author or key in " cite$ * warning$
	  ""
	}
	{ key sortify }
      if$
    }
    { author sort.format.names }
  if$
}

FUNCTION {author.editor.sort}
{ author empty$
    { editor empty$
	{ key empty$
	    { "to sort, need author, editor, or key in " cite$ * warning$
	      ""
	    }
	    { key sortify }
	  if$
	}
	{ editor sort.format.names }
      if$
    }
    { author sort.format.names }
  if$
}

FUNCTION {author.organization.sort}
{ author empty$
    { organization empty$
	{ key empty$
	    { "to sort, need author, organization, or key in " cite$ * warning$
	      ""
	    }
	    { key sortify }
	  if$
	}
	{ "The " #4 organization chop.word sortify }
      if$
    }
    { author sort.format.names }
  if$
}

FUNCTION {editor.organization.sort}
{ editor empty$
    { organization empty$
	{ key empty$
	    { "to sort, need editor, organization, or key in " cite$ * warning$
	      ""
	    }
	    { key sortify }
	  if$
	}
	{ "The " #4 organization chop.word sortify }
      if$
    }
    { editor sort.format.names }
  if$
}

FUNCTION {presort}
{ calc.label
  sort.label
  "    "
  *
  type$ "book" =
  type$ "inbook" =
  or
    'author.editor.sort
    { type$ "proceedings" =
	'editor.organization.sort
	{ type$ "manual" =
	    'author.organization.sort
	    'author.sort
	  if$
	}
      if$
    }
  if$
  *
  "    "
  *
  year field.or.null sortify
  *
  "    "
  *
  title field.or.null
  sort.format.title
  *
  #1 entry.max$ substring$
  'sort.key$ :=
}

ITERATE {presort}

SORT

STRINGS { longest.label last.sort.label next.extra }

INTEGERS { longest.label.width last.extra.num }

FUNCTION {initialize.longest.label}
{ "" 'longest.label :=
  #0 int.to.chr$ 'last.sort.label :=
  "" 'next.extra :=
  #0 'longest.label.width :=
  #0 'last.extra.num :=
}

FUNCTION {forward.pass}
{ last.sort.label sort.label =
    { last.extra.num #1 + 'last.extra.num :=
      last.extra.num int.to.chr$ 'extra.label :=
    }
    { "a" chr.to.int$ 'last.extra.num :=
      "" 'extra.label :=
      sort.label 'last.sort.label :=
    }
  if$
}

FUNCTION {reverse.pass}
{ next.extra "b" =
    { "a" 'extra.label := }
    'skip$
  if$
  label extra.label * 'label :=
  label width$ longest.label.width >
    { label 'longest.label :=
      label width$ 'longest.label.width :=
    }
    'skip$
  if$
  extra.label 'next.extra :=
}

EXECUTE {initialize.longest.label}

ITERATE {forward.pass}

REVERSE {reverse.pass}

FUNCTION {begin.bib}
{
  "# label-style: default" write$ newline$
  "0000" 'yearlabel :=
  newline$
}

EXECUTE {begin.bib}

EXECUTE {init.state.consts}

ITERATE {call.type$}

FUNCTION {end.bib}
{ newline$
}

EXECUTE {end.bib}
