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 900e02c..a6bbf93 100755
--- a/project
+++ b/project
@@ -45,6 +45,7 @@ highlightnew=0
all_highlevel=0
existing_conf=0
highlightnotes=0
+separatesupplement=0
scriptname="./project"
minmapsize=10000000000
@@ -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.
@@ -212,6 +214,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;;
@@ -381,8 +385,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
@@ -494,6 +499,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
;;