It is in no way discouraged to comment any files you might have written. What you came across is a slight discrepancy in the handling of comments, or if you will a disagreement about what constitutes a comment.
According to btxdoc
, §4, item 7, p. 13
BibTeX allows in the database files any comment that's not within an entry. If you want to comment out an entry, simply remove the @
character preceding the entry type.
That means that anything that is not within a @<entrytype>{...}
entry block has to be considered a comment by the parser.
Furthermore, in §4, item 14, p. 14, we find
LaTeX's comment character %
is not a comment character in the database
files.
So technically (and legally, if you will) your block with book2
is indeed a comment.
Still, Biber warns about it mentioning "characters of junk". You can safely ignore this warning just as Biber ignores these characters. Instead you can see these warning as an additional service by Biber to warn you that something might be wrong. Sometimes people genuinely forget a @
or have some real junk in their files.
Contrary to the excerpt quoted above, Biber considers lines starting with %
to be real comments and does not issue junk character warnings in these cases.
So if you are OK with using %
at the beginnings of comments in your .bib
file, Biber will not bother you about them again, even though technically the lines outside a @
block should be considered comments without the %
as well.
As biber considers %
a real comment sign, it handles commented entries differently to BibTeX. An entry starting with
%@article{A,
will be ignored by biber (and the rest will junk), while bibtex will still see it.
Since the %
is not considered a comment character by BibTeX, but is passed through verbatim to LaTeX (where it will be recognized as a comment with possibly catastrophic results), you should better not use the %
inside an entry. (Outside it doesn't matter as it is ignored along with all the rest).
The entry
@ARTICLE{auchunbekannt,
title = {Beispielaufsatz},
journal = {Zeitschrift},
year = {2001},
%volume = {7},
pages = {1--35, 99--291},
annotation = {lorem},
}
will compile just fine with Biber (you will not get a volume
field in the output of course), but BibTeX will throw an error. So a safer way to exclude a field is to rename it:
xxxvolume = {7},
Similarly,
@article{B,
author = {Uthor, A.}, % her full name is Anne Uthor
journal = {Journal 1},
title = {Title},
year = {2015},
}
will compile fine with Biber, but will throw the error
You're missing a field name---line 6 of file biblio.bib
: author = {Uthor, A.},
: % her full name is Anne Uthor
I'm skipping whatever remains of this entry
with BibTeX.
On the other hand
@article{A,
author = {Author, A.},
journal = {Journal 1},
title = {Title %1
},
year = {2014},
}
can work with BibTeX, but with biber you would get this in the bbl:
\field{title}{Title %1}
and this leads to a runaway argument.
If your aim is an annotated bibliography, you can also annotate an entry inside the entry in a field unknown to Biber/BibTeX, this leaves the option of – if need be – allowing an output in the document. biblatex
even has an annotation
field that is optionally shown by the reading
style, all other standard styles ignore it, it is passed to the .bbl
file, though. A new field such as myann
will be completely ignored by Biber and BibTeX and thus can be filled with your comments as well.
% Copyright (C) 1988, 2010 Oren Patashnik.
.btxdoc
, p. 13: "BibTeX allows in the database files any comment that’s not within an entry. If you want to comment out an entry, simply remove the@
character preceding the entry type." Which seems to quite clearly indicate that everything that is not a proper entry starting with@
has to be seen as comment. Remember, though, that Biber does not give you an error, but only a warning. See it as a solicitous service by Biber. ...specann = {}
and fill it up with whatever you like. I often, though not systematically, add library call numbers to my entries for this reason.