|
@@ -0,0 +1,67 @@
|
|
|
|
+.PHONY: FORCE pdf publish watch clean purge config env docs ignore acknowledge
|
|
|
|
+
|
|
|
|
+-include .env
|
|
|
|
+export
|
|
|
|
+
|
|
|
|
+main: pdf
|
|
|
|
+
|
|
|
|
+# pdf : generate the document as pdf
|
|
|
|
+# publish : make a copy of pdf with desired name
|
|
|
|
+# watch : continuious watch for changes
|
|
|
|
+# clean : remove regeneratable latex files, except output
|
|
|
|
+# purge : remove regeneratable latex files
|
|
|
|
+# init : create config.tex and .env files
|
|
|
|
+# config : copy clean config.tex file
|
|
|
|
+# env : copy clean .env file
|
|
|
|
+# ignore : add config.tex and .env to .gitignore
|
|
|
|
+# acknowledge : remove config.tex and .env from .gitignore
|
|
|
|
+
|
|
|
|
+pdf: version
|
|
|
|
+ latexmk -pdflatex='pdflatex -interaction nonstopmode' -pdf $(document).tex
|
|
|
|
+
|
|
|
|
+publish: version
|
|
|
|
+ if [ ! -d "published" ]; then mkdir published; 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 $(publish).pdf published/$(publish)_$(currentvolume)_$(currentissue).pdf
|
|
|
|
+ cp $(publish).pdf published/$(publish)_$(currentvolume)_$(currentissue)_$(shell date --iso-8601=seconds).pdf
|
|
|
|
+ latexmk -pdflatex='pdflatex -interaction nonstopmode' -pdf $(document).tex
|
|
|
|
+ convert -verbose -density 150 published/$(publish)_$(currentvolume)_$(currentissue).pdf -strip -quality 100 -sharpen 0x1.0 -append published/$(publish)_$(currentvolume)_$(currentissue).png
|
|
|
|
+ convert published/$(publish)_$(currentvolume)_$(currentissue).png -trim published/$(publish)_$(currentvolume)_$(currentissue).png
|
|
|
|
+ cp published/$(publish)_$(currentvolume)_$(currentissue).png published/$(publish)_$(currentvolume)_$(currentissue)_$(shell date --iso-8601=seconds).png
|
|
|
|
+
|
|
|
|
+version:
|
|
|
|
+ sed -i '/currentvolume/c\\\currentvolume{$(currentvolume)}' config.tex
|
|
|
|
+ sed -i '/currentissue/c\\\currentissue{$(currentissue)}' config.tex
|
|
|
|
+
|
|
|
|
+watch:
|
|
|
|
+ latexmk -pdflatex='pdflatex -interaction nonstopmode' -pdf -pvc $(document).tex
|
|
|
|
+
|
|
|
|
+clean:
|
|
|
|
+ latexmk -c
|
|
|
|
+
|
|
|
|
+purge:
|
|
|
|
+ latexmk -C
|
|
|
|
+
|
|
|
|
+init: config env docs
|
|
|
|
+
|
|
|
|
+config: FORCE
|
|
|
|
+ cp example.config.tex config.tex
|
|
|
|
+
|
|
|
|
+env:
|
|
|
|
+ cp example.env .env
|
|
|
|
+
|
|
|
|
+docs:
|
|
|
|
+ cp docs/template_news.tex docs/news.tex
|
|
|
|
+ cp docs/template_short_news.tex docs/short_news.tex
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ignore: acknowledge
|
|
|
|
+ echo config.tex >> .gitignore
|
|
|
|
+ echo .env >> .gitignore
|
|
|
|
+
|
|
|
|
+acknowledge:
|
|
|
|
+ sed -i '/config.tex/d' .gitignore
|
|
|
|
+ sed -i '/.env/d' .gitignore
|
|
|
|
+
|