From fcfe32775f72550ebb6d883b95cf50a1be84c451 Mon Sep 17 00:00:00 2001 From: Mohammad Akhlaghi Date: Fri, 12 Apr 2019 17:18:01 +0100 Subject: Dependency BibTeX entries included only when necessary Until now, there was a single `tex/src/references.tex' file that housed the BibTex entries for everything (software and non-software). Since we have started to include the BibTeX entry for more software, it will be hard to manage the large (sometime unused) BibTeX entries of the software in the middle of the non-software related citations in the text of the paper. Therefore, with this commit, a `tex/dependencies' directory has been made which has a separate BibTeX entry file for each software that needs one. After the software is built, this file is copied to the new `.local/version-info/cite' directory. At the end, the configure script will concatenate all the files in this directory into one file which will later be used with `tex/src/references.tex' by BibLaTeX. This greatly simplifies managing of citations. Allowing us to focus on the software-building and paper-writing citations separately/cleanly (and thus be more efficient in both). --- configure | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'configure') diff --git a/configure b/configure index 6760d0b..74c014d 100755 --- a/configure +++ b/configure @@ -650,6 +650,9 @@ if ! [ -d $ilidir ]; then mkdir $ilidir; fi ipydir=$verdir/python if ! [ -d $ipydir ]; then mkdir $ipydir; fi +ictdir=$verdir/cite +if ! [ -d $ictdir ]; then mkdir $ictdir; fi + itidir=$verdir/tex if ! [ -d $itidir ]; then mkdir $itidir; fi @@ -1019,7 +1022,11 @@ fi -# Put all the names and versions in a human-readable paragraph. +# Citation of installed software +# +# After everything is installed, we'll put all the names and versions in a +# human-readable paragraph and also prepare the BibTeX citation for the +# software. function prepare_name_version() { # First see if the (possible) `*' in the input arguments corresponds to @@ -1065,7 +1072,7 @@ texpkg=$(prepare_name_version $verdir/tex/texlive) pkgver=$mtexdir/dependencies.tex .local/bin/echo "This research was done with the following free" > $pkgver .local/bin/echo "software programs and libraries: $proglibs." >> $pkgver -if [ x$pymodules != x ]; then +if [ x"$pymodules" != x ]; then .local/bin/echo "Within Python, the following modules" >> $pkgver echo "were used: $pymodules." >> $pkgver fi @@ -1076,6 +1083,23 @@ fi .local/bin/echo "infrastructure. This research (and many " >> $pkgver .local/bin/echo "others) would not be possible without them." >> $pkgver +# Prepare the BibTeX entries for the used software (if there are any). +hasentry=0 +bibfiles="$ictdir/*" +for f in $bibfiles; do if [ -f $f ]; then hasentry=1; break; fi; done; + +# Make sure we start with an empty file. +pkgbib=$mtexdir/dependencies-bib.tex +echo "" > $pkgbib + +# Fill it in with all the BibTeX entries in this directory. We'll just +# avoid writing any comments (usually copyright notices) and also put an +# empty line after each file's contents to make the output more readable. +if [ $hasentry = 1 ]; then + for f in $bibfiles; do + awk '!/^%/{print} END{print ""}' $f >> $pkgbib + done +fi -- cgit v1.2.1