Makefile 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. .PHONY: FORCE pdf publish watch clean purge config env docs ignore acknowledge
  2. -include .env
  3. export
  4. main: pdf
  5. pdf: version
  6. latexmk -pdflatex='pdflatex -interaction nonstopmode' -pdf $(document).tex
  7. publish: version
  8. if [ ! -d "published" ]; then mkdir published; fi
  9. if [ ! -d "published/$(currentvolume)_$(currentissue)" ]; then mkdir published/$(currentvolume)_$(currentissue); fi
  10. sed -i 's/\\pagecolor/%\\pagecolor/g' config.tex
  11. latexmk -pdflatex='pdflatex -interaction nonstopmode' -pdf $(document).tex
  12. sed -i 's/%\\pagecolor/\\pagecolor/g' config.tex
  13. cp $(document).pdf published/$(currentvolume)_$(currentissue)/$(publish).pdf
  14. cp docs published/$(currentvolume)_$(currentissue) -r
  15. cp $(document).pdf published/$(currentvolume)_$(currentissue)/$(publish)_$(shell date --iso-8601=seconds).pdf
  16. cp docs published/$(currentvolume)_$(currentissue)/docs_$(shell date --iso-8601=seconds) -r
  17. latexmk -pdflatex='pdflatex -interaction nonstopmode' -pdf $(document).tex
  18. convert -verbose -density 150 published/$(currentvolume)_$(currentissue)/$(publish).pdf -strip -quality 100 -sharpen 0x1.0 -append published/$(currentvolume)_$(currentissue)/$(publish).png
  19. convert published/$(currentvolume)_$(currentissue)/$(publish).png -trim published/$(currentvolume)_$(currentissue)/$(publish).png
  20. cp published/$(currentvolume)_$(currentissue)/$(publish).png published/$(currentvolume)_$(currentissue)/$(publish)_$(shell date --iso-8601=seconds).png
  21. watch:
  22. latexmk -pdflatex='pdflatex -interaction nonstopmode' -pdf -pvc $(document).tex
  23. clean:
  24. latexmk -c
  25. purge:
  26. latexmk -C
  27. version:
  28. sed -i '/currentvolume/c\\\currentvolume{$(currentvolume)}' config.tex
  29. sed -i '/currentissue/c\\\currentissue{$(currentissue)}' config.tex
  30. init: config env docs
  31. config: FORCE
  32. cp example.config.tex config.tex
  33. env:
  34. cp example.env .env
  35. docs:
  36. cp template_docs docs -r
  37. ignore: acknowledge
  38. echo config.tex >> .gitignore
  39. echo .env >> .gitignore
  40. acknowledge:
  41. sed -i '/config.tex/d' .gitignore
  42. sed -i '/.env/d' .gitignore