Last active
May 10, 2023 14:37
-
-
Save tzelleke/e4d39a6b94f2a667baab716583dd61c4 to your computer and use it in GitHub Desktop.
Clean up your bibliography for journal submission. List unused references in bibtex bibliography
This file contains 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
BIBTEXFILE=bibliography.bib | |
AUXFILE=manuscript.aux | |
REFS=$(mktemp -t $$_refs_XXXX) || exit 1 | |
CITED=$(mktemp -t $$_cited_XXXX) || exit 1 | |
egrep '^@' $BIBTEXFILE | \ | |
sed 's/@.*{//' | \ | |
sed 's/,$//' | \ | |
sort >$REFS | |
egrep -e '^\\citation' $AUXFILE | \ | |
sed 's/^.*{//' | \ | |
sed 's/}$//' | \ | |
sed 's/,/\n/g' | \ | |
sort | \ | |
uniq >$CITED | |
echo "**Unused references in ${BIBTEXFILE}**" | |
diff --old-line-format=%L --new-line-format= --unchanged-line-format= $REFS $CITED | |
echo "" | |
echo "**Missing citations**" | |
diff --old-line-format=%L --new-line-format= --unchanged-line-format= $CITED $REFS | |
echo "" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
List unused/missing references in/from your BibTeX file
When you need to "clean up" .bib for submission to the journal:
bibtex <your-manuscript>
first to generate .aux fileExample output:
Unused references in bibliography.bib
Barducci2011Metadynamics
Basran2003H
Car1985Unified
Cleland1982Use
Hay2008Atomistic
Hay2008Incorporation
Hay2009Barrier
Hay2009Structural
Hedison2015Real
Hoeven2015Does
Klinman2009Integrated
Klinman2015Dynamically
Knapp2002Environmentally
Laio2002Escaping
Leferink2015Towards
Luk2013Unraveling
Nagel2009Century
Quhe2015Path
Roux1995Calculation
Sen2010Enzymatic
Swiderek2014Heavy
Warshel2016Perspective
Missing citations
apsrev41Control
REVTEX41Control