Biblatex – Suppressing Language Field for English References in Biblatex

biblatexzotero

I'm aware you can use AtEveryBibItem like so:

\AtEveryBibitem{
  \clearlist{language}
}

But this removes the language field from every reference; can you suppress it for English only (or any other specific language) and not in other languages?

Edit: Should have made clear that I'm using the beamer package – so perhaps this has affected something?

Also:


Minimal example:

\documentclass[english, aspectratio = 169, notes]{beamer}
\usepackage[english]{babel}
\usepackage[none]{hyphenat}
\usepackage[style=authoryear, doi=false]{biblatex}
\bibliography{references}
%\AtEveryBibitem{
%  \clearlist{language}
%}

\usepackage{nameref}
\makeatletter
\newcommand*{\currentname}{\@currentlabelname}
\makeatother

\usepackage{pgfpages}
\setbeameroption{show notes on second screen}

\begin{document}

\section{Blah blah blah}
\begin{frame}{Blah 1}

blah blah blah \cite{cited_reference}

\end{frame}


\section{References and further reading}

\begin{frame}[allowframebreaks]{References and further reading}
    \setbeamertemplate{bibliography item}[text]
    \printbibliography
\end{frame}

\end{document}



Output:

Screenshot showing example reference with language code.


Edit 2:

@moewe This is the source of cited_reference:

@article{cited_reference,
    title = {The frame/content theory of evolution of speech production},
    volume = {21},
    issn = {0140-525X, 1469-1825},
    url = {https://www.cambridge.org/core/product/identifier/S0140525X98001265/type/journal_article},
    doi = {10.1017/S0140525X98001265},
    abstract = {ABSTRACT REMOVED AS IS TOO LONG},
    language = {en},
    number = {4},
    urldate = {2021-11-17},
    journal = {Behavioral and Brain Sciences},
    author = {MacNeilage, Peter F.},
    month = aug,
    year = {1998},
    pages = {499--511},
}

It seems like changing en to english in the language field removes the language field. However I have quite a few entries which are en and as they come through automatically from Zotero it would be a pain to change manually.

Is there any way then to exclude these en fields without affecting others?

Best Answer

biblatex has a feature to suppress the output of the language field if the field value coincides with the current document language. This feature (clearlang) is enabled by default.

In order for this feature to work correctly, the language field must be filled with values that biblatex understands. The biblatex documentation says

The language(s) of the work. Languages may be specified literally or as localisation keys. If localisation keys are used, the prefix lang is omissible.

The clearlang feature essentially only works if the language of the work is given via a localisation key (possibly without the lang prefix). All known localisation keys are listed in §4.9.2.18 Language Names of the biblatex documentation.

So for an English work, you need language = {english}, or language = {langenglish}, instead of language = {en}, for this to work.

\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage[backend=biber, style=authoryear]{biblatex}

\begin{filecontents}{\jobname.bib}
@article{cited_reference,
  title    = {The frame/content theory of evolution of speech production},
  volume   = {21},
  doi      = {10.1017/S0140525X98001265},
  language = {english},
  number   = {4},
  journal  = {Behavioral and Brain Sciences},
  author   = {MacNeilage, Peter F.},
  month    = aug,
  year     = {1998},
  pages    = {499--511},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}

\begin{document}
Lorem \autocite{sigfridsson,cited_reference}

\printbibliography
\end{document}

MacNeilage, Peter F. (Aug. 1998). “The frame/content theory of evolution of speech production”. In: Behavioral and Brain Sciences 21.4, pp. 499–511. doi: 10.1017/S0140525X98001265.

If you must keep using language = {en}, you can try one of the following workarounds.

  1. Use a sourcemap to map en to english.

    \DeclareSourcemap{
      \maps[datatype=bibtex]{
        \map{
          \step[fieldsource=language,
                match=\regexp{\Aen\Z},
                replace={english}]
        }
      }
    }
    
  2. Use \DeclareRedundantLanguages to tell biblatex that en is redundant for English languages.

    \DeclareRedundantLanguages{en}{english,american,british,
      canadian,australian,newzealand,USenglish,UKenglish}
    
Related Question