aboutsummaryrefslogtreecommitdiff
path: root/project
diff options
context:
space:
mode:
Diffstat (limited to 'project')
-rwxr-xr-xproject26
1 files changed, 25 insertions, 1 deletions
diff --git a/project b/project
index ba9e9ff..8db213a 100755
--- a/project
+++ b/project
@@ -46,6 +46,7 @@ highlightnew=0
all_highlevel=0
existing_conf=0
highlightnotes=0
+separatesupplement=0
scriptname="./project"
@@ -129,6 +130,7 @@ Make (final PDF) options:
--refresh-bib Force refresh the bibliography.
--highlight-new Highlight '\new' parts of text as green.
--highlight-notes Show '\tonote' regions as red text in PDF.
+ --supplement Build the appendices as a separate supplement PDF.
Mandatory or optional arguments to long options are also mandatory or optional
for any corresponding short options.
@@ -207,6 +209,11 @@ do
# Make options
# ------------
#
+ # Note that Make's `debug' can take values, but when called without any
+ # value, it is like giving it a value of `a'):
+ --supplement) separatesupplement=1; shift;;
+ --supplement=*) on_off_option_error --supplement;;
+
# Note that Make's 'debug' can take values, but when called without any
# value, it is like giving it a value of 'a'):
--refresh-bib) [ -f tex/src/references.tex ] && touch tex/src/references.tex; shift;;
@@ -387,8 +394,9 @@ controlled_env() {
# Remove all existing environment variables (with 'env -i') and only
# use some pre-defined environment variables, then build the project.
envmake=".local/bin/env -i HOME=$bdir sys_rm=$(which rm) $gopt"
+ envmake="$envmake separatesupplement=$separatesupplement "
envmake="$envmake highlightnew=$highlightnew"
- envmake="$envmake highlightnotes=$highlightnotes .local/bin/make"
+ envmake="$envmake highlightnotes=$highlightnotes .local/bin/make "
envmake="$envmake --no-builtin-rules --no-builtin-variables -f $1"
if ! [ x"$debug" = x ]; then envmake="$envmake --debug=$debug"; fi
@@ -500,6 +508,22 @@ case $operation in
# Run the actual project.
controlled_env reproduce/analysis/make/top-make.mk
+
+ # Print the number of words (if the user has pdftotext outside of
+ # Maneage! For now!!!), AND there actually is a 'paper.pdf' (for
+ # example when running './project make clean' there isn't any
+ # 'paper.pdf').
+ if [ -f paper.pdf ]; then
+ if type pdftotext > /dev/null 2>/dev/null; then
+ numwords=$(pdftotext paper.pdf && cat paper.txt | wc -w)
+ numeff=$(echo $numwords | awk '{print $1-850+500}')
+ echo; echo "Number of words in full PDF: $numwords"
+ if [ $separatesupplement = 1 ]; then
+ echo "No abstract, and captions (250 for each figure): $numeff"
+ fi
+ rm paper.txt
+ fi
+ fi
;;