summaryrefslogtreecommitdiff
path: root/bin/biblatex-tidy.sh
blob: a29632d29f9047cc70115a59395112fe7e93a8d4 (plain)
  1. #!/bin/sh
  2. # tidy BibLaTeX file
  3. # Depends: bibclean
  4. set -eu
  5. INFILE=$1
  6. # workaround: strip JabRef comment that bibclean chokes on
  7. perl -gpe 's/^\@Comment\{jabref-meta: databaseType:biblatex;\}$//m' < $INFILE > $INFILE~
  8. bibclean -max-width 0 $INFILE~ > $INFILE~~
  9. printf '\n%s\n' '@Comment{jabref-meta: databaseType:biblatex;}' >> $INFILE~~
  10. mv -f $INFILE~~ $INFILE
  11. rm -f $INFILE~