参考书目中的等人和完整作者

参考书目中的等人和完整作者

我目前正在使用以下选项biblatex

\usepackage[backend=biber,style=authoryear-ibid,maxcitenames=2, maxbibnames=9, uniquelist=false, uniquename=init]{biblatex}

具体来说,超过 2 位作者的引文显示为 Chomsky et al. (1957a)。但参考书目会列出完整作者的相关引文:

乔姆斯基,诺姆,威廉·拉波夫和唐纳德·克努斯 (1957a)。. 海牙:Mouton。

读者可以解码哪个参考文献是哪个,但这并不容易。我知道我可以使用maxbibnames=2,但我不想忽略参考书目中的其他作者。我想要的是:

Chomsky 等人 (1957a)。Chomsky Noam、William Labov 和 Donald Knuth。. 海牙:Mouton。

梅威瑟:

\begin{filecontents}{\jobname.bib}  
@book{Chomsky1957a,
    Address = {The Hague},
    Author = {Noam Chomsky and William Labov and Donald Knuth},
    Publisher = {Mouton},
    Title = {Syntactic Structures},
    Year = {1957},
}

@book{Chomsky1957b,
    Address = {The Hague},
    Author = {Noam Chomsky and William Labov and Donald Knuth},
    Publisher = {Mouton},
    Title = {B},
    Year = {1957},
}

@book{Chomsky1957c,
    Address = {The Hague},
    Author = {Noam Chomsky and William Labov and Leslie Lamport},
    Publisher = {Mouton},
    Title = {C},
    Year = {1957},
}
\end{filecontents}
\documentclass{scrreprt}
\usepackage[backend=biber,style=authoryear-ibid,maxcitenames=2, maxbibnames=2, uniquelist=false, uniquename=init]{biblatex}



\addbibresource{\jobname.bib}

\addbibresource{biblatex-examples.bib}

\begin{document}
A.\footcite{Chomsky1957a}

B\footcite{Chomsky1957b}

C\footcite{Chomsky1957c}

\printbibliography
\end{document}

答案1

总体思路是受到在参考书目条目开头添加 [AuthorYear] 块

然而,我们只希望在引用中有“et al.”时有引言,以便能够检查我们是否需要

\newtoggle{bbx:dowehavemorenames}
\DeclareNameFormat{dowehavemorenames}{%
  \ifboolexpr{
    test {\ifnumequal{\value{listcount}}{\value{liststop}}}
    and
    test \ifmorenames
  }
    {\global\toggletrue{bbx:dowehavemorenames}}
    {\global\togglefalse{bbx:dowehavemorenames}}}

进而

\newcounter{mymaxcitenames}
\AtBeginDocument{%
  \setcounter{mymaxcitenames}{\value{maxnames}}%
}

\renewbibmacro*{begentry}{%
  \begingroup
    \defcounter{maxnames}{\value{mymaxcitenames}}%
    \printnames[dowehavemorenames]{labelname}%
    \iftoggle{bbx:dowehavemorenames}
      {\printnames{labelname}%
       \setunit{\printdelim{nameyeardelim}}%
       \usebibmacro{date+extrayear}%
       \newunit\newblock}
      {}%
  \endgroup
}

bbx:dowehavemorenames如果切换为真,我们仅打印块。

平均能量损失

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[backend=biber,style=authoryear-ibid, maxcitenames=2, maxbibnames=999, dashed=false, uniquelist=false, uniquename=init]{biblatex}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}  
@book{Chomsky1957a,
    Address = {The Hague},
    Author = {Noam Chomsky and William Labov and Donald Knuth},
    Publisher = {Mouton},
    Title = {Syntactic Structures},
    Year = {1957},
}

@book{Chomsky1957b,
    Address = {The Hague},
    Author = {Noam Chomsky and William Labov and Donald Knuth},
    Publisher = {Mouton},
    Title = {B},
    Year = {1957},
}

@book{Chomsky1957c,
    Address = {The Hague},
    Author = {Noam Chomsky and William Labov and Leslie Lamport},
    Publisher = {Mouton},
    Title = {C},
    Year = {1957},
}
\end{filecontents}

\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}



\newtoggle{bbx:dowehavemorenames}
\DeclareNameFormat{dowehavemorenames}{%
  \ifboolexpr{
    test {\ifnumequal{\value{listcount}}{\value{liststop}}}
    and
    test \ifmorenames
  }
    {\global\toggletrue{bbx:dowehavemorenames}}
    {\global\togglefalse{bbx:dowehavemorenames}}}

\newcounter{mymaxcitenames}
\AtBeginDocument{%
  \setcounter{mymaxcitenames}{\value{maxnames}}%
}

\renewbibmacro*{begentry}{%
  \begingroup
    \defcounter{maxnames}{\value{mymaxcitenames}}%
    \printnames[dowehavemorenames]{labelname}%
    \iftoggle{bbx:dowehavemorenames}
      {\printnames{labelname}%
       \setunit{\printdelim{nameyeardelim}}%
       \usebibmacro{date+extrayear}%
       \newunit\newblock}
      {}%
  \endgroup
}

\begin{document}
\cite{Chomsky1957a,Chomsky1957b,Chomsky1957c,knuth:ct:b,knuth:ct:a,sigfridsson}

\printbibliography
\end{document}

要省略重复的年份,请尝试

\renewbibmacro*{begentry}{%
  \begingroup
    \defcounter{maxnames}{\value{mymaxcitenames}}%
    \printnames[dowehavemorenames]{labelname}%
    \iftoggle{bbx:dowehavemorenames}
      {\printnames{labelname}%
       \setunit{\printdelim{nameyeardelim}}%
       \usebibmacro{date+extrayear}%
       \newunit\newblock}
      {}%
  \endgroup
  \iftoggle{bbx:dowehavemorenames}{\renewbibmacro*{date+extrayear}{}}{}%
}

相关内容