.PHONY: FORCE pdf publish watch clean purge config env docs ignore acknowledge -include .env export main: pdf pdf: version latexmk -pdflatex='pdflatex -interaction nonstopmode' -pdf $(document).tex publish: version if [ ! -d "published" ]; then mkdir published; fi if [ ! -d "published/$(currentvolume)_$(currentissue)" ]; then mkdir published/$(currentvolume)_$(currentissue); fi sed -i 's/\\pagecolor/%\\pagecolor/g' config.tex latexmk -pdflatex='pdflatex -interaction nonstopmode' -pdf $(document).tex sed -i 's/%\\pagecolor/\\pagecolor/g' config.tex cp $(document).pdf published/$(currentvolume)_$(currentissue)/$(publish).pdf cp docs published/$(currentvolume)_$(currentissue) -r cp $(document).pdf published/$(currentvolume)_$(currentissue)/$(publish)_$(shell date --iso-8601=seconds).pdf cp docs published/$(currentvolume)_$(currentissue)/docs_$(shell date --iso-8601=seconds) -r latexmk -pdflatex='pdflatex -interaction nonstopmode' -pdf $(document).tex convert -verbose -density 150 published/$(currentvolume)_$(currentissue)/$(publish).pdf -strip -quality 100 -sharpen 0x1.0 -append published/$(currentvolume)_$(currentissue)/$(publish).png convert published/$(currentvolume)_$(currentissue)/$(publish).png -trim published/$(currentvolume)_$(currentissue)/$(publish).png cp published/$(currentvolume)_$(currentissue)/$(publish).png published/$(currentvolume)_$(currentissue)/$(publish)_$(shell date --iso-8601=seconds).png watch: latexmk -pdflatex='pdflatex -interaction nonstopmode' -pdf -pvc $(document).tex clean: latexmk -c purge: latexmk -C version: sed -i '/currentvolume/c\\\currentvolume{$(currentvolume)}' config.tex sed -i '/currentissue/c\\\currentissue{$(currentissue)}' config.tex init: config env docs config: FORCE cp example.config.tex config.tex env: cp example.env .env docs: cp template_docs docs -r ignore: acknowledge echo config.tex >> .gitignore echo .env >> .gitignore acknowledge: sed -i '/config.tex/d' .gitignore sed -i '/.env/d' .gitignore