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}
Pablo B.
  • 537
  • 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 '14 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 '14 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 '14 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 '14 at 14:38
  • By the way, the solution you pointed to solve the ampersand issue works like a charm. Thanks. – Pablo B. Oct 12 '14 at 14:38
  • I was not sure about the ampersand issue in combination with Spanish "y"/"e" smart and, maybe you'll have to investigate, but I don't even know how it works normally and what the output would be. – moewe Oct 12 '14 at 15:17
  • Adding the following lines to the preamble made the trick, although I think it's a kind of bug of biblatex or biblatex-apa... \DeclareLabeldate{% \field{pubstate} \field{date} \literal{s.f.} } – Pablo B. Oct 12 '14 at 21:07
  • That is most certainly a possibility, but there ought to be another way to do this. I have not been able to figure out why this behaviour occurs, if no-one answers in due time, you could bring this issue up at the biblatex-apa bug tracker. – moewe Oct 13 '14 at 04:23

1 Answers1

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

Paco Vila
  • 216
  • 1
  • 7