plk / biblatex-apa

APA style for BibLaTeX
90 stars 48 forks source link

Portuguese mapping is funny with polyglossia #58

Closed nunocasteleira closed 5 years ago

nunocasteleira commented 6 years ago

I'm able of producing a bibliography with biblatex and the apa style, but without getting the warning below.

Package biblatex Warning: File 'portuges-apa.lbx' not found!
    Ignoring mapping 'portuges' -> 'portuges-apa'

I think that this problem exists because biblatex-apa is correctly naming its file to portuguese-apa.lbx but because of an ancient orthographic error, from the 80s, the babel and now polyglossia packages are calling the portuges files.

nunocasteleira commented 6 years ago

I'm using these options:

\usepackage[backend=biber,style=apa,language=portuguese,hyperref=true,backref=true]{biblatex}
%\urlstyle{tt} % I know that URLs in apa style are in roman, but the appeal is bigger with monofonts
\DeclareLanguageMapping{portuguese}{portuguese-apa}
\DefineBibliographyStrings{portuguese}{%
bibliography = {Referências Bibliográficas},% replace "references" with "bibliography"
}
nunocasteleira commented 6 years ago

No news about this?

plk commented 5 years ago

Can you ask this in tex.stackexchange.com? This is not specifically a biblatex-apa problem.

moewew commented 5 years ago

I did not test anything for lack of a proper example document (please always try to include a full example document that one can run to reproduce the issue if you report possible bugs with LaTeX packages, see https://tex.meta.stackexchange.com/q/228/35864), but it is a known problem that polyglossia does not work together smoothly with biblatex. I believe that some of the problems we are facing can only be solved on the polyglossia side, but there has been very little development there in the last months (maybe even years). If not absolutely necessary I suggest to use babel instead of polyglossia. babel is maintained and is being developed actively, plus it usually works better with biblatex and some other language-sensitive packages.

That said, the problem could probably be solved on the biblatex-apa side like it was solved in biblatex. Create a portuges-apa.lbx that inherits from portuguese-apa.lbx. Cf. https://github.com/plk/biblatex/blob/dev/tex/latex/biblatex/lbx/portuges.lbx and https://github.com/plk/biblatex/blob/dev/tex/latex/biblatex/lbx/portuguese.lbx.

A user could avoid this problem with an explicit \DeclareLanguageMapping{portuges}{portuguese-apa}.

\documentclass{article}
\usepackage{polyglossia}
\setdefaultlanguage{portuges}
\usepackage{csquotes}
\usepackage[backend=biber,style=apa]{biblatex}
\DeclareLanguageMapping{portuges}{portuguese-apa}

\addbibresource{biblatex-examples.bib}

\begin{document}
\cite{sigfridsson}
\printbibliography
\end{document}