[Tex/LaTex] Customizing harvard bibliography style apsr

bibliographiescustom-bibharvard-style

The apsr style is almost what I need to comply to our totally unique Harvard style based University referencing requirements. I need to make the following customizations:

For displaying authors the specified format for apsr is

FUNCTION {format.authors}
{ author empty$
    { "" }
    { author #1 "{vv~}{ll}{, jj}{, f}" format.name$           
      "{ff }{vv~}{ll}{, jj}" author format.rem.names
    }
  if$
}

I need all authors to follow the style "{vv~}{ll}{, jj}{, f}". When I try to change the line "{ff }{vv~}{ll}{, jj}" author format.rem.names to "{vv~}{ll}{, jj}{, f}" author format.rem.namesI do not get any change 🙁 . Should I change another function as well?

Example bibtex:

    @article{wang2015cyber
,   author  = {Wang, Lihui and T\"orngren, Martin and Onori, Mauro}
,   title   = {Current status and advancement of cyber-physical systems in manufacturing}
,   journal = {Journal of Manufacturing Systems}
,   year    = {2015}
,   publisher   = {Elsevier}
}

Output
enter image description here

I would like to have it:

WANG, L., TORNGEREN M. & ONORI M. 2015. ect…

I am quite new and the only one using latex at my University it seems, everybody is using MS WORD . I am trying to build a template for post graduate students.

here is a link to the original apsr.bst

Best Answer

The apsr.bst license requires

if you do make changes, you name it something other than btxbst.doc, plain.bst, unsrt.bst, alpha.bst, abbrv.bst, agsm.bst, dcu.bst or kluwer.bst, jmr.bst, apsr.bst.

This restriction helps ensure that all standard styles are identical.

So, if you intend to change it, you should rename the file to something else. Following your suggestion, let's call it apsrTUT.bst.

I copied the original file and renamed it with (in a unix-like environment):

cp `kpsewhich apsr.bst` apsrTUT.bst

(kpsewhich finds the file in the texlive tree so that I don't have to look for it; it actually resides in $TEXDIR/texmf-dist/bibtex/bst/harvard/apsr.bst)

Then I applied the change you mentioned; here's the diff for the original apsr.bst to the new apsrTUT.bst:

201c201
<       "{ff }{vv~}{ll}{, jj}" author format.rem.names
---
>       "{vv~}{ll}{, jj}{, f}" author format.rem.names

We must then pass the new style file to the bibliographystyle call in our file

\bibliographystyle{apsrTUT}

If you've done this and it still isn't working, make sure to delete the external auxiliary files (.aux, .bbl, .blg, .log) before compiling the document again.


Here's a MWE (with the packages you mentioned in your comments):

The filecontents environment used here allows one to ship an external file (here the bibliographic database, \jobname.bib) within the document. It is used here only to provide a fully compilable example.

\begin{filecontents}{\jobname.bib}
  @article{wang2015cyber,
    author = {Wang, Lihui and T\"orngren, Martin and Onori, Mauro},
    title = {Current status and advancement of cyber-physical systems in manufacturing},
    journal = {Journal of Manufacturing Systems},
    year = {2015},
    publisher = {Elsevier},
  }
\end{filecontents}
\documentclass{article}
\usepackage{natbib}
\usepackage{har2nat}
\begin{document}
\cite{wang2015cyber}
\bibliographystyle{apsrTUT}
\bibliography{\jobname.bib}
\end{document}

And the output:

mwe sample