0

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} ? "

killthepixelnow
  • 454
  • 5
  • 14

2 Answers2

0

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.

Simon Dispa
  • 39,141
  • +1: So there is no configuration out of the box for that, right? – Dr. Manuel Kuehner Feb 04 '22 at 19:26
  • 1
    @Dr. Manuel Kuehner I am just a user, I followed moewe's answer https://tex.stackexchange.com/questions/534073/biblatex-change-to-and-in-bibliography. Using and instead of & will be changed to y in spanish. – Simon Dispa Feb 04 '22 at 19:29
  • Hello, thanks for the quick response. Hmmmm when compiling I get the following error:

    ! Undefined control sequence. l.26 \DeclareDelimFormat [bib]{finalnamedelim:apa:family-given}{% added <<<<<...

    ?

    – killthepixelnow Feb 04 '22 at 22:10
  • @killthepixelnow See the update of the answer. – Simon Dispa Feb 04 '22 at 22:21
  • Sorry, it's not working. What does "\listfiles" do? I put that line of code but nothing happened. Same error. Also, how do I know I'm using "biblatex-apa"? I checked the directory but couldn't find any file named like that. By the3 way, I'm using TeXworks 0.6.5 for Mac – killthepixelnow Feb 04 '22 at 22:29
  • @killthepixelnow \listfiles will list all the files loaded and their version at the end of the log file. biblatex-apa is a package that can be downloaded from CTAN or install in your system the usual way. – Simon Dispa Feb 04 '22 at 22:36
  • Alright, thanks for the information. I'm deeply sorry but don't know how to install that package. This is so frustrating. I found the "biblatex-apa" in CTAN but I don't know what to do with it :( – killthepixelnow Feb 04 '22 at 22:43
  • @killthepixelnow In your system look for apa.bbx, apa.dbx. There in no apa.sty or biblatex-apa.sty – Simon Dispa Feb 04 '22 at 22:44
  • @killthepixelnow In CTAN read biblatex-apa.pdf page 3 to do the manual install after download. Just in case update (before) biblatex. – Simon Dispa Feb 04 '22 at 22:48
  • @killthepixelnow See also https://tex.stackexchange.com/a/361578/161015 – Simon Dispa Feb 04 '22 at 22:52
  • This is too complicated. I've been trying to "install" it without success. I'm giving up :( – killthepixelnow Feb 04 '22 at 23:06
  • That answer doesn't help much. It's 18:00, really early. Wish I could understand more this thing, but it's too confusing. – killthepixelnow Feb 04 '22 at 23:16
  • 2
    @killthepixelnow In general it is not a good idea to install packages manually from CTAN. Packages should be installed, updated and managed through your TeX distribution and its package management system. Your other question https://tex.stackexchange.com/q/632750/35864 suggests you have a TeX live from 2014, if you want current packages you need to install TeX live 2021. – moewe Feb 06 '22 at 07:18
0

Finally, I found the solution to my problems. Now my references have the appropriate style:

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

killthepixelnow
  • 454
  • 5
  • 14