
私はとbiblatex
を使用しています。2人以上の著者がいる参考文献の場合、\citeコマンドは次のように出力します。style=authoryear
maxcitenames=2
Erkus ら2010
そして\textciteコマンドは
Erkus ら(2010)
et al.
コマンドに対してのみ、と年の間にカンマを追加したいのですが\cite
(\textcite
コマンドに対しては追加しません)、つまり、
エルカス他、2010
Erkus ら(2010)
\renewcommand*{\nameyeardelim}{\addcomma\space}
単一著者の参照にのみ機能します(この質問を見る) は使用できますが、著者が 2 名を超える参考文献の場合は の省略形として機能しません。 を使用すると引用にコンマが追加されるため、 を再定義しての後にコンマを追加するet al.
ことはしたくありません。\DefineBibliographyStrings
andothers
et al.
\textcite
私は次のことを試しました(この質問を見る) が動作しませんでした:
\renewcommand*{\nameyeardelim}{%
\ifnumgreater{\value{listcount}}{2}{\nameyeardelim}{\addcomma\space}%
\ifnumequal{\value{listcount}}{1}{\nameyeardelim}{\addcomma\space}%
}
答え1
これを実現するには、 fornatbib=true
でオプションを設定します。\usepackage
biblatex
MWE:
\begin{filecontents*}{database.bib}
@inproceedings{erkus_2010,
title = {Title},
booktitle = {Book Title},
date = {2010},
author = {Erkus, Firstname and Lastname, Firstname and Lastname Anotherfirstname}
}
\end{filecontents*}
\documentclass[]{article}
\usepackage{filecontents}
\usepackage[style=authoryear, maxcitenames=2, backend=biber, natbib=true] {biblatex}
\addbibresource{database.bib}
\begin{document}
Cite: \cite{erkus_2010}
Textcite: \textcite{erkus_2010}
\end{document}
これによって次のものが生成されます:
答え2
\renewcommand*{\nameyeardelim}{\addcomma\space}
は、1人の著者を引用するか複数の著者を引用するかに関係なく機能します。 の最近のバージョンでは、 はbiblatex
nameyeardelim
コンテキスト依存の区切り文字であるため、\DeclareDelimFormat
を使って変更する必要があります。
\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[style=authoryear, maxcitenames=2, backend=biber]{biblatex}
\DeclareDelimFormat{nameyeardelim}{\addcomma\space}
\addbibresource{biblatex-examples.bib}
\begin{document}
\cite{sigfridsson,aksin,herrmann,nussbaum}
\textcite{sigfridsson,aksin,herrmann,nussbaum}
\printbibliography
\end{document}
見てみるとblx-natbib.def
では、ここで提案されているのとまったく同じコマンドが使用されていることがわかります。そのため、natbib=true
(アレックス'答え) でも目的のコンマが生成されます。