Overriding the ampersand (&) in Spanish APA

ampersandapa-stylespanish

I'm currently struggling with the APA citation system in Spanish. I need to use "y" or "e" instead of "&". As you can see in my MWE, in spite of using the Spanish package it retains the &, which is wrong. Any idea how I can solve that?

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}  

UPDATE

I managed to install the biblatex package on my Mac. Now I'm facing a new issue:

"! Undefined control sequence.
l.21 \DeclareLanguageMappingSuffix
{-apa}
? "

Best Answer

Try this code. Compile as pdflatex + biber + pdflatex + pdflatex.

a

The & will be changed to and, which in turn will map to y in Spanish.

\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}  

UPDATE Put \listfiles before \documentclass[spanish]{article}

This is the output I get in the .log file

*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  

Check if your system needs an update.

This answer assumes you are using a current version of biblatex-apa (at least v9.0 from 2019-11-23) that implements 7th-edition APA style.