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:



    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}}



  \maps[datatype=bibtex, overwrite]{
      \step[fieldset=annotation, null]


This creates the following .bbl file

     {Missing 'biblatex' package}
     {The bibliography requires the 'biblatex' package.}

      \field{annotation}{10 % strain}
      \field{journaltitle}{Journal of LaTeX Issues}
      \field{title}{Problematic Reference Title}

As you can see, the % messes up the closing bracket in \field{annotation}{10 % strain}.

  • 1
    in your example you called your field Annote not annotation. – Ulrike Fischer Aug 27 '20 at 20:17
  • @Ulrike Fischer, thanks for your attention to detail, but I believe I did things correctly. The Annote field in the .bib file gets converted to an annotation field in the .bbl file. I have updated my original post to show this. – Stretch Aug 27 '20 at 23:02
  • If you replace annotation with annote in the definition of the step of the \DeclareSourcemap instruction, the annotation is ignored (nullified) and it will not appear in the bbl file. – Guido Aug 27 '20 at 23:41
  • Hah, that was it! @Guido, if you would submit your suggestion as an answer, I will accept it. – Stretch Aug 28 '20 at 0:32

In the MWE, the .bib file contains the field annote, but in the source map, the step specify annotation as a field. Hence, if in the source map we replace annotation with annote the field containing % will be nullified and it will not appear in the bbl file. Accordingly, the \DeclareSourcemap instruction should look like:

  \maps[datatype=bibtex, overwrite]{
      \step[fieldset=annote, null]

Guido has already given the answer: You need to delete the annote field in your sourcemap. But it may be interesting to know why.

biblatex has some field and type aliases set up for backwards compatibility with some popular BibTeX styles. One such alias relation turns the annote field into annotation. With Biber this alias relation is implemented via a special driver sourcemap defined in biblatex.def (ll. 1305-1337 in v3.15a)

    \step[fieldsource=hyphenation,   fieldtarget=langid]
    \step[fieldsource=address,       fieldtarget=location]
    \step[fieldsource=school,        fieldtarget=institution]
    \step[fieldsource=annote,        fieldtarget=annotation]
    \step[fieldsource=archiveprefix, fieldtarget=eprinttype]
    \step[fieldsource=journal,       fieldtarget=journaltitle]
    \step[fieldsource=primaryclass,  fieldtarget=eprintclass]
    \step[fieldsource=key,           fieldtarget=sortkey]
    \step[fieldsource=pdf,           fieldtarget=file]

This just says to turn every annote Biber finds into annotation. Indeed you could say that internally for biblatex there is only annotation and no annote field. So it is natural to write all code mentioning only annotation and not annote.

The problem you ran into was timing: This driver sourcemap is executed after your user-level simple \DeclareSourcemap. In particular, when your sourcemap is executed, no field names have been renamed yet and the field is still called annote.

One way to resolve the problem is shown in Guido's answer: Delete the annote field, since that's what it is still called when your sourcemap is executed. You may or may not want to delete annotation as well

      \step[fieldset=annote,     null]
      \step[fieldset=annotation, null]

One other way to get around the issue be to execute the annote->annotation mapping already in your sourcemap: So you first map all annotes to annotation and then delete the annotation.

      \step[fieldsource=annote,  fieldtarget=annotation]
      \step[fieldset=annotation, null]

Note that in any case \AtEveryBibitem{\clearfield{annotation}} won't help because the error you get from the % already occurs when the entry data is read from the .bbl file and not when the field is/could be printed in the bibliography. What's more the standard biblatex styles (except for reading) don't show annotation anyway, so the \clearfield wouldn't do anything useful in the MWE.

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.