Created
March 9, 2022 15:53
-
-
Save jmbr/67c8458dbc2ee6bbd747fad81c8deb0a to your computer and use it in GitHub Desktop.
Find BibTeX entries that are not referenced from the TeX document files.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [ $# -ge 1 ]; then | |
bibtex_file=$1 | |
else | |
bibtex_file="bibliography.bib" | |
fi | |
awk -F "[{,]" '/^@/ { print $2 }' $bibtex_file \ | |
| while read reference; do | |
grep --quiet --no-messages --max-count=1 --fixed-strings "$reference" *.tex | |
if [ $? -eq 1 ]; then | |
echo $reference; | |
fi; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment