I had difficulties commenting out entries in a .bib file (as opposed to adding free-standing comments). Posts to date on this thread did not address this particular problem.
I'm using Overleaf
). What I observed:
bibtex
looks for entries (@blah
) before it checks if the line starts with a %
(or so I figured).
- but only that line gets processed; if you commented out the entire entry the rest of it (
title=
, etc) is ignored and you end up with errors ('missing field') attributable to @blah
Sheesh.
This doesn't work:
%@article{foo2019,
% ...
% }
This works (replace the @
):
%%article{foo2019,
% ...
% }
I poked around in Overleaf
and found this explanation (note that mine, above, is a bit different):
% is actually not a comment character in .bib files! So, inserting a %
in .bib files not only fails to comment out the line, it also causes
some BibTEX errors. To get BibTEX to ignore a particular field we just
need to rename the field to something that BibTEX doesn’t recognise.
For example, if you want to keep a date field around but prefer that
it’s ignored (perhaps because you want BibTEX to use the year field
instead) write Tdate = {...} or the more human-readable IGNOREdate =
{...}.
To get BibTEX to ignore an entire entry you can remove the @ before
the entry type. A valid reference entry always starts with a @
followed by the entry type; without the @ character BibTEX skips the
lines until it encounters another @.
bibtex
is very focused on @
; biber
apparently respects %
s (but you'd have to use biblatex
). See pointers provided by moewe (in the comments) for other discussion.