diff --git a/common/bin/export-org-to-latex b/common/bin/export-org-to-latex new file mode 100755 index 0000000..6b8169a --- /dev/null +++ b/common/bin/export-org-to-latex @@ -0,0 +1,8 @@ +#!/bin/bash +# + +/usr/bin/emacs $1 --batch --eval="\ +(progn \ + (require 'ox-latex) \ + (org-latex-export-to-latex) \ + )" diff --git a/common/make/Makefile.latex b/common/make/Makefile.latex new file mode 100644 index 0000000..69f0c2e --- /dev/null +++ b/common/make/Makefile.latex @@ -0,0 +1,27 @@ +# Depends: rubber +DIR:=$(strip $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))) +ORGS = $(wildcard *.org) +TEXS = $(patsubst %.org,%.tex,$(ORGS)) +PDFS = $(patsubst %.org,%.pdf,$(ORGS)) +PDFHOS = $(patsubst %.org,%.handout.pdf,$(ORGS)) + +export TEXINPUTS = :$(DIR)/../latex/ + +all: $(PDFS) + +handouts: $(PDFHOS) + +.PRECIOUS: $(TEXS) +%.tex: %.org + $(DIR)/../bin/export-org-to-latex $< + +%.pdf: %.tex + rubber -m pdftex $< + +clean: $(patsubst %,%/clean,$(TEXS)) + +%/clean: + if [ -f $* ]; then rubber -m pdftex --clean $* ; fi + rm -f $* + +distclean: clean