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:

 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

3 Answers 3


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
    { "," * }

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

  • +1 Nice. I was playing with using add.period$ as a base for my function, but couldn't get it working in all cases. It's obvious now that I see how to do it!
    – Simon
    Commented Jan 16, 2013 at 22:20

I think on solution could be to redefine the question marks local by setting:


To provide a mwe I saved your linked bst-file with the name utphys.bst. You should avoid spaces or other special characters inside your filename. (I think a dot is also wrong)

In the example below I defined a new if-function to which will be true after a question mark. If this function is true no comma will be printed.

The result without the redefinition:

enter image description here

The result with the modification:

enter image description here

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



\gobblecommafalse %default

I'm also using a modified utphys.sty style. A quick hack that I use to remove the extra commas in the titles is to define the following function in the style file:

FUNCTION {add.comma$}
    #-1 'steps :=
    {duplicate$ steps #1 substring$ "}" =}
        {steps #1 - 'steps := }
    duplicate$ steps #1 substring$ "?" =
        {"" *}  % string ended in ? so don't do anything skip$
        {"," *} % string didn't end in ? so add a comma

Then, the only change to the format.title function is to insert a call to add.comma$

FUNCTION {format.title}
{ title empty$
    { "" }
    {"``" title "t" change.case$ * add.comma$ "''" * }

This is good enough for my bibliography, however the add.comma$ function only does the bare minimum it that it needs in order to work in my case. It should probably be made more robust so that it works with whitespace and punctuation other than "?".

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .