Skip to content

Commit

Permalink
Rip out translation infrastructure
Browse files Browse the repository at this point in the history
Resolves #9.
  • Loading branch information
mavam committed Oct 21, 2015
1 parent 5e6852a commit 0b6a514
Show file tree
Hide file tree
Showing 5 changed files with 690 additions and 1,486 deletions.
5 changes: 1 addition & 4 deletions .gitignore
Expand Up @@ -4,14 +4,11 @@
*.bbl
*.blg
*.brf
*.fls
*.log
*.out
*.sw?
*.toc
figs/*
!figs/relationships.pdf
cookbook.pdf
cookbook-??.*
config.tex
literature
stat-cookbook.tar.gz
44 changes: 9 additions & 35 deletions Makefile
@@ -1,55 +1,29 @@
CFG := config.tex
DOC := cookbook.tex
DIST := stat-cookbook.tar.gz
THIS := $(shell basename $(CURDIR))

EN := $(DOC:.tex=-en.tex)
ES := $(DOC:.tex=-es.tex)
DE := $(DOC:.tex=-de.tex)

RERUN := "(undefined references|Rerun to get (cross-references|the bars|point totals) right|Table widths have changed. Rerun LaTeX.|Linenumber reference failed)"
RERUNBIB := "No file.*\.bbl|Citation.*undefined"

TEXINPUTS := $(TEXINPUTS):translations:

.PHONY: all figs en es english spanish purge clean dist

all: figs en
all: figs doc

figs:
@$(MAKE) -C $@

en: $(DOC)
@echo '\uselanguage{english}' > $(CFG)
@test -e $(EN) && diff -q $< $(EN) > /dev/null || cp $(DOC) $(EN)
@make english

es: $(DOC)
@echo '\uselanguage{spanish}' > $(CFG)
@test -e $(ES) && diff -q $< $(ES) > /dev/null || cp $(DOC) $(ES)
@make spanish

english: $(EN:.tex=.pdf)

spanish: $(ES:.tex=.pdf)
doc: $(DOC:.tex=.pdf)

%.pdf: %.tex
pdflatex $<
@egrep -q $(RERUNBIB) $*.log && bibtex $* && pdflatex $<; true
@egrep -q $(RERUN) $*.log && pdflatex $<; true
@egrep -q $(RERUN) $*.log && pdflatex $<; true

latexmk:
-latexmk -pvc -pdf $(DOC)

purge:
-rm -f $(DIST) $(DOC:.tex=-*) \
*.{aux,dvi,log,bbl,blg,brf,toc,thm,out,fdb_latexmk}
-rm -f *.{aux,dvi,log,bbl,blg,brf,toc,thm,out,fdb_latexmk}

clean: purge
$(MAKE) -C figs $@
-rm -f $(CFG) $(EN) $(EN:.tex=.pdf)

dist: clean
@git submodule update
@echo $(THIS)
@cd .. && \
tar cLzf $(DIST) --exclude literature $(THIS) && \
mv $(DIST) $(THIS)
-rm -f $(DOC:.tex=.pdf)

.PHONY: all figs purge clean

0 comments on commit 0b6a514

Please sign in to comment.