BibLaTeX/Biber:截斷作者列表,但不截斷圖書編輯列表

BibLaTeX/Biber:截斷作者列表,但不截斷圖書編輯列表

我已將maxnamesBibLaTeX 的選項設為,1因為我只想顯示第一作者,然後顯示等人。。然而,對於書籍,我想定義一個專用的maxnames.例如,目前我對 IUPAC 金皮書的引用如下:

IUPAC:「化學術語綱要(「金書」)」。 AD麥克諾特 等人。,編輯。 Blackwell Scientific Publications,牛津,第 2 版,1997 年。

我還想展示第二位(也是最後一位)編輯 A. Wilkinson,而不是截斷清單。到目前為止,我無法找到使用該maxnames選項的確切程式碼。由於我在author巨集和巨集中都沒有看到它editor,所以我認為它在函數中使用,\printnames但我不理解該函數的程式碼。

是否有可能將作者人數與編輯人數分開?


編輯:新增了 MWE

\documentclass{article}

\usepackage{hyperref}

\usepackage[%
    backend = biber,%
    style = trad-abbrv,%
    citestyle = numeric-comp,%
    sorting = nty,%
    minnames = 1,%
    maxnames = 1%
]{biblatex}

\bibliography{references}

\begin{filecontents}{references.bib}
    @book{IUPAC1997,
        address = {Oxford},
        author = {IUPAC},
        doi = {10.1351/goldbook},
        edition = {2},
        editor = {McNaught, A. D. and Wilkinson, A.},
        isbn = {0-9678550-9-8},
        publisher = {Blackwell Scientific Publications},
        title = {{Compendium of Chemical Terminology (the “Gold Book”)}},
        year = {1997}
    }
\end{filecontents}

\begin{document}

This should be cited.\cite{IUPAC1997}

\printbibliography[heading = bibnumbered]

\end{document}

在我的本機文件中,我使用了 bibstyletrad-abbrv並修改了它的部分(引號而不是斜體文字等),但沒有與此問題相關的內容,因此我更喜歡與樣式共享較短的 MWE trad-abbrv

答案1

biblatexmaxnames和選項minnames同樣適用於所有名稱。如果想要對不同類型的不同名稱進行更精細的控制,則需要修改相關的bibmacros。在這種情況下,有幾種不同的方法可以達到所需的結果,但它們具有不同的語義。

下面我們堅持maxnames=1,並只重新定義一個 bibmacro 以editor在標題後面打印更多 s。

\documentclass{article}
\usepackage[
    backend = biber,
    style = trad-abbrv,
    citestyle = numeric-comp,
    sorting = nty,
    minnames = 1,
    maxnames = 1,
]{biblatex}
\usepackage{hyperref}

\renewbibmacro*{byeditor+others}{%
  \ifnameundef{editor}
    {}
    {\printnames[byeditor][-\value{listtotal}]{editor}%
     \setunit{\addcomma\space}%
     \usebibmacro{editorlstr}%
     \clearname{editor}%
     \newunit}%
  \usebibmacro{byeditorx}%
  \usebibmacro{bytranslator+others}}

\begin{filecontents}{\jobname.bib}
@book{IUPAC1997,
  address   = {Oxford},
  author    = {IUPAC},
  doi       = {10.1351/goldbook},
  edition   = {2},
  editor    = {McNaught, A. D. and Wilkinson, A.},
  isbn      = {0-9678550-9-8},
  publisher = {Blackwell Scientific Publications},
  title     = {Compendium of Chemical Terminology (the “Gold Book”)},
  year      = {1997},
}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
This should be cited. \cite{IUPAC1997}

\printbibliography[heading = bibnumbered]
\end{document}

國際純粹和應用化學聯合會。化學術語綱要(“金書”)。 AD McNaught 和 A. Wilkinson,編輯。 Blackwell Scientific Publications,牛津,第 2 版,1997 年。 doi:10.1351/goldbook。

相關內容