I am currently modifying a bst file. The problem I am facing now is how to change the separator of the style.
At the moment, I get the following output:
Badie, Dina (2010) ‘Groupthink, iraq, and the war on terror: Explaining us policy shifts toward iraq’ Foreign Policy Analysis 6(4):277–296.
However, I need the following output:
Badie, Dina (2010) ‘Groupthink, iraq, and the war on terror: Explaining us policy shifts toward iraq’, Foreign Policy Analysis 6(4):277–296.
With NO comma after the year, but WITH a comma after the title (and after the editor in a chapter of an edited volume).
Here is the code of the bst file:
FUNCTION {output.nonnull} { 's := output.state mid.sentence = { ", " * write$ } { output.state after.block = %{ add.period$ write$ { " " * write$ newline$ "\newblock " write$ } { output.state before.all = 'write$ { add.period$ " " * write$ } if$ } if$ mid.sentence 'output.state := } if$ s } FUNCTION {article} { output.bibitem format.authors "author" output.check author format.key output format.date "year" output.check date.block format.title quote "title" output.check new.block crossref missing$ { journal "journal" bibinfo.check "journal" output.check add.blank format.vol.num.pages output } { format.article.crossref output.nonnull format.pages output } if$ new.block format.note output fin.entry } FUNCTION {format.title} { title duplicate$ empty$ 'skip$ { "t" change.case$ } if$ "title" bibinfo.check }
@ARTICLE, then you should start by showing us theFUNCTION {article}entry. More may still be needed, if the function shunts to a sub-function to handle the title and the date.articlefunction you provide, it would seem that any punctuation following the year would be handled by the functionformat.dateor maybedate.block. Likewise, punctuation following the title would likely be handled informat.dateornew.block. In the four functions I just mentioned, you might look to see in which ones a comma appears, as that is probably the origin of the comma in your output. (Also note that in your example, there is no discrepancy after the year in how the "bad" and "good" references are shown)articlefunction, changing the lineformat.title quote "title" output.checkto something likeformat.title quote "," * "title" output.checkmight give you the needed comma. The insertion of"," *says to concatenate a comma to the prior string. But whether that will work depends on whatformat.titleis really doing.