[Tex/LaTex] No first name in biblatex

biblatex

With Biblatex, how to print the author name, in the bibliography, without their first name?

I get

Newton, I., G. W. Leibniz, and L. Euler (1600). Infinitesimal Analysis.

But I want

Newton, Leibniz and Euler (1600). Infinitesimal Analysis.

From

% arara: pdflatex
% arara: biber
% arara: pdflatex
\documentclass{article}

\usepackage{filecontents}

\usepackage[
    backend = biber,
    style = authoryear-comp,
    maxcitenames = 2,
    maxbibnames = 5,
    sorting = nyt,
    dashed=false,
    uniquename = false,
    uniquelist = false
]{biblatex}


\begin{filecontents*}{test.bib}

    @book{
        newton,
        title = {Infinitesimal Analysis},
        author = {Newton, I. and Leibniz, G. W. and Euler, L.},
        year = {1600}
    }

\end{filecontents*}

\addbibresource{test.bib}

\begin{document}

    \nocite{*}

    \printbibliography

\end{document}

Best Answer

You can use \DeclareNameFormat to only use the last name. The finalandcomma only appears if applicable. For example, if ngerman is loaded, not comma is set. You can remove the comma by using package etoolbox.

% arara: pdflatex
% arara: biber
% arara: pdflatex
\documentclass{article}

\usepackage[
    backend = biber,
    style = authoryear-comp,
    maxcitenames = 2,
    maxbibnames = 5,
    sorting = nyt,
    dashed=false,
    uniquename = false,
    uniquelist = false
]{biblatex}

\begin{filecontents*}{\jobname.bib}
    @book{
        newton,
        title = {Infinitesimal Analysis},
        author = {Newton, I. and Leibniz, G. W. and Euler, L.},
        year = {1600}
    }
\end{filecontents*}

\addbibresource{biblatex-examples.bib}
\addbibresource{\jobname.bib}
\DeclareNameFormat{author}{
\usebibmacro{name:last}{#1}{#3}{#5}{#7}
}

%\usepackage[ngerman]{babel}
\usepackage{etoolbox}
\patchcmd{\finalnamedelim}{\finalandcomma}{}{}{}%Remove the comma
\begin{document}
\cite{newton,companion}
\printbibliography
\end{document}