Started working on pointprocesses

This commit is contained in:
2015-10-25 22:22:54 +01:00
parent d9252e9cbf
commit 857373c125
24 changed files with 892 additions and 688 deletions

View File

@@ -1,142 +1,70 @@
BASENAME=pointprocesses
TEXFILE=$(BASENAME).tex
DVIFILE=$(BASENAME).dvi
PSFILE=$(BASENAME).ps
PDFFILE=$(BASENAME).pdf
FOILSFILE=foils.pdf
THUMBNAILSFILE=thumbnails.pdf
HTMLBASENAME=$(BASENAME)h
HTMLTEXFILE=$(BASENAME)h.tex
HTMLDIR=$(BASENAME)h
PYFILES=$(wildcard *.py)
PYPDFFILES=$(PYFILES:.py=.pdf)
GPTFILES=$(wildcard *.gpt)
GPTTEXFILES=$(GPTFILES:.gpt=.tex)
all: ps pdf talk again watchps watchpdf foils thumbs html html1 epsfigs clean cleanup cleanplots help
.PHONY: epsfigs
all: pdf slides thumbs
# script:
pdf : $(BASENAME)-chapter.pdf
$(BASENAME)-chapter.pdf : $(BASENAME)-chapter.tex $(BASENAME).tex $(GPTTEXFILES) $(PYPDFFILES)
pdflatex -interaction=scrollmode $< | tee /dev/stderr | fgrep -q "Rerun to get cross-references right" && pdflatex -interaction=scrollmode $< || true
# slides:
slides: $(BASENAME)-slides.pdf
$(BASENAME)-slides.pdf : $(BASENAME)-slides.tex $(GPTTEXFILES) $(PYPDFFILES)
pdflatex -interaction=scrollmode $< | tee /dev/stderr | fgrep -q "Rerun to get cross-references right" && pdflatex -interaction=scrollmode $< || true
# thumbnails:
thumbs: $(THUMBNAILSFILE)
$(THUMBNAILSFILE): $(TEXFILE) $(GPTTEXFILES)
thumbs: $(BASENAME)-handout.pdf
$(BASENAME)-handout.pdf: $(BASENAME)-slides.tex $(GPTTEXFILES)
sed -e 's/setboolean{presentation}{true}/setboolean{presentation}{false}/; s/usepackage{crop}/usepackage[frame]{crop}/' $< > thumbsfoils.tex
pdflatex thumbsfoils | tee /dev/stderr | fgrep -q "Rerun to get cross-references right" && pdflatex thumbsfoils || true
pdfnup --nup 2x4 --no-landscape --paper a4paper --trim "-1cm -1cm -1cm -1cm" --outfile $@ thumbsfoils.pdf '1-19'
pdfnup --nup 2x4 --no-landscape --paper a4paper --trim "-1cm -1cm -1cm -1cm" --outfile $@ thumbsfoils.pdf # 1-19
rm thumbsfoils.*
# transparencies:
foils: $(FOILSFILE)
$(FOILSFILE): $(TEXFILE) $(GPTTEXFILES)
sed -e 's/setboolean{presentation}{true}/setboolean{presentation}{false}/' $< > tfoils.tex
pdflatex tfoils | tee /dev/stderr | fgrep -q "Rerun to get cross-references right" && pdflatex tfoils || true
pdfnup --nup 1x2 --orient portrait --trim "-1mm -1mm -1mm -1mm" --frame true --delta "1cm 1cm" --paper a4paper --outfile tfoils2.pdf tfoils.pdf
pdfnup --nup 1x1 --orient portrait --trim "-2cm -2cm -2cm -2cm" --paper a4paper --outfile $@ tfoils2.pdf
rm tfoils.* tfoils2.pdf
# talk:
talk: $(PDFFILE)
pdf: $(PDFFILE)
$(PDFFILE): $(TEXFILE) $(GPTTEXFILES)
pdflatex -interaction=scrollmode $< | tee /dev/stderr | fgrep -q "Rerun to get cross-references right" && pdflatex -interaction=scrollmode $< || true
# batchmode (no output, no stop on error)
# nonstopmode / scrollmode (no stop on error)
# errorstopmode (stop on error)
again :
pdflatex $(TEXFILE)
watchpdf :
while true; do ! make -q pdf && make pdf; sleep 0.5; done
# html
html : $(HTMLTEXFILE) $(GPTTEXFILES)
rm -f $(HTMLDIR)/*
htlatex $<
mkdir -p $(HTMLDIR)
mv $(HTMLBASENAME).html $(HTMLDIR)
mv $(HTMLBASENAME)*.* $(HTMLDIR)
mv z*.gif $(HTMLDIR)
cd $(HTMLDIR); for i in *.gif; do convert -page +0+0 $$i tmp.gif; mv tmp.gif $$i; done; rmtex $(HTMLBASENAME)
watchslides :
while true; do ! make -q slides && make slides; sleep 0.5; done
#$(HTMLTEXFILE) : $(TEXFILE) Makefile
# sed 's/setboolean{html}{false}/setboolean{html}{true}/; s/\\colorbox{white}{\(.*\)}/\1/g' $< > $@
# python plots:
$(PYPDFFILES) : %.pdf: %.py
python $<
html1 : $(HTMLTEXFILE) $(GPTTEXFILES)
latex2html -dir $(HTMLDIR) -mkdir -subdir -nonavigation -noinfo -image_type png -notransparent -white -split 0 $<
sed 's-<I>Date:</I>--' $(HTMLDIR)/$(HTMLDIR).html > tmp.html
cp tmp.html $(HTMLDIR)/index.html
mv tmp.html $(HTMLDIR)/$(HTMLDIR).html
$(HTMLTEXFILE) : $(TEXFILE)
sed '/^%nohtml/,/^%endnohtml/d; s/\\colorbox{white}{\(.*\)}/\1/g' $< > $@
# eps of all figures:
epsfigs:
mkdir -p epsfigs; \
for i in $(GPTFILES); do \
{ sed -n -e '1,/\\begin{document}/p' $(TEXFILE); echo "\texpicture{$${i%%.*}}"; echo "\end{document}"; } > tmp.tex; \
latex tmp.tex; \
dvips tmp.dvi; \
ps2eps tmp.ps; \
mv tmp.eps epsfigs/$${i%%.*}.eps; \
rm tmp.*; \
done
# plots:
%.tex: %.gpt whitestyles.gp
# gnuplot plots:
$(GPTTEXFILES) : %.tex: %.gpt whitestyles.gp
gnuplot whitestyles.gp $<
epstopdf $*.eps
clean :
rm -f *~
rmtex $(BASENAME)
rm -f $(GPTTEXFILES)
rm -f *~
rm -f $(BASENAME).aux $(BASENAME).log
rm -f $(BASENAME)-chapter.aux $(BASENAME)-chapter.log $(BASENAME)-chapter.out
rm -f $(BASENAME)-slides.aux $(BASENAME)-slides.log $(BASENAME)-slides.out $(BASENAME)-slides.toc $(BASENAME)-slides.nav $(BASENAME)-slides.snm $(BASENAME)-slides.vrb
rm -f $(PYPDFFILES) $(GPTTEXFILES)
cleanup :
rm -f *~
rmtex $(BASENAME)
rm -f $(PSFILE) $(PDFFILE) $(FOILSFILE) $(THUMBNAILSFILE)
rm -f $(GPTTEXFILES)
rm -f -r $(HTMLDIR)
cleanplots :
sed -n -e '/\\begin{document}/,/\\end{document}/p' $(TEXFILE) | fgrep '\input{' | grep -v '^%' | sed 's/.*input{\(.*\).tex}.*/\1.gpt/' > plot.fls
mkdir -p unusedplots
for i in *.gp*; do \
grep -q $$i plot.fls || { grep -q $$i $$(<plot.fls) && echo $$i || mv $$i unusedplots; }; \
done >> plot.fls
for i in $$(<plot.fls); do \
sed "s/\([^'\" ]*\.dat\)/\n\1\n/g;" $$i | fgrep .dat; \
done | sort | uniq > dat.fls
mkdir -p unuseddata
for i in *.dat; do \
grep -q $$i dat.fls || mv $$i unuseddata; \
done
rm dat.fls plot.fls
cleanall : clean
rm -f $(BASENAME)-chapter.pdf $(BASENAME)-slides.pdf $(BASENAME)-handout.pdf
help :
@echo -e \
"make pdf: make the pdf file of the talk.\n"\
"make foils: make black&white postscript foils of the talk.\n"\
"make thumbs: make color thumbnails of the talk.\n"\
"make again: run latex and make the pdf file of the talk,\n"\
" no matter whether you changed the .tex file or not.\n\n"\
"make watchpdf: make the pdf file of the talk\n"\
"make pdf: make the pdf file of the script.\n"\
"make slides: make the pdf file of the slides.\n"\
"make thumbs: make color thumbnails of the talk.\n"\
"make watchpdf: make the pdf file of the script\n"\
" whenever the tex file is modified.\n"\
"make watchpdf: make the pdf file of the slides\n"\
" whenever the tex file is modified.\n"\
"make html: make a html version of the paper (in $(HTMLDIR)).\n\n"\
"make clean: remove all intermediate files,\n"\
" just leave the source files and the final .ps and .pdf files.\n"\
" just leave the source files and the final .pdf files.\n"\
"make cleanup: remove all intermediate files as well as\n"\
" the final .ps and .pdf files.\n"\
"make cleanplots: move all unused .gpt and .dat files\n"\
" into unusedplots/ and unuseddata/, respectively."
" the final .pdf files.\n"\