From 73731d8b52cc9d2e4d5fa65f5e39e0cfad395828 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Fri, 10 May 2024 11:19:49 +0200 Subject: extend BibLaTeX tidying to cover JabRef comment that bibclean chokes on --- bin/biblatex-tidy.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 bin/biblatex-tidy.sh (limited to 'bin') diff --git a/bin/biblatex-tidy.sh b/bin/biblatex-tidy.sh new file mode 100755 index 0000000..a29632d --- /dev/null +++ b/bin/biblatex-tidy.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +# tidy BibLaTeX file + +# Depends: bibclean + +set -eu + +INFILE=$1 + +# workaround: strip JabRef comment that bibclean chokes on +perl -gpe 's/^\@Comment\{jabref-meta: databaseType:biblatex;\}$//m' < $INFILE > $INFILE~ +bibclean -max-width 0 $INFILE~ > $INFILE~~ +printf '\n%s\n' '@Comment{jabref-meta: databaseType:biblatex;}' >> $INFILE~~ +mv -f $INFILE~~ $INFILE +rm -f $INFILE~ -- cgit v1.2.3