Skip to content
Snippets Groups Projects
Makefile 2.07 KiB
Newer Older
# Requires GNU make, xargs, a latex distribution, sage
# and sagetex.sty visible in TEXINPUTS

MAINTEXFILE = main.tex
TEXFILES = ${MAINTEXFILE}
SAGETEXSCRIPT = main.sagetex.sage

main.pdf: ${TEXFILES}  main.sagetex.sout.tmp
main.sagetex.sout.tmp: ${SAGETEXSCRIPT} plots_and_expressions.py examples.py characteristic_curves.py rank_zero_case.py other_P_choice.py
	PYTHONPATH=./sagetexscripts/ sage ${SAGETEXSCRIPT}

${SAGETEXSCRIPT}: ${TEXFILES}
Luke Naylor's avatar
Luke Naylor committed
	latexmk || echo this shoud fail
plots_and_expressions.py: plots_and_expressions.ipynb
	jupyter nbconvert --to script plots_and_expressions.ipynb
	mv plots_and_expressions.py plots_and_expressions.sage
	sed -e "/get_ipython/d" -i plots_and_expressions.sage
	sage --preparse plots_and_expressions.sage
	mv plots_and_expressions.sage.py plots_and_expressions.py

examples.py: plots_and_expressions.py examples.ipynb
	jupyter nbconvert --to script examples.ipynb
	mv examples.py examples.sage
	sed -e "/get_ipython/d" -i examples.sage
	sage --preparse examples.sage
	mv examples.sage.py examples.py

characteristic_curves.py: characteristic_curves.ipynb
	jupyter nbconvert --to script characteristic_curves.ipynb
	mv characteristic_curves.py characteristic_curves.sage
	sed -e "/get_ipython/d" -i characteristic_curves.sage
	sage --preparse characteristic_curves.sage
	mv characteristic_curves.sage.py characteristic_curves.py
rank_zero_case.py: rank_zero_case.ipynb
	jupyter nbconvert --to script rank_zero_case.ipynb
	mv rank_zero_case.py rank_zero_case.sage
	sed -e "/get_ipython/d" -i rank_zero_case.sage
	sage --preparse rank_zero_case.sage
	mv rank_zero_case.sage.py rank_zero_case.py

other_P_choice.py: other_P_choice.ipynb
	jupyter nbconvert --to script other_P_choice.ipynb
	mv other_P_choice.py other_P_choice.sage
	sed -e "/get_ipython/d" -i other_P_choice.sage
	sage --preparse other_P_choice.sage
	mv other_P_choice.sage.py other_P_choice.py

.PHONY: clean nosage noappendix
clean:
	rm -rf **/__pycache__
	latexmk -C
	git clean -xf || echo no git repo to use for cleaning


noappendix: ${TEXFILES}  main.sagetex.sout.tmp
	latexmk