3

I'm trying to set up my bibliography with Biblatex, styled with biblatex-apa. My document is in Spanish language. So I set up the package in the preamble as follows:

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

Citations inside the text works as desired. But \printbibliography produces following output: enter image description here

That ampersand in the first citation should be a "y". And the nodate string should be "sin fecha". The weird thing is that neither in spanish-apa.lbx or american-apa.lbx is defined the bibstring nodate. Anyway, adding to the spanish-apa.lbx the obvious:

\NewBibliographyString{nodate}

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

Does not make any difference.

I've prepared a MWE, tested online in writeLatex, to debug the nodate issue. Changing english to spanish, both in babel and in DeclareLanguageMapping, reproduce the issue.

\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}
8
  • I struggle to reproduce the output you get. Would you mind preparing a MWE? For the "and"/"y" see Change ampersand separator with parencite command in APA style.
    – moewe
    Oct 12, 2014 at 11:42
  • Just added the MWE. A bit long, but I'm using Classicthesis which load a lot of stuff that may interfere (hyperref?). Just changing the original ClassicThesis.tex and classicthesis-config.tex for the ones I provide should be enough to get it running.
    – Pablo B.
    Oct 12, 2014 at 12:52
  • Thanks for the MWE. You could make it way shorter by omitting all of classicthesis-config.tex save for the three lines you added at the top of your question (and the babel call), also a lot of the options you pass to scrreprt have no bearing on the matter whatsoever and could be removed. (This answer in the MWE question has quite some hints on how to make a short and concise MWE.)
    – moewe
    Oct 12, 2014 at 14:31
  • I know it's a bit long, excuse me for that. But I don't know if some package or option loaded interferes with how biblatex processes the citations and bibliography. Besides that, both files are just the default (apart from my modifications) that can be downloaded in the classicthesis ctan page
    – Pablo B.
    Oct 12, 2014 at 14:38
  • By the way, the solution you pointed to solve the ampersand issue works like a charm. Thanks.
    – Pablo B.
    Oct 12, 2014 at 14:38

1 Answer 1

4

Long dates for Spanish are not implemented in biblatex-apa [Update: now they are; see below]. The following example modifies the appropriate definitions first appearing in spanish-apa.lbx to workaround a bug in the package which made the nodate label to appear instead of the actual localised string. It makes the Oxford comma to go away, the ampersand to be translated, the nodate appear as "sin fecha" and long dates to appear correctly in citations and references. It cites works twice to show the et al feature.

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

result of the above example showing workaround to buggy biblatex-apa

4
  • 2
    Well, you should provide some example in order to show the result of your proposition. Mere fragments are not helpful in most cases. Welcome to TeX.SX ...
    – user31729
    Nov 12, 2014 at 14:19
  • I will check. But it seems to be the answer I was looking for, although I managed to do a similar workaround. Thanks Paco.
    – Pablo B.
    Nov 18, 2014 at 19:50
  • These improvements have been merged into the official code, see this page on github.
    – Paco Vila
    Nov 18, 2014 at 21:13
  • Good job @PacoVila. I've marked the answer as correct. Now we have an spanish-apa.lbx that works.
    – Pablo B.
    Nov 21, 2014 at 20:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .