[Tex/LaTex] How to put parentheses around year in list of references

bibliographies

I am using apj.bst together with style \citestyle{apj} and with the \usepackage{natbib}.

I have made few changing on this style, so that my bibliography appears like this: for example

Beth, T. and Gollmann, D. 1989. Algorithm Engineering for Public Key
Algorithm. IEEE Journal on selected areas in communications 7 (4):
458-465.

My question is: how can put parentheses around the year to be appear like this:

Beth, T. and Gollmann, D. (1989). Algorithm Engineering for Public Key
Algorithm. IEEE Journal on selected areas in communications 7 (4):
458-465.

Is there anyone who can help me?

Best Answer

copy the apj.bat to myapj.bst and then replace the function format.date with

FUNCTION {format.date}
{  year duplicate$ empty$
    { "empty year in " cite$ * "; set to ????" * warning$
       pop$ "????" }
    'skip$ 
  if$
  " (" swap$ * * ")" *
  extra.label *
  before.all 'output.state :=
  after.sentence 'output.state :=
}

put the myapj,bst for testing in your documents directory and use

\bibliographystyle{myapj}