我用biblatex-apa
它来格式化引文和参考文献列表。我想在使用引文命令时将&
分隔符更改为,例如:and
parencite
\parencite{ref1}
-->(作者和作者,2013 年)\parencite{ref2}
-->(作者、作者和作者,2014 年)
我已经使用以下命令成功地重新声明了参考列表中的分隔符:
\AtBeginBibliography{\renewcommand*{\finalnamedelim}{%
\ifthenelse{\value{listcount}>\maxprtauth}
{}
{\ifthenelse{\value{liststop}>2}
{\finalandcomma\addspace{}and\space}
{\addspace{}and\space}}}}
但不知道如何更改引文分隔符。如有任何想法或建议,我将不胜感激。
梅威瑟:
\documentclass{scrbook}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[american]{babel}
\usepackage[babel]{csquotes}
\usepackage{filecontents}
\usepackage[backend=biber,style=apa,hyperref]{biblatex}
\DeclareLanguageMapping{american}{american-apa}
\begin{filecontents}{mybib.bib}
@article{ref1,
author = {Guyon, Isabelle and Elisseeff, Andr\'{e}},
journal = {The Journal of Machine Learning Research},
pages = {1157--1182},
title = {{An introduction to variable and feature selection}},
volume = {3},
year = {2003}
}
@book{ref2,
author = {Michel Goossens and Frank Mittelbach and Alexander Samarin},
title = {The LaTeX Companion},
year = {1993},
publisher = {Addison-Wesley},
address = {Reading, Massachusetts}
}
\end{filecontents}
\addbibresource{mybib.bib}
\begin{document}
Lorem ipsum dolor sit amet \parencite{ref1}, consectetur adipiscing elit \parencite{ref2}.
\printbibliography
\end{document}
答案1
较新版本的
biblatex
/biblatex-apa
具有更复杂的分隔符机制。此解决方案不再适用,请参阅使用 biblatex 的作者分隔符。
biblatex-apa
经常更改\finalnamedelim
,因此最好的解决方案似乎是恢复每个引用和参考书目的开头所需的分隔符定义。
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[american]{babel}
\usepackage[babel]{csquotes}
\usepackage[backend=biber,style=apa,hyperref]{biblatex}
\DeclareLanguageMapping{american}{american-apa}
\addbibresource{biblatex-examples.bib}
\DefineBibliographyExtras{english}{\renewcommand*{\finalandcomma}{}}
\AtEveryCitekey{%
\renewcommand*{\finalnamedelim}{%
\ifthenelse{\value{listcount}>\maxprtauth}
{}
{\ifthenelse{\value{liststop}>2}
{\finalandcomma\addspace\bibstring{and}\space}
{\addspace\bibstring{and}\space}}}}
\AtBeginBibliography{%
\renewcommand*{\finalnamedelim}{%
\ifthenelse{\value{listcount}>\maxprtauth}
{}
{\ifthenelse{\value{liststop}>2}
{\finalandcomma\addspace\bibstring{and}\space}
{\addspace\bibstring{and}\space}}}}
\begin{document}
Lorem ipsum dolor sit amet \parencite{companion}, consectetur adipiscing elit \parencite{baez/article}.
\printbibliography
\end{document}