- Notifications
You must be signed in to change notification settings - Fork2
LaTeX Package, a Style Checker of .bib Files: it emits warnings in the TeX log if any issues are found
License
yegor256/bibcop
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This LaTeX package checks the quality of your.bib
file andemits warning message if any issues are found. You may also likebiblint andbiblatex-check tools —they doalmost the same but from the command line.
Readthis blog post, in order to understandthe motivation behind this package.
First,install it fromCTANand then use in the preamble(if you useBibTeX, for example):
\documentclass{article}\usepackage{bibcop}\begin{document}\bibliographystyle{plain}\bibliography{main}\end{document}
You can also add it as a GitHub Action to yourGitHub repository, with the help ofbibcop-action.
Otherwise, you can downloadbibcop.sty
and add to your project (together withbibcop.pl
!).
You can also downloadbibcop.pl
and use it as a command line toolto check your.bib
files and to auto-fix them(you should havePerl installed):
perl bibcop.pl --fix main.bib> fixed.bib
This command will read themain.bib
file andcreatefixed.bib
, which will have the fixed and properlyformatted content (well, to some extent).Be careful, all comments will be removed.
You can also make changes inline, not creating a new file:
perl bibcop.pl --fix --in-place main.bib
If you install the package usingtlmgr
,you should be able to usebibcop
directly, without thenecessity to mention Perl:
tlmgr install bibcopbibcop --help
If you usepre-commit, simply add this to your config:
-repo:https://github.com/yegor256/bibcoprev:0.0.31hooks: -id:bibcopargs:[]
If you want to contribute yourself, make a fork, then create a branch,then runl3build ctan
in the root directory. It should compileeverything without errors. If not, submit an issue and wait.Otherwise, make your changes and then runl3build ctan
again.If the build is still clean, submit a pull request.
If you want to add a new check, add it as a Perl subroutineto thebibcop.pl
file. Don't forget to add a test to one of the testfiles that stay in theperl-tests/
directory.When ready, run this, in order to check that all tests pass:
perl tests.pl
You should see theGREAT!
message.
Copyright (c) 2022-2025 Yegor Bugayenko, MIT License
About
LaTeX Package, a Style Checker of .bib Files: it emits warnings in the TeX log if any issues are found