How do you validate the correctness of your BiBTeX files? By validate I mean mainly:
- Duplicated keys, and maybe also duplicated entries
- Make sure that all the mandatory fields of each entry (depending on its type) are filled.
- Make sure that it doesn't contain any bad TeX in it. For example, having something like
\emphh{foo bar}
in anote
field.
I found this site which seems to take care of the first item above. AUCTeX/RefTeX
provides bibtex-validate-globally
which seems to test for duplications of key (and strings?)
What other tools do you have/use? I am particularly interested in tools that check a given .bib
file. As mentioned in the comments – it seems like reference managers can provide a solution as well.
I mainly consider BibTeX
and BibLaTeX
as management tool.
Best Answer
I have some
.bib
files, some of them have 1000 lines.To be sure that they are working well I always use this test MWE (package
filecontents
and sample.bib
file added only for a running MWE; delete it and use your own.bib
file please):The sample file includes two errors: key
adams
you will find twice (that gives an error) and in theMathetitle
there is an field missing (that gives a warning).The MWE is build to test a
.bib
file with BibTeX. You have to choose your used bib style (my example uses packagenatbib
withnumbers
). So this MWE shows you the resulting errors and warnings for the given.bib
with BibTeX and perhaps resultingtex
errors.That is my way to be sure there is no
bib
error ortex
error in the.bib
file.