|
| 1 | +LATEX = latex |
| 2 | + |
| 3 | +DVIPS = dvips |
| 4 | + |
| 5 | +PDFFLAGS = -dCompatibilityLevel=1.4 -dPDFSETTINGS=/prepress \ |
| 6 | + -dCompressPages=true -dUseFlateCompression=true \ |
| 7 | + -dEmbedAllFonts=true -dSubsetFonts=true -dMaxSubsetPct=100 |
| 8 | + |
| 9 | + |
| 10 | +%.dvi: %.tex |
| 11 | + $(LATEX) $< |
| 12 | + |
| 13 | +%.ps: %.dvi |
| 14 | + $(DVIPS) -o $@ $< |
| 15 | + |
| 16 | +%.pdf: %.ps |
| 17 | + ps2pdf $(PDFFLAGS) $< |
| 18 | + |
| 19 | +all: book.tex |
| 20 | + makeindex book |
| 21 | + pdflatex book |
| 22 | + mv book.pdf thinkpython.pdf |
| 23 | + evince thinkpython.pdf |
| 24 | + |
| 25 | +hevea: book.tex header.html footer.html |
| 26 | + # replace the pdfs with eps |
| 27 | + sed s/.pdf/.eps/g book.tex > thinkpython.tex |
| 28 | + latex thinkpython |
| 29 | + rm -rf html |
| 30 | + mkdir html |
| 31 | + hevea -fix -O -e latexonly htmlonly thinkpython |
| 32 | +# the following greps are a kludge to prevent imagen from seeing |
| 33 | +# the definitions in latexonly, and to avoid headers on the images |
| 34 | + grep -v latexonly thinkpython.image.tex > a; mv a thinkpython.image.tex |
| 35 | + grep -v fancyhdr thinkpython.image.tex > a; mv a thinkpython.image.tex |
| 36 | + imagen -png thinkpython |
| 37 | + hacha thinkpython.html |
| 38 | + cp up.png next.png back.png html |
| 39 | + mv index.html thinkpython.css thinkpython*.html thinkpython*.png *motif.gif html |
| 40 | + |
| 41 | +DEST = /home/downey/public_html/greent/thinkpython |
| 42 | + |
| 43 | +epub: |
| 44 | + cd html; ebook-convert index.html thinkpython.epub |
| 45 | + |
| 46 | +distrib: |
| 47 | + rm -rf dist |
| 48 | + mkdir dist dist/tex dist/tex/figs |
| 49 | + rsync -a thinkpython.pdf html dist |
| 50 | + rsync -a Makefile book.tex latexonly htmlonly dist/tex |
| 51 | + rsync -a figs/*.fig figs/*.pdf dist/tex/figs |
| 52 | + cd dist; zip -r thinkpython.tex.zip tex |
| 53 | + cd dist; zip -r thinkpython.html.zip html |
| 54 | + rsync -a dist/* $(DEST) |
| 55 | + chmod -R o+r $(DEST)/* |
| 56 | + cd $(DEST)/..; sh back |
| 57 | + |
| 58 | +plastex: |
| 59 | + # Before running plastex, we need the current directory in PYTHONPATH |
| 60 | + # export PYTHONPATH=$PYTHONPATH:. |
| 61 | + python Filist.py book.tex > book.plastex |
| 62 | + rm -rf /home/downey/thinkpython/trunk/book |
| 63 | + plastex --renderer=DocBook --theme=book --image-resolution=300 --filename=book.xml book.plastex |
| 64 | + rm -rf /home/downey/thinkpython/trunk/book/.svn |
| 65 | + |
| 66 | +plastest: |
| 67 | + # Before running plastex, we need the current directory in PYTHONPATH |
| 68 | + # export PYTHONPATH=$PYTHONPATH:. |
| 69 | + python Filist.py test.tex > test.plastex |
| 70 | + rm -rf /home/downey/thinkpython/trunk/test |
| 71 | + plastex --renderer=DocBook --theme=test --filename=test.xml test.plastex |
| 72 | + rm -rf /home/downey/thinkpython/trunk/test/.svn |
| 73 | + |
| 74 | +xxe: |
| 75 | + ~/Downloads/xxe-perso-4_8_0/bin/xxe book/book.xml |
| 76 | + |
| 77 | +OREILLY = /home/downey/oreilly/thinkpython |
| 78 | + |
| 79 | +oreilly: |
| 80 | + rsync -a book.tex $(OREILLY) |
| 81 | + rsync -a book/ $(OREILLY) |
| 82 | + rsync -a figs/* $(OREILLY)/figs |
| 83 | + rsync -a thinkpython.pdf $(OREILLY)/pdf |
| 84 | + |
| 85 | +clean: |
| 86 | + rm -f *~ *.aux *.log *.dvi *.idx *.ilg *.ind *.toc |
| 87 | + |
| 88 | + |
| 89 | + |
0 commit comments