aboutsummaryrefslogtreecommitdiff
path: root/project
diff options
context:
space:
mode:
Diffstat (limited to 'project')
-rwxr-xr-xproject22
1 files changed, 20 insertions, 2 deletions
diff --git a/project b/project
index d75a9ce..cdace62 100755
--- a/project
+++ b/project
@@ -36,6 +36,7 @@ host_cc=0
operation=
build_dir=
input_dir=
+noappendix=0
check_config=
make_targets=
software_dir=
@@ -127,6 +128,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.
+ --no-appendix Don't include the appendix in the final paper.
Mandatory or optional arguments to long options are also mandatory or optional
for any corresponding short options.
@@ -211,6 +213,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'):
+ --no-appendix) noappendix=1; shift;;
+ --no-appendix=*) on_off_option_error --no-appendix;;
--highlight-new) highlightnew=1; shift;;
--highlight-new=*) on_off_option_error --highlight-new;;
--highlight-notes) highlightnotes=1; shift;;
@@ -380,8 +384,8 @@ 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 highlightnew=$highlightnew"
- envmake="$envmake highlightnotes=$highlightnotes .local/bin/make"
+ envmake="$envmake noappendix=$noappendix highlightnew=$highlightnew"
+ 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
@@ -493,6 +497,20 @@ 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"
+ echo "No abstract, and captions (250 for each figure): $numeff"
+ rm paper.txt
+ fi
+ fi
;;