[Tex/LaTex] Remove comma after title ending with questionmark

bibtexpunctuation

I am using a bit modified bibtex style but with quite common base. It is based on utphys 2.7 which is based on "IEEE Transactions bibliography style (29-Jan-88 version)"

I'd like to remove comma after titles ending with question marks. Some automated hack will do. (Not changing the bbl)

Bibtex entery is as follows:

@article{EPR35,
 author = {Einstein, A. and Podolsky, B. and Rosen, N.},
 title = {Can Quantum-Mechanical Description of Physical Reality Be Considered Complete?}
}

And corresponding output is like:

A. Einstein, B. Podolsky ja N. Rosen, “Can quantum-mechanical description of physical
reality be considered complete?,” Phys. Rev. 47 (May, 1935) 777–780. 5, 8

Bibtex style is at http://pastebin.com/h8in9BZU

Best Answer

The makebst package has a nice function to test whether the last character of a string is one of `! ? .":

FUNCTION {non.stop}
{ duplicate$
   "}" * add.period$
   #-1 #1 substring$ "." =
}

Then you can write an add.comma function that tests that:

FUNCTION {add.comma}
{ non.stop
    { "," * }
    'skip$
  if$
}

Use this add.comma function in places where you want the conditional comma.