--- /dev/null
+THIS_DIR = $(shell basename $(PWD))
+SOURCE_FILES = all_problems.tex probs.tex sols.tex
+OTHER_FILES = Makefile write_problemlist.py
+DIST_FILES = $(SOURCE_FILES) $(OTHER_FILES)
+DIST_FILE = $(THIS_DIR)_source.tar.gz
+DIST_DIR = note
+
+all : sols.pdf probs.pdf
+
+view : all
+ xpdf probs.pdf &
+ xpdf sols.pdf &
+
+%.pdf : %.tex $(SOURCE_FILES) problemlist.tex
+ pdflatex $(patsubst %.tex,%,$<)
+ find . -name '*.asy' -execdir asy -noprc -render=0 {} \;
+ pdflatex $(patsubst %.tex,%,$<)
+ pdflatex $(patsubst %.tex,%,$<)
+
+problemlist.tex : write_problemlist.py
+ ./$<
+
+semi-clean :
+ rm -f *.log *.aux *.out *.thm *.toc *.pre *-*[0-9].tex *.js *.prc *.asy
+
+clean : semi-clean
+ rm -f *.pdf $(DIST_FILE) $(DIST_DIR) install*
+ rm -f problemlist.tex $(shell find . -type l)
+
+$(DIST_FILE) : $(DIST_FILES)
+ mkdir $(DIST_DIR)
+ cp -Lrp $^ $(DIST_DIR)
+ tar -chozf $@ $(DIST_DIR)
+ rm -rf $(DIST_DIR)
+
+install : install-probs install-solns
+
+install-probs : probs.pdf
+ scp -p $< $(INSTALL_USER)@$(INSTALL_HOST):$(INSTALL_DIR)/rec$(RECITATION_NUMBER)_problems.pdf
+ @date > $@
+
+install-solns : sols.pdf $(DIST_FILE)
+ scp -p $< $(INSTALL_USER)@$(INSTALL_HOST):$(INSTALL_DIR)/rec$(RECITATION_NUMBER)_solutions.pdf
+ scp -p $(DIST_FILE) $(INSTALL_USER)@$(INSTALL_HOST):$(SOURCE_DIR)
+ @date > $@
--- /dev/null
+\usepackage[author={W. Trevor King},
+ coursetitle={Physics},
+ classtitle={Testing},
+ subheading={All problems}]{problempack}
+\usepackage[inline]{asymptote}
+\usepackage{cleveref}
+\usepackage{wtk_cmmds}
+\usepackage{wtk_format}
+
+\begin{document}
+
+\begin{asydef}
+// make wtk_cmmds macros available in Asymptote-rendered environments
+usepackage("wtk_cmmds");
+\end{asydef}
+
+\maketitle
+
+\input{problemlist}
+
+\end{document}
--- /dev/null
+\documentclass[letterpaper, 10pt]{article}
+
+\PassOptionsToPackage{nosolutions}{problempack}
+
+\input{all_problems}
--- /dev/null
+\documentclass[letterpaper, 10pt]{article}
+
+\PassOptionsToPackage{solutions,loose}{problempack}
+
+\input{all_problems}
--- /dev/null
+#!/usr/bin/env python
+
+import os
+import os.path
+
+
+_this_dir = os.path.dirname(__file__)
+
+
+def write_problemlist(problem_dir=None, blacklist=()):
+ # remove evidence from previous runs
+ for name in os.listdir(_this_dir):
+ if os.path.islink(name):
+ os.unlink(name)
+
+ # generate new symlinks and problemlist.tex
+ f = open(os.path.join(_this_dir, 'problemlist.tex'), 'w')
+ i = 1
+ for source in sorted(os.listdir(problem_dir)):
+ if source in blacklist:
+ continue
+ source_dir = os.path.join(problem_dir, source)
+ if not os.path.isdir(source_dir):
+ continue
+ f.write('\section{%s}' % source.replace('_', ' '))
+ for problem in sorted(os.listdir(source_dir)):
+ path = os.path.join(source_dir, problem)
+ if os.path.isfile(path):
+ relpath = os.path.relpath(path, _this_dir)
+ if path.endswith('.tex'):
+ pname = 'problem%d.tex' % i
+ i += 1
+ f.write('\\input{%s}\n' % pname)
+ else: # utility file (e.g. image)
+ pname = problem
+ os.symlink(relpath, pname)
+ f.close()
+
+
+if __name__ == '__main__':
+ write_problemlist(
+ problem_dir=os.path.join(_this_dir, '..', 'problems'),
+ blacklist=[
+ 'Giancoli_6',
+ 'Serway_and_Jewett_4',
+ 'Serway_and_Jewett_4_venkat',
+ 'Serway_and_Jewett_4_wking',
+# 'Serway_and_Jewett_8',
+ 'Thornton_and_Rex_3',
+ 'Thornton_and_Rex_3_wking',
+ 'Young_and_Freedman_12',
+ 'wking',
+ ]
+ )