Changeset View
Changeset View
Standalone View
Standalone View
latexImageMakefile
- This file was added.
1 | # Makefile Krita docs latex-imageconvert | ||||
---|---|---|---|---|---|
2 | # Convert all non standard image formats to latex friendly | ||||
3 | # | ||||
4 | # Latex can work with svg, but inkscape is needed! | ||||
5 | # | ||||
6 | WDIR=${PWD} | ||||
7 | | ||||
8 | SVGCC=inkscape | ||||
9 | # image conversion | ||||
10 | SIPS=sips | ||||
11 | CONVERT=convert | ||||
12 | | ||||
13 | | ||||
14 | SVGToPDF := $(wildcard *.svg) | ||||
15 | GIFToPNG := $(wildcard *.gif) | ||||
16 | svgConverted := $(SVGToPDF:.svg=.pdf) | ||||
17 | gifConverted := $(GIFToPNG:.gif=.png) | ||||
18 | | ||||
19 | all: $(gifConverted) $(svgConverted) | ||||
20 | # Modify paths from original tex file | ||||
21 | sed -i -e 's/}\.svg/}\.pdf/g; s/}\.gif/}\.png/g' kritaManual.tex | ||||
22 | sed -i -e 's/^LATEXMKOPTS.*$//LATEXMKOPTS=-xelatex -interaction=nonstopmode/' Makefile | ||||
23 | # compile TeX file | ||||
24 | # xelatex kritaManual.tex -interaction nonstopmode | ||||
25 | | ||||
26 | %.pdf: %.svg | ||||
27 | $(SVGCC) $(WDIR)/$< -z -A $(WDIR)/$@ | ||||
28 | | ||||
29 | %.png: %.gif | ||||
30 | ifeq ($(TERM_PROGRAM),Apple_Terminal) | ||||
31 | $(SIPS) -s format png $< --out $@ | ||||
32 | else | ||||
33 | $(CONVERT) $< -flatten PNG32:$@ | ||||
34 | endif | ||||
35 | | ||||
36 | clean: | ||||
37 | rm $(gifConverted) $(svgConverted) |