diff options
author | Iru Cai <mytbk920423@gmail.com> | 2018-06-01 11:08:54 +0800 |
---|---|---|
committer | Iru Cai <mytbk920423@gmail.com> | 2018-06-01 12:11:47 +0800 |
commit | 8b4fcecb12996ace3656ab735a2368863a7d3383 (patch) | |
tree | ad2aac18e2afe514c3233d207fa22bb8d843549b | |
parent | c1a3dc4b378ed8cc1a112b1cff4cef5eae47c55d (diff) | |
download | fsfs-zh-8b4fcecb12996ace3656ab735a2368863a7d3383.tar.xz |
Makefile: generate pdf vector graphics from svg and use it
-rwxr-xr-x | Makefile | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -61,7 +61,8 @@ CHAPTERS = docs/free-sw.md \ docs/surveillance-vs-democracy.md APPENDIXS = docs/appendix-a.md \ docs/appendix-b.md \ - docs/appendix-c.md \ + docs/appendix-c.md +PDF_IMG = category.pdf code-zh.pdf song-book-jutta-scrunch-crop-zh.pdf all: book html @@ -71,6 +72,7 @@ clean: rm *.tex *.aux *.fot *.toc *.log *.out rm -fr fs-translations rm *.png + rm $(PDF_IMG) rm -r site rm $(BOOKNAME).* @@ -93,10 +95,14 @@ $(BOOKNAME).html: $(PREFACES) $(CHAPTERS) $(APPENDIXS) pandoc $(TOC) --standalone --to=html5 -o $@ $^ mkdocs build --clean -$(BOOKNAME).pdf: $(TITLE) $(PREFACES) $(CHAPTERS) $(APPENDIXS) +%.pdf: docs/%.svg + rsvg-convert -f pdf -o $@ $< + +$(BOOKNAME).pdf: $(TITLE) $(PREFACES) $(CHAPTERS) $(APPENDIXS) $(PDF_IMG) $(PANDOC_TEX) ${PREFACES} -o preface.tex $(PANDOC_TEX) ${CHAPTERS} -o chapters.tex $(PANDOC_TEX) ${APPENDIXS} -o appendix.tex + sed -i 's/\(\\includegraphics.*\)\.svg\}/\1.pdf}/g' chapters.tex appendix.tex ${call pdfgen} # pandoc $(TOC) --latex-engine=xelatex -V documentclass=$(LATEX_CLASS) --template=$(TEMPLATE) -o $@ $^ rm -fr fs-translations |