0

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

6
  • Have you cleaned the auxiliary files before running your new bst file? I tried your suggestion and it changed the order of names mostly as expected...
    – henrique
    Commented Aug 12, 2015 at 23:17
  • Thank you, that was the issue. It seems I have to save over the original file. I can not change the name of the .bst file and keep it in the same directory. I think I will try custom-bib in anycase. Commented Aug 14, 2015 at 15:45
  • Actually you must give the file another name according to the license header, and then you just need to change the \bibliographystyle call to reflect that.
    – henrique
    Commented Aug 14, 2015 at 18:18
  • Thank you, can you please elaborate on how I can change the name of the .bst file according to the licence header. Sorry everything I tried did not work. Commented Aug 19, 2015 at 6:41
  • If I rename the file "apsrTUT", and change the '\bibliographystyle{apsrTUT}' it does not generate a bibliography. I have included the natbib package and the har2nat package. Commented Aug 19, 2015 at 6:53

1 Answer 1

0

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

You must log in to answer this question.

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