7

I'm trying to create a preamble that matches the "interesting" form of Harvard that my University insists on using.

I'm almost there but need a method to remove the space between pp. and the page numbers.

In my Harvard guide it must be pp.66-67 instead of pp. 66-67

Please help!

Code I have so far:

\documentclass[12pt]{report}

\usepackage[
firstinits=true,
useprefix=true,
maxcitenames=3,
maxbibnames=99,
style=authoryear,
dashed=false, 
natbib=true,
isbn=false,
url=false
]{biblatex}

\usepackage{csquotes}

\renewbibmacro*{name:andothers}{
  \ifboolexpr{
    test {\ifnumequal{\value{listcount}}{\value{liststop}}}
    and
    test \ifmorenames
  }
    {\ifnumgreater{\value{liststop}}{1}
       {\finalandcomma}
       {}%
     \andothersdelim\bibstring[\emph]{andothers}}
    {}}

\renewcommand*{\bibinitdelim}{}
\usepackage{xpatch}
\xapptobibmacro{date+extrayear}{\nopunct}{}{}
\usepackage[british]{babel}
\usepackage{csquotes}

\DeclareNameAlias{author}{last-first}
\renewcommand*{\bibnamedelimd}{\addlpthinspace} 
\renewcommand*{\nameyeardelim}{\addcomma\addspace} 
\setlength\bibitemsep{1.5\itemsep} 
\renewbibmacro{in:}{}

\renewbibmacro*{volume+number+eid}{
  \setunit*{\addcomma\space}
    \printfield{volume}
    \setunit*{\addnbspace}
    \printfield{number}
    \setunit{\addcomma\space}
    \printfield{eid}}
\DeclareFieldFormat[article]{number}{\mkbibparens{#1}}


\addbibresource{references.bib}
\AtEveryBibitem{\clearlist{language}} % clears language
\AtEveryBibitem{\clearfield{note}}    % clears notes


\begin{document}

\printbibliography[title=References]

\end{document}
4
  • Welcome to TeX.SX! Please make your code compilable, starting with \documentclass{...} and ending with \end{document}. Oct 27, 2013 at 17:13
  • 3
    Why would you? It's wrong and the guide has a clear misprint. ;-) Ask them to look in one hundred books taken at random from the university's library and count how many have no space after “pp.”.
    – egreg
    Oct 27, 2013 at 17:17
  • Lol I wish it wasn't so ridiculous too!!! If you want a laugh... www2.bathspa.ac.uk/services/library/using-the-library/… Oct 27, 2013 at 17:23
  • 2
    @MikeSpencer Those rules are not coherent: there are abbreviated name with a space between initials and others without: “Friedman, M. J.” and “Revill, D.H.” on the same page 6. So you can assume the missing space after “pp.” is a misprint. ;-)
    – egreg
    Oct 27, 2013 at 17:43

1 Answer 1

10

If you absolutely have to use such a horrible style: Redefine \ppspace. See section 4.6.4 of the manual for details.

\documentclass{article}

\usepackage[style=authoryear]{biblatex}

\renewcommand*{\ppspace}{}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@misc{A01,
  author = {Author, A.},
  year = {2001},
  title = {Alpha},
}
\end{filecontents}

\addbibresource{\jobname.bib}

\begin{document}

Some text \autocite[9]{A01}.

\printbibliography

\end{document}

enter image description here

1
  • Thank you so much, very much appreciated. What can I say, it's monkey say, monkey do. We've always referenced like this... etc.. :p Oct 27, 2013 at 17:35

You must log in to answer this question.

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