我正在尝试将 apa6 包与该文档的更广泛的版本一起使用:
\documentclass[man,a4paper, english]{apa6}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[style=apa,sortcites=true,sorting=nyt,backend=biber]{biblatex}
\DeclareLanguageMapping{american}{american-apa}
\begin{filecontents}{ref.bib}
@ARTICLE{bradley1990startle,
author = {Bradley, Margaret M and Cuthbert, Bruce N and Lang, Peter J},
title = {Startle reflex modification: Emotion or attention?},
journal = {Psychophysiology},
year = {1990},
month = {11},
day = {3},
volume = {27},
pages = {513--522},
number = {5},
publisher = {Wiley Online Library}
}
\end{filecontents}
\AtEveryBibitem{\clearfield{month}}
\AtEveryBibitem{\clearfield{day}}
\addbibresource{ref.bib}
\title{MWE}
\shorttitle{MWE}
\author{Me}
\affiliation{SO}
\leftheader{Me}
\begin{document}
\maketitle
Some more text before the bibliograpy and a citation \parencite{bradley1990startle} of course.
\printbibliography
\end{document}
但是当我使用 latex 进行编译时出现以下错误:
! Undefined control sequence.
<argument> \mkbibdateapalongextra
{year}{month}{day}\iffieldundef {endyear}{...
当我继续使用 biber main Biber 进行编译时弹出此错误:
INFO - No sort tailoring available for locale 'nl_NL.UTF-8'
在使用 pdflatex 进行最后一次编译后我确实得到了输出,但是参考书目中出现了一些奇怪的文本:
按照主题(Xelatex、Biblatex:biber.exe 无法正常工作(IPC::Run)错误)我曾尝试用 进行编译biber -f main
,但也没有帮助。
我也尝试添加:
\AtEveryBibitem{\clearfield{month}}
\AtEveryBibitem{\clearfield{day}}
这也没有帮助。我还尝试填写日期和月份字段,但即使有这些字段,文本 (yearmonthday) 仍会显示在参考书目中。我该如何摆脱参考书目中的 (yearmonthday) 文本?未定义控制序列的错误是什么意思\mkbibdataapalongextra
?
可以找到所有文件,包括完整日志这里。
答案1
宏\mkbibdataapalongextra
是在语言特定文件等中定义的american-apa.lbx
,austrian-apa.lbx
因此如果这些文件未正确加载,则该宏未定义,从而导致您观察到的问题。
默认情况下,biblatex
不知道加载american-apa
,这就是为什么你需要\DeclareLanguageMapping{american}{american-apa}
。但是,似乎你还需要babel
明确地告诉加载美国。我写“似乎”是因为我没有深入调查,所以我不能说我完全理解相互依赖。但是,以下代码解决了您的问题(我冒昧地简化了您的 MWE):
\documentclass{article}
\usepackage[english, american]{babel}
\usepackage{csquotes}
\usepackage[style=apa,sortcites=true,sorting=nyt,backend=biber]{biblatex}
\DeclareLanguageMapping{english}{american-apa}
\begin{filecontents}{ref.bib}
@ARTICLE{bradley1990startle,
author = {Bradley, Margaret M and Cuthbert, Bruce N and Lang, Peter J},
title = {Startle reflex modification: Emotion or attention?},
journal = {Psychophysiology},
year = {1990},
month = {11},
day = {3},
volume = {27},
pages = {513--522},
number = {5},
publisher = {Wiley Online Library}
}
\end{filecontents}
\addbibresource{ref.bib}
\begin{document}
Some more text before the bibliograpy and a citation \parencite{bradley1990startle} of course.
\printbibliography
\end{document}