我正在尝试编辑biblatex
样式的参考书目样式apa
。在 Google 的帮助下,我几乎完成了,但还有一些调整需要完成。我的样式如下所示:
Arlot, S. / Celisse, A. (2010):模型选择的交叉验证程序调查,载于:统计调查,4(1), 40-79。
但必须看起来像:
Arlot,S. / Celisse,A.(2010):模型选择的交叉验证程序调查,内容如下:统计调查,4(1),40-79。
- 作者必须大胆
- 我需要非斜体的卷号
- 如果可能的话,标题和期刊之间有一个“in”会很好。
这是我的代码:
\usepackage[backend=biber,style=apa, maxcitenames=4,natbib=true,doi=false]{biblatex}
\usepackage{letltxmacro}
\usepackage{csquotes}
\usepackage{xpatch}
\LetLtxMacro{\cite}{\citet} %Year in brackets
\renewcommand{\labelnamepunct}{\addcolon\space} %Colon after year
% Slash instead of comma (und &)
\DeclareDelimFormat*{multinamedelim}{\,/\,}
\DeclareDelimFormat*{finalnamedelim}{}
\DeclareDelimAlias{finalnamedelim}{multinamedelim}
\DeclareDelimFormat*{finalnamedelim:apa:family-given}{}
\DeclareDelimAlias{finalnamedelim:apa:family-given}{multinamedelim}
该.bib
文件包含:
@article{Arlot.2010,
author = {Arlot, Sylvain and Celisse, Alain},
year = {2010},
title = {A survey of cross-validation procedures for model selection},
pages = {40--79},
volume = {4},
issn = {1935-7516},
journal = {Statistics Surveys},
doi = {10.1214/09-SS054}}
答案1
从您目前得到的输出中,我推断您正在使用 的旧版本,biblatex-apa
该版本根据第 6 版 APA 格式生成引文和参考书目条目。目前,biblatex-apa
生成第 7 版 APA 格式,而第 6 版 APA 格式可从 的 获得biblatex-apa6
。style=apa6
这就是 MWE 使用 的原因style=apa6
。
\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[backend=biber, style=apa6, maxcitenames=4,natbib=true, doi=false]{biblatex}
\DeclareDelimFormat[bib]{nametitledelim}{\addcolon\space}
\DeclareDelimFormat*{multinamedelim}{/}
\DeclareDelimFormat*{finalnamedelim}{}
\DeclareDelimAlias{finalnamedelim}{multinamedelim}
\DeclareDelimFormat*{finalnamedelim:apa:family-given}{}
\DeclareDelimAlias{finalnamedelim:apa:family-given}{multinamedelim}
% 1: Bold names
\renewbibmacro*{author}{%
\printtext[bold]{%
\ifnameundef{author}
{\usebibmacro{labeltitle}}
{\printnames[apaauthor][-\value{listtotal}]{author}%
\setunit*{\addspace}%
\printfield{nameaddon}%
\ifnameundef{with}
{}
{\setunit{}\addspace\mkbibparens{\printtext{\bibstring{with}\addspace}%
\printnames[apaauthor][-\value{listtotal}]{with}}
\setunit*{\addspace}}}%
\newunit\newblock%
\usebibmacro{labelyear+extradate}}}
\renewbibmacro*{editorinauthpos}{%
\printtext[bold]{%
\global\booltrue{bbx:editorinauthpos}%
\printnames[apaauthor][-\value{listtotal}]{editor}%
\setunit{\addspace}%
\ifnameundef{editor}
{}
{\printtext[parens]{\usebibmacro{apaeditorstrg}{editor}}%
% need to clear editor so we don't get an "In" clause later
% But we also need to set a flag to say we did this so we
% don't lose sight of the fact we once had an editor for
% various year placement tests
\clearname{editor}%
\setunit{\adddot\addspace}%
\usebibmacro{labelyear+extradate}%
\setunit{\adddot\addspace}}}}
% 2: plain volume numbers
\DeclareFieldFormat[article,periodical]{volume}{\apanum{#1}}
% 3: in for @articles
\usepackage{xpatch}
\xpatchbibdriver{article}
{\usebibmacro{journal+issuetitle}}
{\usebibmacro{in}%
\usebibmacro{journal+issuetitle}}
{}{}
\renewbibmacro*{in}{%
\ifbool{bbx:in}%
{}%
{\global\booltrue{bbx:in}%
\setunit{\addcomma\space}%
\bibstring{in}%
\printunit{\intitlepunct}}}
\begin{filecontents}{\jobname.bib}
@article{Arlot.2010,
author = {Arlot, Sylvain and Celisse, Alain},
year = {2010},
title = {A survey of cross-validation procedures for model selection},
pages = {40--79},
volume = {4},
issn = {1935-7516},
journal = {Statistics Surveys},
doi = {10.1214/09-SS054},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\cite{Arlot.2010}
\printbibliography
\end{document}
需要注意的是,修改起来可能相当棘手biblatex-apa
,biblatex-apa6
因为这些样式是专门为符合有时复杂的 APA 指南而编写的,并且通常不打算超出 APA 要求进行定制。