2

I use makebst to create a .bst file, but there are two periods between the last author name and year. How can I remove one period?

enter image description here

The whole myHarvard.bst can be find here. The following are two functions that I think are related.

FUNCTION {article}
{ output.bibitem
  format.authors "author" output.check
  author format.key output
  format.date "year" output.check
  date.block
  format.title "title" output.check
  new.block
  crossref missing$
    {
      journal
      "journal" bibinfo.check
      emphasize
      "journal" output.check

      format.vol.num.pages output
    }
    { format.article.crossref output.nonnull
      format.pages output
    }
  if$
  new.block
  format.url output
  new.block
  format.note output
  fin.entry
}

FUNCTION {output.nonnull}
{ 's :=
  output.state mid.sentence =
    { ". " * write$ }
    { output.state after.block =
        { add.period$ write$
          newline$
          "\newblock " write$
        }
        { output.state before.all =
            'write$
            { add.period$ " " * write$ }
          if$
        }
      if$
      mid.sentence 'output.state :=
    }
  if$
  s
}
2
  • 1
    Could you please show us the complete .bst file? If it's too large you can post it at pastebin or some other site like that. – Phelype Oleinik Jan 15 '19 at 14:21
  • @PhelypeOleinik Thanks for your interest. The full bst file is attached in the question now. – WZhao Jan 15 '19 at 14:30
2

I think I find a way to sort it out.

enter image description here

FUNCTION {output.nonnull}
{ 's :=
  output.state mid.sentence =
    { add.period$ " " * write$ }    % <- change this line
    { output.state after.block =
        { add.period$ write$
          newline$
          "\newblock " write$
        }
        { output.state before.all =
            'write$
            { add.period$ " " * write$ }
          if$
        }
      if$
      mid.sentence 'output.state :=
    }
  if$
  s
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.