Mercurial > hgbook
comparison en/Makefile @ 30:cc1e6f1d7161
Use PDF instead of PNG for images in the PDF book
author | Josef "Jeff" Sipek <jeffpc@josefsipek.net> |
---|---|
date | Sat, 15 Jul 2006 21:53:57 -0400 |
parents | 1bc6c1f0192a |
children | 51d94bd2804c |
comparison
equal
deleted
inserted
replaced
28:f5ce861d6fcc | 30:cc1e6f1d7161 |
---|---|
40 TEXINPUTS=$(dir $<): pdflatex $(call latex-options,$@) $< || (rm -f $@; exit 1) | 40 TEXINPUTS=$(dir $<): pdflatex $(call latex-options,$@) $< || (rm -f $@; exit 1) |
41 TEXINPUTS=$(dir $<): pdflatex $(call latex-options,$@) $< || (rm -f $@; exit 1) | 41 TEXINPUTS=$(dir $<): pdflatex $(call latex-options,$@) $< || (rm -f $@; exit 1) |
42 if grep 'Reference.*undefined' $(@:.pdf=.log); then exit 1; fi | 42 if grep 'Reference.*undefined' $(@:.pdf=.log); then exit 1; fi |
43 endef | 43 endef |
44 | 44 |
45 pdf/hgbook.pdf: $(sources) $(image-sources:%.svg=%_pdf.png) examples | 45 pdf/hgbook.pdf: $(sources) $(image-sources:%.svg=%.pdf) examples |
46 $(call pdf) | 46 $(call pdf) |
47 | 47 |
48 html: html/onepage/hgbook.html html/split/hgbook.html | 48 html: html/onepage/hgbook.html html/split/hgbook.html |
49 | 49 |
50 # This is a horrible hack to work around the fact that the htlatex | 50 # This is a horrible hack to work around the fact that the htlatex |
78 beta: beta/pdf/hgbook.pdf beta/html/onepage/hgbook.html beta/html/split/hgbook.html | 78 beta: beta/pdf/hgbook.pdf beta/html/onepage/hgbook.html beta/html/split/hgbook.html |
79 | 79 |
80 beta/%.tex: %.tex | 80 beta/%.tex: %.tex |
81 ./fblinks $(hg_id) $(dir $@) $< | 81 ./fblinks $(hg_id) $(dir $@) $< |
82 | 82 |
83 beta/pdf/hgbook.pdf: $(sources:%.tex=beta/%.tex) $(image-sources:%.svg=%_pdf.png) examples fblinks | 83 beta/pdf/hgbook.pdf: $(sources:%.tex=beta/%.tex) $(image-sources:%.svg=%.pdf) examples fblinks |
84 $(call pdf) | 84 $(call pdf) |
85 | 85 |
86 beta/html/onepage/hgbook.html: $(sources:%.tex=beta/%.tex) $(image-sources:%.svg=%.png) examples | 86 beta/html/onepage/hgbook.html: $(sources:%.tex=beta/%.tex) $(image-sources:%.svg=%.png) examples |
87 $(call htlatex,$@,$<) | 87 $(call htlatex,$@,$<) |
88 cp $(image-sources:%.svg=%.png) $(dir $@) | 88 cp $(image-sources:%.svg=%.png) $(dir $@) |
94 # Produce 90dpi PNGs for the web. | 94 # Produce 90dpi PNGs for the web. |
95 | 95 |
96 %.png: %.svg | 96 %.png: %.svg |
97 inkscape -D -e $@ $< | 97 inkscape -D -e $@ $< |
98 | 98 |
99 # Produce 300dpi PNGs for PDF. | 99 # Produce eps & pdf for the pdf |
100 | 100 |
101 %_pdf.png: %.svg | 101 %.pdf: %.eps |
102 inkscape -D -d 300 -e $@ $< | 102 epstopdf $< |
103 | |
104 %.eps: %.svg | |
105 inkscape -D -E $@ $< | |
103 | 106 |
104 examples: examples/.run | 107 examples: examples/.run |
105 | 108 |
106 examples/.run: $(example-sources) | 109 examples/.run: $(example-sources) |
107 cd examples && ./run-example | 110 cd examples && ./run-example |
108 | 111 |
109 build_id.tex: $(wildcard ../.hg/00changelog.[id]) | 112 build_id.tex: $(wildcard ../.hg/00changelog.[id]) |
110 echo $(hg_id) > build_id.tex | 113 echo $(hg_id) > build_id.tex |
111 | 114 |
112 clean: | 115 clean: |
113 rm -rf beta html pdf *.eps *.png *.aux *.dvi *.log *.out \ | 116 rm -rf beta html pdf *.eps *.pdf *.png *.aux *.dvi *.log *.out \ |
114 examples/*.out examples/.run build_id.tex | 117 examples/*.out examples/.run build_id.tex |