覆盖西班牙语 APA 中的与号 (&)

覆盖西班牙语 APA 中的与号 (&)

我目前正在努力适应西班牙语的 APA 引用系统。我需要使用“y”或“e”而不是“&”。正如您在 MWE 中看到的那样,尽管使用了西班牙语包,但它仍保留了 &,这是错误的。有什么想法可以解决这个问题吗?

平均能量损失

\documentclass[spanish]{article}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[utf8]{inputenc} 
\usepackage[T1]{fontenc} 
\usepackage[backend=biber,citestyle=authoryear,url=true,backref=bibtex,bibstyle=apa]{biblatex}
\DeclareLanguageMapping{spanish}{spanish-apa}
\setcounter{smartand}{1}
\DefineBibliographyStrings{spanish}{%
    andothers = {et al.},
}
\addbibresource{example.bib}

\begin{filecontents}{example.bib}
@article{AnsariJaffri2014,
author = {Ansari, Komal and Ansari, Sanaullah and Jaffri, Saima},
issn = {1016-9342},
journal = {International Research Journal of Arts and Humanities},
number = {42},
title = {{The Atypical Creative Arts Research Methodology(s): Integrating Practice with Performance}},
volume = {42},
year = {2014}
},
@inproceedings{Lindley2018,
author = {Lindley, Joseph and Coulton, Paul and Akmal, Haider Ali},
booktitle = {{Design as a Catalyst for Change - DRS International Conference 2018}},
doi = {10.21606/drs.2018.327},
month = {jun},
pages = {230--244},
title = {{Turning Philosophy with a Speculative Lathe: Object-Oriented Ontology, Carpentry, and Design Fiction}},
year = {2018}
}
\end{filecontents}

\begin{document}

\textcite{AnsariJaffri2014}
\textcite{Lindley2018}
\printbibliography

\end{document}  

更新

我设法在 Mac 上安装了 biblatex 包。现在我面临一个新问题:

“!未定义控制序列。l.21 \DeclareLanguageMappingSuffix {-apa}?”

答案1

尝试此代码。编译为pdflatex ++ biber+ pdflatexpdflatex

A

&被更改为and,进而将映射到y西班牙语。

\documentclass[spanish]{article}
\usepackage{babel}
\usepackage{csquotes}
%%\usepackage[utf8]{inputenc} % not needed
\usepackage[T1]{fontenc} 

\usepackage[
backend=biber,
sorting=nyt,
citestyle=authoryear,
bibstyle=apa,
maxbibnames=99, %<<<<<
apamaxprtauth=99,%<<<<<
backref,
url=true
]{biblatex}

\DeclareLanguageMapping{spanish}{spanish-apa}
\setcounter{smartand}{1}
\DefineBibliographyStrings{spanish}{%
    andothers = {et al.},
}


%% From https://tex.stackexchange.com/a/534084/161015 <<<<<<<<<<<<<<<<<<<<<<<<<
\DeclareDelimFormat[bib]{finalnamedelim:apa:family-given}{% added <<<<<<<<<<<<<<<<<<<<<<
    \ifthenelse{\value{listcount}>\maxprtauth}
    {}
    {\ifthenelse{\ifcurrentname{groupauthor}\AND%
            \value{liststop}=2}
        {\addspace\bibstring{and}\space}
        {\finalandcomma\addspace\bibstring{and}\space}}}


\addbibresource{example.bib}    

\begin{filecontents}{example.bib}
    @article{AnsariJaffri2014,
        author = {Ansari, Komal and Ansari, Sanaullah and Jaffri, Saima},
        issn = {1016-9342},
        journal = {International Research Journal of Arts and Humanities},
        number = {42},
        title = {{The Atypical Creative Arts Research Methodology(s): Integrating Practice with Performance}},
        volume = {42},
        year = {2014}
    },
    @inproceedings{Lindley2018,
        author = {Lindley, Joseph and Coulton, Paul and Akmal, Haider Ali},
        booktitle = {{Design as a Catalyst for Change - DRS International Conference 2018}},
        doi = {10.21606/drs.2018.327},
        month = {6}, % <<<<<<<<<<<<<<<<<<<<<<<<<<<<<changed
        pages = {230--244},
        title = {{Turning Philosophy with a Speculative Lathe: Object-Oriented Ontology, Carpentry, and Design Fiction}},
        year = {2018}
    }
