Biblatex(biblatex-apa 风格)定制:nodate bibstring 和 ampersand

Biblatex(biblatex-apa 风格)定制:nodate bibstring 和 ampersand

我正在尝试使用 来设置我的参考书目Biblatex,并使用 样式biblatex-apa。我的文档是西班牙语。因此,我在序言中设置了包,如下所示:

\usepackage[babel, spanish=quotes]{csquotes}
\usepackage[backend=biber, style=apa,sortlocale=auto]{biblatex}
\DeclareLanguageMapping{spanish}{spanish-apa}

文本中的引用按预期工作。但 \printbibliography 产生以下输出: 在此处输入图片描述

第一个引文中的 & 符号应该是“y”。而 nodate 字符串应该是“sin fecha”。奇怪的是,在spanish-apa.lbx或中american-apa.lbx都没有定义 bibstring nodate。无论如何,在 spanish-apa.lbx 中添加显而易见的内容:

\NewBibliographyString{nodate}

%into the \DeclareBibliographyStrings{ 
nodate           = {{sin\space fecha}{{}s\adddot f\adddot}},

没什么区别。

我准备了一个MWE,在 writeLatex 中在线测试,以调试该nodate问题。在 babel 和 DeclareLanguageMapping 中将英语更改为西班牙语,重现了该问题。

\documentclass[endnotes]{apa6e}
\usepackage[english]{babel}
\usepackage{csquotes} 
\usepackage[style=apa]{biblatex} 
\DeclareLanguageMapping{english}{english-apa}
\usepackage[T1]{fontenc}
\title{A title}
\author{An Author}
\shorttitle{A title}
\authornote{}
\abstract{An abstract}

\begin{filecontents}{apa-test-bib1.bib}
@book{Saussure1995,
Author = {Ferdinand de Saussure},
Origyear = {1916},
Publisher = {Payot},
Title = {Cours de Linguistique G{\'e}n{\'e}rale},
Year = {1995}}

@book{Labov1972,
Address = {Philadelphia},
Author = {William Labov},
Publisher = {University of Pennsylvania Press},
Title = {Sociolinguistic Patterns},
}

\end{filecontents}
\addbibresource{apa-test-bib1.bib}

\begin{document}

This is some text. \cite{Saussure1995,Labov1972}
\printbibliography
\end{document}

答案1

biblatex-apa 中未实现西班牙语的长日期 [更新:现在它们已经存在;见下文]。以下示例修改了 spanish-apa.lbx 中首次出现的相应定义,以解决包中的一个错误,该错误导致 nodate 标签出现而不是实际的本地化字符串。它使牛津逗号消失,& 符号被翻译,nodate 显示为“sin fecha”,长日期在引文和参考文献中正确显示。它引用了两次作品来展示该et al功能。

\documentclass{article}
\usepackage{polyglossia}
\setdefaultlanguage{spanish}
\usepackage{csquotes}
\usepackage{shortvrb}
\usepackage{fontspec}
% Biblatex-APA
\usepackage[backend=biber,style=apa]{biblatex}
\DeclareLanguageMapping{spanish}{spanish-apa}

\DefineBibliographyStrings{spanish}{%
nodate = {sin fecha}
}

\AtBeginDocument{\renewcommand*{\finalandcomma}{}}

% Evitar ampersand en referencias con varios autores. CITAS
\AtEveryCitekey{\renewcommand*{\finalnamedelim}{%
    \ifthenelse{\value{listcount}>\maxprtauth}
      {}
      {\ifthenelse{\value{liststop}>2}
         {\finalandcomma\addspace\bibstring{and}\space}
         {\addspace\bibstring{and}\space}}}}

% Evitar ampersand en referencias con varios autores. REFERENCIAS
\AtBeginBibliography{%
\renewcommand*{\finalnamedelim}{%
    \ifthenelse{\value{listcount}>\maxprtauth}
      {}
      {\ifthenelse{\value{liststop}>2}
         {\finalandcomma\addspace\bibstring{and}\space}
         {\addspace\bibstring{and}\space}}}
  \protected\def\mkbibdateapalongextra#1#2#3{%   %%% #1 #2 #3 = año mes día
    \iffieldundef{#1}%                           %%% ¿definido el año?
      {}%
      {\iffieldbibstring{#1}{\biblcstring{\thefield{#1}}}{\thefield{#1}}\printfield{extrayear}}%
    \iffieldundef{#2}%                           %%% mes?
      {}%
      {\iffieldundef{#1}%                        %%% ¿definido el año?
        {}%
        {\addcomma\addspace}%                    %%% , [día]
    \iffieldundef{#3}%                           %%% ¿definido el día?
      {}%
      {\ifthenelse{\iffieldundef{#2}\OR\iffieldundef{#1}}% %falta mes o año
        {}%
        {\stripzeros{\thefield{#3}}\addspace de\addspace}}%    % <día> "de"
       \mkbibmonth{\thefield{#2}}%              %%% <mes>
  }}%                
  \protected\def\mkbibdateapalongmdy#1#2#3{%   %%% #1 #2 #3 = año mes día
    \iffieldundef{#3}%                         %%% ¿definido el día?
      {}%
      {el\addspace\stripzeros{\thefield{#3}}}% %%% HAY DÍA.  el [día]
    \iffieldundef{#2}%                         %%% ¿definido el mes?
      {\addspace{en}\addspace}%                %%% NO HAY MES. en [año]
      {\iffieldundef{#3}%                      %%% ¿definido el día?
        {en\addspace}%                         %%% NO HAY DÍA. en [mes]
        {\addspace{de}\addspace}%              %%% HAY DÍA Y MES. [día] de [mes]
       \mkbibmonth{\thefield{#2}}{\addspace{de}\addspace}}% %%% [mes] de [año]
    \iffieldundef{#1}%                         %%% ¿definido el año?
      {}%
      {\iffieldundef{#2}%                      %%% ¿definido el mes?
        {}%
        {\addspace}%                           %%% HAY AÑO Y MES.
       \thefield{#1}}}}%                       %%% año.  

\begin{filecontents}{apa-minimal.bib}
@ONLINE{paconet1,
    TITLE = {Referencia online; fecha de URL con año, mes y día},
    URL = {http://paconet.org},
    ORGANIZATION = {Paconet Corporation},
    URLDATE = {2001-09-15},
    DATE = {2001-09-15},
}
@BOOK{varios5,
  AUTHOR = {Benito Botín and Carlos Cabrero and Damián Domínguez and Ernesto Enríquez and Fernando Fernández},
  TITLE = {Un libro sin fecha y con cinco autores},
}
\end{filecontents}

\addbibresource{apa-minimal.bib}

\begin{document}
\textcite{paconet1,varios5}

\textcite{paconet1,varios5}

\printbibliography
\end{document}

上述示例的结果显示了 biblatex-apa 缺陷的解决方案

相关内容