|
| 1 | +TITLE="尚硅谷Flink教程" |
| 2 | +SUBTITLE="Flink理论与项目实践" |
| 3 | +AUTHOR='尚硅谷大数据教学组' |
| 4 | +VERSION_DATE="v3.1.2, Copyright © November 13, 2019" |
| 5 | + |
| 6 | +GUIDE_ID=flinktutorial |
| 7 | + |
| 8 | +PDF_MAINFONT="Liberation Serif" |
| 9 | +PDF_SANSFONT="Liberation Sans" |
| 10 | +PDF_MONOFONT="Liberation Mono" |
| 11 | +#PDF_MAINFONT="DejaVu Serif" |
| 12 | +#PDF_SANSFONT="DejaVu Sans" |
| 13 | +#PDF_MONOFONT="DejaVu Sans Mono" |
| 14 | + |
| 15 | +USLETTER_COLOR=$(GUIDE_ID)_usl_c_1.pdf $(GUIDE_ID)_usl_c_2.pdf |
| 16 | +USLETTER_BW=$(GUIDE_ID)_usl_bw_1.pdf $(GUIDE_ID)_usl_bw_2.pdf |
| 17 | +A4_COLOR=$(GUIDE_ID)_a4_c_1.pdf $(GUIDE_ID)_a4_c_2.pdf |
| 18 | +A4_BW=$(GUIDE_ID)_a4_bw_1.pdf $(GUIDE_ID)_a4_bw_2.pdf |
| 19 | +BOOKS=$(A4_COLOR) |
| 20 | + |
| 21 | +HTML=$(GUIDE_ID).html |
| 22 | + |
| 23 | +PREPROC=../bin/preproc |
| 24 | +PREPROC_MD=$(GUIDE_ID)_temp_preproc.md |
| 25 | + |
| 26 | +COMMON_OPTS= \ |
| 27 | + --variable title:$(TITLE) \ |
| 28 | + --variable subtitle:$(SUBTITLE) \ |
| 29 | + --variable author:$(AUTHOR) \ |
| 30 | + --variable date:$(VERSION_DATE) \ |
| 31 | + --toc |
| 32 | + |
| 33 | +PDF_OPTS= \ |
| 34 | + -H latex/header_index.latex \ |
| 35 | + -A latex/after_index.latex \ |
| 36 | + --pdf-engine=xelatex \ |
| 37 | + --variable mainfont=$(PDF_MAINFONT) \ |
| 38 | + --variable sansfont=$(PDF_SANSFONT) \ |
| 39 | + --variable monofont=$(PDF_MONOFONT) \ |
| 40 | + --variable geometry:"top=1in,bottom=1in" \ |
| 41 | + -V documentclass=ctexbook \ |
| 42 | + -o $(GUIDE_ID)_temp.tex \ |
| 43 | + $(COMMON_OPTS) |
| 44 | + |
| 45 | +HTML_OPTS=$(COMMON_OPTS) \ |
| 46 | + --metadata title:$(TITLE) |
| 47 | + |
| 48 | +ONESIDE=--variable classoption:oneside |
| 49 | +TWOSIDE=--variable classoption:twoside |
| 50 | +USLETTER=--variable papersize:letter |
| 51 | +A4=--variable papersize:a4 |
| 52 | +CROWNQUARTO=--variable geometry:"paperwidth=7.444in,paperheight=9.681in,top=1in,bottom=1in,left=1in,right=1.5in" # Lulu press |
| 53 | +CROWNQUARTO_AMAZON=--variable geometry:"paperwidth=7.444in,paperheight=9.681in,top=1in,bottom=1in,left=1.25in,right=1.25in" # Amazon |
| 54 | +#SIZE_75x925_AMAZON=--variable geometry:"paperwidth=7.5in,paperheight=9.25in,top=1in,bottom=1in,left=1.125in,right=1.375in" # Amazon 7.5" x 9.25", margins too far inside |
| 55 | +SIZE_75x925_AMAZON=--variable geometry:"paperwidth=7.5in,paperheight=9.25in,top=1in,bottom=1in,left=1.25in,right=1.25in" # Amazon 7.5" x 9.25" |
| 56 | +BLANKLAST=-A latex/after_blank.latex # add a blank last page |
| 57 | +BW=--no-highlight # black and white options |
| 58 | + |
| 59 | +all: $(HTML) $(BOOKS) |
| 60 | + |
| 61 | +$(GUIDE_ID).html: $(GUIDE_ID).md bg-css.html |
| 62 | + $(PREPROC) $< $(PREPROC_MD) |
| 63 | + pandoc $(HTML_OPTS) -s $(PREPROC_MD) -o $(GUIDE_ID).html -H bg-css.html |
| 64 | + sed 's/src="\(.*\)\.pdf"/src="\1.svg"/g' $(GUIDE_ID).html > $(GUIDE_ID)_temp.html # use svg images |
| 65 | + mv $(GUIDE_ID)_temp.html $(GUIDE_ID).html |
| 66 | + rm -f $(GUIDE_ID)_temp* |
| 67 | + |
| 68 | +$(GUIDE_ID)_usl_c_1.pdf: $(GUIDE_ID).md |
| 69 | + $(PREPROC) $< $(PREPROC_MD) |
| 70 | + pandoc $(PDF_OPTS) $(USLETTER) $(ONESIDE) $(PREPROC_MD) |
| 71 | + xelatex $(GUIDE_ID)_temp.tex |
| 72 | + makeindex $(GUIDE_ID)_temp.idx |
| 73 | + xelatex $(GUIDE_ID)_temp.tex |
| 74 | + xelatex $(GUIDE_ID)_temp.tex |
| 75 | + mv $(GUIDE_ID)_temp.pdf $@ |
| 76 | + rm -f $(GUIDE_ID)_temp* |
| 77 | + |
| 78 | +$(GUIDE_ID)_usl_c_2.pdf: $(GUIDE_ID).md |
| 79 | + $(PREPROC) $< $(PREPROC_MD) |
| 80 | + pandoc $(PDF_OPTS) $(USLETTER) $(TWOSIDE) $(PREPROC_MD) |
| 81 | + xelatex $(GUIDE_ID)_temp.tex |
| 82 | + makeindex $(GUIDE_ID)_temp.idx |
| 83 | + xelatex $(GUIDE_ID)_temp.tex |
| 84 | + xelatex $(GUIDE_ID)_temp.tex |
| 85 | + mv $(GUIDE_ID)_temp.pdf $@ |
| 86 | + rm -f $(GUIDE_ID)_temp* |
| 87 | + |
| 88 | +$(GUIDE_ID)_a4_c_1.pdf: $(GUIDE_ID).md |
| 89 | + $(PREPROC) $< $(PREPROC_MD) |
| 90 | + pandoc $(PDF_OPTS) $(A4) $(ONESIDE) $(PREPROC_MD) |
| 91 | + xelatex $(GUIDE_ID)_temp.tex |
| 92 | + makeindex $(GUIDE_ID)_temp.idx |
| 93 | + xelatex $(GUIDE_ID)_temp.tex |
| 94 | + xelatex $(GUIDE_ID)_temp.tex |
| 95 | + mv $(GUIDE_ID)_temp.pdf $@ |
| 96 | + rm -f $(GUIDE_ID)_temp* |
| 97 | + |
| 98 | +$(GUIDE_ID)_a4_c_2.pdf: $(GUIDE_ID).md |
| 99 | + $(PREPROC) $< $(PREPROC_MD) |
| 100 | + pandoc $(PDF_OPTS) $(A4) $(TWOSIDE) $(PREPROC_MD) |
| 101 | + xelatex $(GUIDE_ID)_temp.tex |
| 102 | + makeindex $(GUIDE_ID)_temp.idx |
| 103 | + xelatex $(GUIDE_ID)_temp.tex |
| 104 | + xelatex $(GUIDE_ID)_temp.tex |
| 105 | + mv $(GUIDE_ID)_temp.pdf $@ |
| 106 | + rm -f $(GUIDE_ID)_temp* |
| 107 | + |
| 108 | +$(GUIDE_ID)_usl_bw_1.pdf: $(GUIDE_ID).md |
| 109 | + $(PREPROC) $< $(PREPROC_MD) |
| 110 | + pandoc $(PDF_OPTS) $(USLETTER) $(ONESIDE) $(BW) $(PREPROC_MD) |
| 111 | + xelatex $(GUIDE_ID)_temp.tex |
| 112 | + makeindex $(GUIDE_ID)_temp.idx |
| 113 | + xelatex $(GUIDE_ID)_temp.tex |
| 114 | + xelatex $(GUIDE_ID)_temp.tex |
| 115 | + mv $(GUIDE_ID)_temp.pdf $@ |
| 116 | + rm -f $(GUIDE_ID)_temp* |
| 117 | + |
| 118 | +$(GUIDE_ID)_usl_bw_2.pdf: $(GUIDE_ID).md |
| 119 | + $(PREPROC) $< $(PREPROC_MD) |
| 120 | + pandoc $(PDF_OPTS) $(USLETTER) $(TWOSIDE) $(BW) $(PREPROC_MD) |
| 121 | + xelatex $(GUIDE_ID)_temp.tex |
| 122 | + makeindex $(GUIDE_ID)_temp.idx |
| 123 | + xelatex $(GUIDE_ID)_temp.tex |
| 124 | + xelatex $(GUIDE_ID)_temp.tex |
| 125 | + mv $(GUIDE_ID)_temp.pdf $@ |
| 126 | + rm -f $(GUIDE_ID)_temp* |
| 127 | + |
| 128 | +$(GUIDE_ID)_a4_bw_1.pdf: $(GUIDE_ID).md |
| 129 | + $(PREPROC) $< $(PREPROC_MD) |
| 130 | + pandoc $(PDF_OPTS) $(A4) $(ONESIDE) $(BW) $(PREPROC_MD) |
| 131 | + xelatex $(GUIDE_ID)_temp.tex |
| 132 | + makeindex $(GUIDE_ID)_temp.idx |
| 133 | + xelatex $(GUIDE_ID)_temp.tex |
| 134 | + xelatex $(GUIDE_ID)_temp.tex |
| 135 | + mv $(GUIDE_ID)_temp.pdf $@ |
| 136 | + rm -f $(GUIDE_ID)_temp* |
| 137 | + |
| 138 | +$(GUIDE_ID)_a4_bw_2.pdf: $(GUIDE_ID).md |
| 139 | + $(PREPROC) $< $(PREPROC_MD) |
| 140 | + pandoc $(PDF_OPTS) $(A4) $(TWOSIDE) $(BW) $(PREPROC_MD) |
| 141 | + xelatex $(GUIDE_ID)_temp.tex |
| 142 | + makeindex $(GUIDE_ID)_temp.idx |
| 143 | + xelatex $(GUIDE_ID)_temp.tex |
| 144 | + xelatex $(GUIDE_ID)_temp.tex |
| 145 | + mv $(GUIDE_ID)_temp.pdf $@ |
| 146 | + rm -f $(GUIDE_ID)_temp* |
| 147 | + |
| 148 | +$(GUIDE_ID)_lulu.pdf: $(GUIDE_ID)_lulu.md |
| 149 | + $(PREPROC) $< $(PREPROC_MD) |
| 150 | + pandoc $(PDF_OPTS) $(TWOSIDE) $(CROWNQUARTO) $(BLANKLAST) $(PREPROC_MD) |
| 151 | + xelatex $(GUIDE_ID)_temp.tex |
| 152 | + makeindex $(GUIDE_ID)_temp.idx |
| 153 | + xelatex $(GUIDE_ID)_temp.tex |
| 154 | + xelatex $(GUIDE_ID)_temp.tex |
| 155 | + mv $(GUIDE_ID)_temp.pdf $@ |
| 156 | + rm -f $(GUIDE_ID)_temp* |
| 157 | + |
| 158 | +$(GUIDE_ID)_amazon.pdf: $(GUIDE_ID)_amazon.md |
| 159 | + $(PREPROC) $< $(PREPROC_MD) |
| 160 | + pandoc $(PDF_OPTS) $(TWOSIDE) $(SIZE_75x925_AMAZON) $(BLANKLAST) $(PREPROC_MD) |
| 161 | + xelatex $(GUIDE_ID)_temp.tex |
| 162 | + makeindex $(GUIDE_ID)_temp.idx |
| 163 | + xelatex $(GUIDE_ID)_temp.tex |
| 164 | + xelatex $(GUIDE_ID)_temp.tex |
| 165 | + mv $(GUIDE_ID)_temp.pdf $@ |
| 166 | + rm -f $(GUIDE_ID)_temp* |
| 167 | + |
| 168 | +clean: |
| 169 | + rm -f $(GUIDE_ID)_temp* |
| 170 | + |
| 171 | +pristine: clean |
| 172 | + rm -f $(HTML) $(BOOKS) |
| 173 | + |
| 174 | +.PHONY: all, html, clean, pristine |
0 commit comments