2

The \clearfieldcommand should suppress issue numbers globally in biblatex, but in my MWE below, it only suppressed the issue number in the bibliography, and it ghostly reappears in the footnote. Why is this and how can I suppress the issue number everywhere?

\documentclass{article}
\usepackage[british]{babel}
\usepackage[autostyle]{csquotes}
\usepackage[style=oscola,backend=biber,ibidtracker=true,ibidstyle=lc,giveninits,ecli=true]{biblatex}
\AtEveryBibitem{%
\ifentrytype{article}{
    \clearfield{issue}%
    \clearfield{number}%
}{}}
\addbibresource{mylibrary.bib}
\begin{filecontents}{mylibrary.bib}
@article{VanderMeulen2013,
author = {van der Meulen, Bernd},
doi = {10.3390/laws2020069},
issn = {2075-471X},
journal = {Laws},
number = {2},
pages = {69--98},
title = {{The Structure of European Food Law}},
volume = {2},
year = {2013}
}

\end{filecontents}
\begin{document}
    A sentence.\autocites{VanderMeulen2013}
    
    \printbibliography
\end{document}

an annoyingly wrong footnote

1 Answer 1

2

\AtEveryBibitem applies only to the bibliography. If you need your \clearfields to apply to citations as well, you can use \AtEveryCitekey. But of course that doubles the lines of code you have to write.

\documentclass{article}
\usepackage[british]{babel}
\usepackage[autostyle]{csquotes}
\usepackage[backend=biber,
  style=oscola,
  giveninits,
  ibidtracker=true, ibidstyle=lc,
  ecli=true,
]{biblatex}

\AtEveryBibitem{%
  \ifentrytype{article}
    {\clearfield{issue}%
     \clearfield{number}}
    {}}
\AtEveryCitekey{%
  \ifentrytype{article}
    {\clearfield{issue}%
     \clearfield{number}}
    {}}

\begin{filecontents}{\jobname.bib}
@article{VanderMeulen2013,
  author  = {van der Meulen, Bernd},
  doi     = {10.3390/laws2020069},
  issn    = {2075-471X},
  journal = {Laws},
  number  = {2},
  pages   = {69--98},
  title   = {The Structure of {European} Food Law},
  volume  = {2},
  year    = {2013},
}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
  A sentence.\autocites{VanderMeulen2013}
    
  \printbibliography
\end{document}

In order to completely remove fields from the output I usually prefer a sourcemap solution that deletes the fields when they are read from the .bib file.

\documentclass{article}
\usepackage[british]{babel}
\usepackage[autostyle]{csquotes}
\usepackage[backend=biber,
  style=oscola,
  giveninits,
  ibidtracker=true, ibidstyle=lc,
  ecli=true,
]{biblatex}

\DeclareSourcemap{
  \maps[datatype=bibtex]{
    \map{
      \pertype{article}
      \step[fieldset=number, null]
      \step[fieldset=issue, null]
    }
  }
}

\begin{filecontents}{\jobname.bib}
@article{VanderMeulen2013,
  author  = {van der Meulen, Bernd},
  doi     = {10.3390/laws2020069},
  issn    = {2075-471X},
  journal = {Laws},
  number  = {2},
  pages   = {69--98},
  title   = {The Structure of {European} Food Law},
  volume  = {2},
  year    = {2013},
}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
  A sentence.\autocites{VanderMeulen2013}
    
  \printbibliography
\end{document}

B van der Meulen, ‘The Structure of European Food Law’ (2013) 2 Laws 69.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.