biblatex 中没有名字

biblatex 中没有名字

使用 Biblatex,如何在参考书目中打印作者姓名(不带名字)?

我明白了

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

但我想要

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

% 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}

答案1

您可以使用\DeclareNameFormat来仅使用姓氏。finalandcomma仅在适用时才会出现。例如,如果ngerman 已加载,则不会设置逗号。您可以使用包 删除逗号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}

相关内容