LATEX:=pdflatex
+SHELL:=/bin/bash
DOCUMENT:=ar
PROBLEMS:=1 2 3 4
SOURCES:=$(DOCUMENT).tex $(addsuffix .tex,$(PROBLEMS))
-LISTINGS:=$(addprefix src/a,$(addsuffix .bash,$(PROBLEMS)))
SOLUTIONS:=$(addprefix a,$(addsuffix .tex,$(PROBLEMS)))
.SECONDARY: $(DOCUMENT).fmt $(SOLUTIONS)
-.PHONY: solutions
all: $(DOCUMENT).pdf
-%.pdf: %.tex %.fmt $(SOURCES) $(LISTINGS) $(SOLUTIONS)
- $(LATEX) $(basename $<)
- $(LATEX) $(basename $<)
+%.pdf: %.tex %.fmt $(SOURCES) $(SOLUTIONS)
+ $(LATEX) $<
+ $(LATEX) $<
%.fmt: pre.tex
$(LATEX) -ini -jobname="$(basename $@)" "&$(LATEX) $<\dump"
a%.tex: src/a%.bash src src/a%.py
- bash $< $@
+ $(SHELL) $< $@
clean:
- $(RM) -v $(addprefix $(DOCUMENT).,fmt aux log out toc pdf) $(SOLUTIONS)
+ $(RM) -v $(DOCUMENT).{fmt,aux,log,out,toc,pdf} $(SOLUTIONS)
\usepackage{hyperref} % For clickable links
\usepackage{a4wide} % For better page usage
\usepackage{float} % For better placement of tables/figures
-\usepackage{graphicx} % For images
\usepackage{amsmath} % For align
\usepackage{listings} % For code snippets
\usepackage{nicefrac} % For diagonal fractions