\end{filecontents}

\begin{document}
    
    \textcite{AnsariJaffri2014}
    \textcite{Lindley2018}
    
    \parencite{AnsariJaffri2014}    
    
    \parencite{Lindley2018} 

    \printbibliography
    
\end{document}  

更新 置于 {article}\listfiles之前 \documentclass[spanish]

这是我在 .log 文件中得到的输出

*File List*
 article.cls    2020/04/10 v1.4m Standard LaTeX document class
  size10.clo    2020/04/10 v1.4m Standard LaTeX file (size option)
   babel.sty    2021/04/26 3.58 The Babel package
 bblopts.cfg    2005/09/08 v0.1 add Arabic and Farsi to "declared" options of babel
 spanish.ldf
csquotes.sty    2021-02-22 v5.2l context-sensitive quotations (JAW)
etoolbox.sty    2020/10/05 v2.5k e-TeX tools for LaTeX (JAW)
  keyval.sty    2014/10/28 v1.15 key=value parser (DPC)
csquotes.def    2021-02-22 v5.2l csquotes generic definitions (JAW)
csquotes.cfg    
 fontenc.sty
biblatex.sty    2020/12/31 v3.16 programmable bibliographies (PK/MW)
pdftexcmds.sty    2020-06-27 v0.33 Utility functions of pdfTeX for LuaTeX (HO)
infwarerr.sty    2019/12/03 v1.5 Providing info/warning/error messages (HO)
   iftex.sty    2020/03/06 v1.0d TeX engine tests
 ltxcmds.sty    2020-05-10 v1.25 LaTeX kernel commands for general use (HO)
kvoptions.sty    2020-10-07 v3.14 Key value format for package options (HO)
kvsetkeys.sty    2019/12/15 v1.18 Key value parser (HO)
  logreq.sty    2010/08/04 v1.0 xml request logger
  logreq.def    2010/08/04 v1.0 logreq spec v1.0
  ifthen.sty    2014/09/29 v1.1c Standard LaTeX ifthen package (DPC)
     url.sty    2013/09/16  ver 3.4  Verb mode for urls, etc.
  blx-dm.def    2020/12/31 v3.16 biblatex localization (PK/MW)
     apa.dbx    2020/08/28 v9.14 APA biblatex style data model
blx-compat.def    2020/12/31 v3.16 biblatex compatibility (PK/MW)
biblatex.def    2020/12/31 v3.16 biblatex compatibility (PK/MW)
standard.bbx    2020/12/31 v3.16 biblatex bibliography style (PK/MW)
     apa.bbx    2020/08/28 v9.14 APA biblatex references style
authoryear.cbx    2020/12/31 v3.16 biblatex citation style (PK/MW)
biblatex.cfg    
l3backend-pdftex.def    2021-03-18 L3 backend support: PDF output (pdfTeX)
 spanish.lbx    2020/12/31 v3.16 biblatex localization (PK/MW)
spanish-apa.lbx    2020/08/28 v9.14 APA biblatex localisation
   expl3.sty    2021-02-18 L3 programming layer (loader) 
blx-case-expl3.sty    2020/12/31 v3.16 expl3 case changing code for biblatex
  xparse.sty    2021-01-09 L3 Experimental document command parser
xparse-2020-10-01.sty  

检查您的系统是否需要更新。

此答案假定您正在使用实现第 7 版 APA 样式的 biblatex-apa 最新版本(至少从 2019-11-23 开始为 v9.0)。

答案2

最后,我找到了问题的解决方案。现在我的参考文献有了适当的风格:

\documentclass[spanish]{article}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[utf8]{inputenc} 
\usepackage[T1]{fontenc} 

\usepackage[backend=biber,citestyle=authoryear,url=true,backref=bibtex,bibstyle=apa]{biblatex}
\DeclareLanguageMapping{spanish}{spanish-apa}
\DefineBibliographyStrings{spanish}{%
    andothers = {et al.},
}
\makeatletter \DefineBibliographyExtras{spanish} {\setcounter{smartand}{1}
\let\lbx@finallistdelim=\lbx@es@smartand \let\lbx@finalnamedelim=\lbx@es@smartand} \makeatother 
\addbibresource{example.bib}

\begin{document}
\textcite{AnsariJaffri2014}
\printbibliography
\end{document}  

相关内容