[Tex/LaTex] Harvard style bibliography with biblatex… almost, but not quite!

biblatexharvard-style

My University requires that all submissions use the Harvard format for referencing. I understand this is not directly supported by BibLaTeX without some tweaking.

I spent much of my evening yesterday researching how to do this and I have almost managed to get BibLaTeX to output my bibliography in the required format. Below is an example of the current output:

Example of Harvard bibliography

However, a few issues still remain unresolved.

  1. There should be no spacing between the first and middle initials of authors, i.e. Doe, J.D. not Doe, J. D.. I have tried using \renewcommand*{\bibinitdelim}{} as suggested here, but it did not work. The nearest I have to a solution is to insert a thin space as suggested in this response.

  2. The first author should be listed as de Silva, U.C., not Silva, U.C. de.

  3. The year of publication should not have a full stop after the parentheses, i.e. (2011), not (2011),.

  4. Some bibliography entries will need to be appended with additional information (such as the date of access, if the source was online, etc.) using the note field at the end of the entry. However, the current settings cause the note field for articles to be sandwiched between the volume number and page numbers, rather than after the page numbers, as shown below:

biblatex note field

Does anyone have any ideas as to how I can resolve these formatting issues?

Here are the settings I've applied so far:

\documentclass[12pt,a4paper,oneside]{report}

\usepackage{filecontents}
\usepackage[
firstinits=true, % render first and middle names as initials
maxcitenames=3,
maxbibnames=99,
style=authoryear,
dashed=false, % re-print recurring author names in bibliography
natbib=true,
url=false
]{biblatex}

% Use single quotes around titles:
\usepackage[british]{babel}
\usepackage{csquotes}

\DeclareNameAlias{author}{last-first}
\renewcommand*{\mkbibnamefirst}[1]{{\let~\,#1}} % insert thin spaces between author initials
\renewcommand*{\nameyeardelim}{\addcomma\addspace} % insert a comma between author and year in-text citations
\renewcommand*{\newunitpunct}{\addcomma\addspace} % comma as separator in bibliography, not full stop
\setlength\bibitemsep{1.5\itemsep} % increase spacing between entries in bibliography
\renewbibmacro{in:}{} % remove 'in:' preceding article title

% Place volume number within parentheses:
\renewbibmacro*{volume+number+eid}{
    \printfield{volume}
    \setunit*{\addnbspace}% NEW (optional); there's also \addnbthinspace
    \printfield{number}
    \setunit{\addcomma\space}
    \printfield{eid}}
\DeclareFieldFormat[article]{number}{\mkbibparens{#1}}

\begin{filecontents}{\jobname.bib}
@Article{Belshe_2010a,
  Title = {{{E}fficacy of live attenuated influenza vaccine in children against influenza {B} viruses by lineage and antigenic similarity}},
  Author = {Belshe, R. B. and Coelingh, K. and Ambrose, C. S. and Woo, J. C. and Wu, X.},
  Journal = {Vaccine},
  Year = {2010},
  Month = {Feb},
  Note = {[Online]. Available at: \url{example.com} (Accessed: 10 January 2013)},
  Number = {9},
  Pages = {2149--2156},
  Volume = {28},
}

@Article{de-Silva_2012,
  Title = {{{A} comprehensive analysis of reassortment in influenza {A} virus}},
  Author = {de Silva, U. C. and Tanaka, H. and Nakamura, S. and Goto, N. and Yasunaga, T.},
  Journal = {Biol Open},
  Year = {2012},
  Month = {Apr},
  Number = {4},
  Pages = {385--390},
  Volume = {1},
}
\end{filecontents}

\addbibresource{\jobname.bib}
\nocite{*} % print all citations

\begin{document}
    \printbibliography[title=References]
\end{document}

My setup consists of TeXstudio 2.3, TeXlive 2012, and BibLaTeX 1.7-1 on Debian Wheezy, if that affects anything.

Thanking you all in advance,

Baldwin

EDIT: Thanks for your helpful replies everyone. This is the first document in which I've used the BibLaTeX package, so I really appreciate your responses.

Best Answer

Ad 1: \renewcommand*{\bibinitdelim}{} works for me. EDIT: Note that \bibinitdelim requires Biber instead of BibTeX. As this command was added in biblatex 1.3, there's a chance that it works with your distribution (try the backend=biber option); nevertheless consider to upgrade to the current versions of biblatex and Biber.

Ad 2: Use the package option useprefix=true.

Ad 3: \usepackage{xpatch}\xapptobibmacro{date+extrayear}{\nopunct}{}{}.

Ad 4: Use the addendum instead of the note field. EDIT: In the case at hand, follow moewe's advice and use the url and urldate fields.

\documentclass[12pt,a4paper,oneside]{report}

\usepackage{filecontents}
\usepackage[
firstinits=true, % render first and middle names as initials
useprefix=true,
maxcitenames=3,
maxbibnames=99,
style=authoryear,
dashed=false, % re-print recurring author names in bibliography
natbib=true,
url=false
]{biblatex}

\renewcommand*{\bibinitdelim}{}

\usepackage{xpatch}
\xapptobibmacro{date+extrayear}{\nopunct}{}{}

% Use single quotes around titles:
\usepackage[british]{babel}
\usepackage{csquotes}

\DeclareNameAlias{author}{last-first}
\renewcommand*{\mkbibnamefirst}[1]{{\let~\,#1}} % insert thin spaces between author initials
\renewcommand*{\nameyeardelim}{\addcomma\addspace} % insert a comma between author and year in-text citations
\renewcommand*{\newunitpunct}{\addcomma\addspace} % comma as separator in bibliography, not full stop
\setlength\bibitemsep{1.5\itemsep} % increase spacing between entries in bibliography
\renewbibmacro{in:}{} % remove 'in:' preceding article title

% Place volume number within parentheses:
\renewbibmacro*{volume+number+eid}{
    \printfield{volume}
    \setunit*{\addnbspace}% NEW (optional); there's also \addnbthinspace
    \printfield{number}
    \setunit{\addcomma\space}
    \printfield{eid}}
\DeclareFieldFormat[article]{number}{\mkbibparens{#1}}

\begin{filecontents}{\jobname.bib}
@Article{Belshe_2010a,
  Title = {{{E}fficacy of live attenuated influenza vaccine in children against influenza {B} viruses by lineage and antigenic similarity}},
  Author = {Belshe, R. B. and Coelingh, K. and Ambrose, C. S. and Woo, J. C. and Wu, X.},
  Journal = {Vaccine},
  Year = {2010},
  Month = {Feb},
  Addendum = {[Online]. Available at: \url{example.com} (Accessed: 10 January 2013)},
  Number = {9},
  Pages = {2149--2156},
  Volume = {28},
}

@Article{de-Silva_2012,
  Title = {{{A} comprehensive analysis of reassortment in influenza {A} virus}},
  Author = {de Silva, U. C. and Tanaka, H. and Nakamura, S. and Goto, N. and Yasunaga, T.},
  Journal = {Biol Open},
  Year = {2012},
  Month = {Apr},
  Number = {4},
  Pages = {385--390},
  Volume = {1},
}
\end{filecontents}

\addbibresource{\jobname.bib}
\nocite{*} % print all citations

\begin{document}
    \printbibliography[title=References]
\end{document}

enter image description here