I would like to suppress the annotation field from the .bbl file using biblatex. I often use the annotation field to write down notes about a given paper, which can be a problem if I happen to use a LaTeX command such as % in the annotation field. Having something like % in the annotation field does not cause any issues in the .bib file, but having it in the .bbl file causes a failure to compile. I tried to follow the suggestions in Is it possible to suppress a specific field from bibtex .bbl in biblatex?, but these did not work for me.
Here is my minimal working example:
\documentclass[12pt]{article}
\usepackage{biblatex}
\begin{filecontents*}{mwe.bib}
@article{Doe.J-1979a,
Annote = {10 % strain},
Author = {John Doe},
Date-Added = {2020-08-27 10:54:17 -0600},
Date-Modified = {2020-08-27 12:03:22 -0600},
Journal = {Journal of LaTeX Issues},
Title = {Problematic Reference Title},
Year = {1979}}
\end{filecontents*}
\addbibresource{mwe.bib}
\AtEveryBibitem{\clearfield{annotation}}
\DeclareSourcemap{
\maps[datatype=bibtex, overwrite]{
\map{
\step[fieldset=annotation, null]
}
}
}
\begin{document}
\textcite{Doe.J-1979a}
\printbibliography
\end{document}
This creates the following .bbl file
\begingroup
\makeatletter
\@ifundefined{[email protected]}
{\@latex@error
{Missing 'biblatex' package}
{The bibliography requires the 'biblatex' package.}
\aftergroup\endinput}
{}
\endgroup
\refsection{0}
\datalist[entry]{nty/global//global/global}
\entry{Doe.J-1979a}{article}{}
\name{author}{1}{}{%
{{hash=bd051a2f7a5f377e3a62581b0e0f8577}{%
family={Doe},
familyi={D\bibinitperiod},
given={John},
giveni={J\bibinitperiod}}}%
}
\strng{namehash}{bd051a2f7a5f377e3a62581b0e0f8577}
\strng{fullhash}{bd051a2f7a5f377e3a62581b0e0f8577}
\strng{bibnamehash}{bd051a2f7a5f377e3a62581b0e0f8577}
\strng{authorbibnamehash}{bd051a2f7a5f377e3a62581b0e0f8577}
\strng{authornamehash}{bd051a2f7a5f377e3a62581b0e0f8577}
\strng{authorfullhash}{bd051a2f7a5f377e3a62581b0e0f8577}
\field{sortinit}{D}
\field{sortinithash}{2ef1bd9a78cc71eb74d7231c635177b8}
\field{labelnamesource}{author}
\field{labeltitlesource}{title}
\field{annotation}{10 % strain}
\field{journaltitle}{Journal of LaTeX Issues}
\field{title}{Problematic Reference Title}
\field{year}{1979}
\endentry
\enddatalist
\endrefsection
\endinput
As you can see, the %
messes up the closing bracket in \field{annotation}{10 % strain}
.
Annote
not annotation.Annote
field in the .bib file gets converted to anannotation
field in the .bbl file. I have updated my original post to show this.annotation
withannote
in the definition of the step of the\DeclareSourcemap
instruction, the annotation is ignored (nullified) and it will not appear in thebbl
file.