aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--paper.tex7
-rwxr-xr-xproject17
-rw-r--r--reproduce/analysis/make/paper.mk12
-rw-r--r--tex/src/preamble-project.tex14
4 files changed, 34 insertions, 16 deletions
diff --git a/paper.tex b/paper.tex
index d588e3d..08b431b 100644
--- a/paper.tex
+++ b/paper.tex
@@ -14,13 +14,6 @@
%% assumed to be if you use `\includetikz' when `\makepdf' is not defined.
\newcommand{\makepdf}{}
-%% When defined (value is irrelevant), `\highlightchanges' will cause text
-%% in `\tonote' and `\new' to become colored. This is useful in cases that
-%% you need to distribute drafts that is undergoing revision and you want
-%% to highlight to your colleagues which parts are new and which parts are
-%% only for discussion.
-\newcommand{\highlightchanges}{}
-
%% Import necessary packages
\input{tex/build/macros/project.tex}
\input{tex/src/preamble-project.tex}
diff --git a/project b/project
index 88aa8fd..311c051 100755
--- a/project
+++ b/project
@@ -42,8 +42,10 @@ make_targets=
software_dir=
clean_texdir=0
prepare_redo=0
+highlightnew=0
all_highlevel=0
existing_conf=0
+highlightnotes=0
scriptname="./project"
minmapsize=10000000000
@@ -119,11 +121,15 @@ Configure and Make options:
-j, --jobs=INT Number of threads to build/run the software.
-?, --help Print this help list.
-Make options:
- --no-appendix Don't include the appendix in the final paper.
+Make (analysis) options:
-d, --debug=FLAGS Print various types of debugging information.
-p, --prepare-redo Re-do preparation (only done automatically once).
+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.
@@ -209,6 +215,10 @@ do
# 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;;
+ --highlight-notes=*) on_off_option_error --highlight-notes;;
-d|--debug) if [ x"$2" = x ]; then debug=a; shift;
else debug="$2"; check_v debug "$debug"; shift;shift; fi;;
-d=*|--debug=*) debug="${1#*=}"; check_v debug "$debug"; shift;;
@@ -374,7 +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 noappendix=$noappendix .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
diff --git a/reproduce/analysis/make/paper.mk b/reproduce/analysis/make/paper.mk
index 29a1ea0..de7b87f 100644
--- a/reproduce/analysis/make/paper.mk
+++ b/reproduce/analysis/make/paper.mk
@@ -54,11 +54,21 @@ $(mtexdir)/project.tex: $(mtexdir)/verify.tex
echo "\input{tex/build/macros/$$t.tex}" >> $$projecttex
done
- # Add the necessary macro to include appendix or not.
+ # Possibly print the appendix in the final PDF.
if [ x"$(noappendix)" = x1 ]; then
echo "\newcommand{\noappendix}{}" >> $$projecttex
fi
+ # Possibly highlight the '\new' parts of the text.
+ if [ x"$(highlightnew)" = x1 ]; then
+ echo "\newcommand{\highlightnew}{}" >> $$projecttex
+ fi
+
+ # Possibly show the text within '\tonote'.
+ if [ x"$(highlightnotes)" = x1 ]; then
+ echo "\newcommand{\highlightnotes}{}" >> $$projecttex
+ fi
+
# The paper shouldn't be built.
else
echo
diff --git a/tex/src/preamble-project.tex b/tex/src/preamble-project.tex
index b4fd764..6efdfd7 100644
--- a/tex/src/preamble-project.tex
+++ b/tex/src/preamble-project.tex
@@ -57,14 +57,18 @@
-%% Maneage feature for highlighting updates. When this is set, text marked
-%% as \new will be colored in dark green and text that is marked
-%% wtih \tonote will be marked in dark red.
-\ifdefined\highlightchanges
+%% Maneage feature for highlighting changes they can be set activated
+%% directly on the command-line with the '--highlight-new' or
+%% '--highlight-notes' options
+\ifdefined\highlightnew
\newcommand{\new}[1]{\textcolor{green!60!black}{#1}}
-\newcommand{\tonote}[1]{\textcolor{red!60!black}{[#1]}}
\else
\newcommand{\new}[1]{\textcolor{black}{#1}}
+\fi
+
+\ifdefined\highlightnotes
+\newcommand{\tonote}[1]{\textcolor{red!60!black}{[#1]}}
+\else
\newcommand{\tonote}[1]{{}}
\fi