summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCamil Staps2016-09-21 12:27:06 +0200
committerCamil Staps2016-09-21 12:27:06 +0200
commitfe858a1d40db3b6ac2f6b22a863f33d65db422f2 (patch)
tree6947cb396b6d79f65743ee74c7707a9b82ef8a8b
parentStart Benton (diff)
Short version in makefile
-rw-r--r--Makefile12
-rw-r--r--handouts.sty33
2 files changed, 32 insertions, 13 deletions
diff --git a/Makefile b/Makefile
index 0928664..ed7226f 100644
--- a/Makefile
+++ b/Makefile
@@ -1,15 +1,19 @@
TEX=pdflatex
TEXFLAGS=-file-line-error -halt-on-error
-TARGET=$(subst .tex,.pdf,$(wildcard *.tex))
+TARGET=$(subst .tex,.pdf,$(wildcard *.tex)) $(subst .tex,-short.pdf,$(wildcard *.tex))
.PHONY: all clean
all: $(TARGET)
-%.pdf: %.tex
- $(TEX) $(TEXFLAGS) $< &&\
- $(TEX) $(TEXFLAGS) $<
+%-short.pdf: %.tex handouts.sty
+ $(TEX) $(TEXFLAGS) -jobname=$(basename $<)-short '\let\ifshownotes\iffalse\let\ifshowcriticism\iffalse\input{$<}'
+ $(TEX) $(TEXFLAGS) -jobname=$(basename $<)-short '\let\ifshownotes\iffalse\let\ifshowcriticism\iffalse\input{$<}'
+
+%.pdf: %.tex handouts.sty
+ $(TEX) $(TEXFLAGS) $<
+ $(TEX) $(TEXFLAGS) $<
clean:
latexmk -C
diff --git a/handouts.sty b/handouts.sty
index 8178b18..9d006ad 100644
--- a/handouts.sty
+++ b/handouts.sty
@@ -1,25 +1,40 @@
-\newif\ifshowpagenrs
-\newif\ifshowsummary
-\newif\ifshowcriticism
+% Define ifsolutions only if it is not defined yet (see Makefile)
+\@ifundefined{ifshowpagenrs}{%
+ \newif\ifshowpagenrs
+ \showpagenrstrue
+}{}
+\@ifundefined{ifshowsummary}{%
+ \newif\ifshowsummary
+ \showsummarytrue
+}{}
+\@ifundefined{ifshownotes}{%
+ \newif\ifshownotes
+ \shownotestrue
+}{}
+\@ifundefined{ifshowcriticism}{%
+ \newif\ifshowcriticism
+ \showcriticismtrue
+}{}
-\showpagenrstrue
-\showsummarytrue
-\showcriticismtrue
+\newcommand{\pagenrStyle}{\small\color{darkgray}}
\newcommand{\criticismStart}{\emph{Criticism:} }
\newcommand{\criticismStyle}{\color{RedOrange}}
+\newcommand{\noteStyle}{\color{gray}}
+
\newcommand{\termStyle}{\it}
\PassOptionsToPackage{dvipsnames}{xcolor}
\RequirePackage{xcolor}
\newcommand{\pagenr}[1]{%
- \ifshowpagenrs\textcolor{gray}{~(p. #1)}\fi}
+ \ifshowpagenrs\begingroup\pagenrStyle\enspace(p. #1)\endgroup\fi}
\newcommand{\summary}[1]{%
\ifshowsummary #1\fi}
+\newcommand{\note}[1]{%
+ \ifshownotes\begingroup\noteStyle\enspace(#1)\endgroup\fi}
\newcommand{\criticism}[1]{%
- \ifshowpagenrs
- \begingroup\criticismStyle\criticismStart{}#1\endgroup\fi}
+ \ifshowcriticism\begingroup\criticismStyle\criticismStart{}#1\endgroup\fi}
\newcommand{\term}[1]{%
\begingroup\termStyle #1\endgroup}