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.. – Ulrike Fischer Aug 13 '15 at 16:07btxdoc, 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. ... – moewe Aug 14 '15 at 11:41%is treated as a comment character by Biber, whilebtxdocsays: "LaTeX's comment character%is not a comment character in the database files.", point 14, p. 14. But even Oren Patashnik seems to have succumbed to using%as a comment character in the.bibfile, as UlrikeFischer points out above, though one could argue that the use of%was merely superfluous. – moewe Aug 14 '15 at 11:42biberreacts to it. Suppose I'd like to have an annotated BibTeX database. What would be the proper or recommended way of doing it? – n.r. Aug 14 '15 at 13:07@or that your automatic.bibexporter messed up, or your downloaded source is malformed etc... If you are sure what you have there is no mistake or oversight on your part, but that we deal with a mere comment, you are of course free to disregard the warning entirely, thank Biber for kindly reminding you, and move on. – moewe Aug 14 '15 at 14:02%in front so Biber ignores it. You can add the comment into a special field in the proper entry, so it can be printed if you wished. There is really a lot you can do.... – moewe Aug 14 '15 at 14:07.bibfile 100% by the book, it issues a warning where the book, i.e.btxdocspeaks of a comment, which we normally expect not to trigger a warning. Now your question seems to be: Do I ignore the warning because technically (i.e. de jure) I'm in the right. Or do I placate Biber by changing the format of my comments and thus concede your right to use comments in exactly that way. – moewe Aug 14 '15 at 14:22specann = {}and fill it up with whatever you like. I often, though not systematically, add library call numbers to my entries for this reason. – jon Aug 14 '15 at 14:54keywordsin the entries. – Johannes_B Aug 14 '15 at 15:39