[Tex/LaTex] First author in bibliography in lastname, firstname but subsequent authors as firstname lastname

biblatexlegal-stylesorting

The Australian Legal Citation Guide v3 states that for a bibliography, the entry for a book should have the first author appear as lastname, firstname and then all subsequent authors appear as firstname lastname, e.g.

Cook, Catriona, Robin Creyke and Robert Geddes

The macro below does this by printing out the first author entry in last, first order and then adding a comma and a space if there is no 'et al' following. I find this doesn't work though. I'm trying to use the \ifandothers test but it seems always to return false. So for an 'et al' entry I end up with:

Cook, Catriona, et al

I am trying to do this with the macro below. I've been at it for hours and I'm brand new to LaTeX and biblatex so I'm pulling what hair I have left out in frustration.

Is the macro I am using correct? I suspect this is a noob error. I would appreciate any help.

PS: I'm not even up to the editor part of the macro yet.

PPS: This code comes from aglc2.cbx which is part of Will Hardy's AGLC style and is posted at http://github.com/willhardy/aglc

\newbibmacro{author/editor:lastnamefirst}{%
\ifthenelse{\ifuseauthor\AND\NOT\ifnameundef{author}}%
    {\ifuseauthor{%
    \ifandothers{author}{%
        \printnames[sortname][1-1]{author}%
        \printnames[default][2-2]{author}%
    } {%
        \printnames[sortname][1-1]{author}%
        \addcomma\addspace%
        \printnames[default][2-3]{author}%
        }%
    }{}}%
    {\ifthenelse{\ifuseeditor\AND\NOT\ifnameundef{editor}}{\printnames[sortname]{editor}}{}}%
}

UPDATE: In response to @lockstep's suggestion here is some code that shows that I could not get \DeclareNameAlias to work:

\documentclass[titlepage]{article}
\usepackage[style=aglc2,backend=biber]{biblatex}
\DeclareNameAlias{default}{last-first/first-last}
\bibliography{week1}

\begin{document}
Test citations here:\footcite{ldtl7} and here:\footcite{ldtl7a}
\printbibliography
\end{document}

Here's the bib file:

@BOOK{ldtl7,
  year       = 2009,
  author     = {Catriona Cook and Robin Creyke and Robert Geddes and David Hamer},
  title      = {Laying Down the Law},
  edition    = 7,
  publisher  = {LexisNexis Butterworths}
}
@BOOK{ldtl7a,
  year       = 2009,
  author     = {Catriona Cook and Robin Creyke and Robert Geddes},
  title      = {Laying Down the Law2},
  edition    = 7,
  publisher  = {LexisNexis Butterworths}
}

Here's the output:

References
Cook, Catriona, Robin Creyke and Robert Geddes, Laying Down the Law2 (LexisNexis Butterworths, 7th ed, 2009)
Cook, Catriona, Robin Creyke et al, Robert Geddes, Laying Down the Law (LexisNexis Butterworths, 7th ed, 2009)

And in the footnotes:

1 Cook, Catriona, Robin Creyke et al, Robert Geddes, Laying Down the Law (LexisNexis Butterworths, 7th ed, 2009).
2 Cook, Catriona, Robin Creyke and Robert Geddes, Laying Down the Law2 (LexisNexis Butterworths, 7th ed, 2009).

Best Answer

It shouldn't be necessary to define new macros. Try the following:

\documentclass{article}

\usepackage[style=verbose]{biblatex}

\AtBeginBibliography{%
  \DeclareNameAlias{default}{last-first/first-last}%
}
\renewcommand*{\finalnamedelim}{%
%   \ifnumgreater{\value{liststop}}{2}{\finalandcomma}{}% DELETED
  \addspace\bibstring{and}\space}

\usepackage{filecontents}

\begin{filecontents}{biblatextest.bib}
@book{CCG01,
  author = {Cook, Catriona and Creyke, Robin and Geddes, Robert},
  year = {2001},
  title = {Alpha},
}
\end{filecontents}

\addbibresource{biblatextest.bib}

\begin{document}

Some text \autocite{CCG01}.

\printbibliography

\end{document}

EDIT: Example updated to use \AtBeginBibliography.

(The filecontents environment is only used to include some external files directly into the example, so that it compiles. It is not necessary for the solution.)

Related Question