aboutsummaryrefslogtreecommitdiff
path: root/project
diff options
context:
space:
mode:
Diffstat (limited to 'project')
-rwxr-xr-xproject23
1 files changed, 22 insertions, 1 deletions
diff --git a/project b/project
index 53452ff..a99e0a6 100755
--- a/project
+++ b/project
@@ -46,6 +46,7 @@ highlightnew=0
all_highlevel=0
existing_conf=0
highlightnotes=0
+separatesupplement=0
scriptname="./project"
@@ -128,6 +129,7 @@ Make (analysis) options:
Make (final PDF) options:
--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.
@@ -209,6 +211,8 @@ do
#
# 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;;
--highlight-new) highlightnew=1; shift;;
--highlight-new=*) on_off_option_error --highlight-new;;
--highlight-notes) highlightnotes=1; shift;;
@@ -378,8 +382,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
@@ -491,6 +496,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
;;