blob: 6f4773ed453419f092f5e905de218dfb635e7307 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
|
FILE ?= upmethodology-doc
TEXFILE=${FILE}.tex
DVIFILE=${FILE}.dvi
PDFFILE=${FILE}.pdf
PSFILE=${FILE}.ps
BBLFILE=${FILE}.bbl
AUXFILE=${FILE}.aux
TEXFILES = ${TEXFILE} $(shell find . -name "*.tex" -path "./*/*")
XFIG_FIG= $(shell find . -name "*.fig" -a ! -name "*.ltx.fig")
PSTEX_FIG= $(shell find . -name "*.ltx.fig")
EPSGZ_FIG= $(shell find . -name "*.eps.gz")
PNGGZ_FIG= $(shell find . -name "*.png.gz")
SVG_FIG= $(shell find . -name "*.svg")
EPS_XFIG= $(addsuffix .eps, $(basename ${XFIG_FIG}))
PSTEX_XFIG= $(addsuffix .pstex, $(basename $(basename ${PSTEX_FIG})))
PDF_PSTEX= $(addsuffix .pdf, $(basename ${PSTEX_XFIG}))
PSTEX_T_XFIG= $(addsuffix .pstex_t, $(basename $(basename ${PSTEX_FIG})))
EPS_EPSGZ= $(addsuffix .eps, $(basename $(basename ${EPSGZ_FIG})))
PNG_PNGGZ= $(addsuffix .png, $(basename $(basename ${PNGGZ_FIG})))
PDF_XFIG= $(addsuffix .pdf, $(basename ${EPS_XFIG}))
PNG_SVG= $(addsuffix .png, $(basename ${SVG_FIG}))
EPS_SVG= $(addsuffix .eps, $(basename ${SVG_FIG}))
PDF_SVG= $(addsuffix .pdf, $(basename ${SVG_FIG}))
TMPIMAGES= $(EPS_SVG)
IMAGES= $(EPS_XFIG) $(PSTEX_XFIG) $(PSTEX_T_XFIG) $(EPS_EPSGZ) $(PNG_PNGGZ) $(PDF_XFIG) $(PDF_SVG) $(PDF_PSTEX)
TMPFILES = *.aux *.log *.dvi *.bbl *.blg \
*.cb *.toc *.out *.lof *.lot *.los *.lom *.tmp \
$(shell find . -name "*~") \
$(shell find . -name "*.bak") \
$(shell find . -name "*.backup") \
$(shell find . -name "auto")
all: pdf
pdf: gen_pdf
ifeq ("${PDF_VIEWER}","")
@ if `which acroread 2>/dev/null >/dev/null`; \
then \
acroread ${PDFFILE}; \
elif `which evince 2>/dev/null >/dev/null`; \
then \
evince ${PDFFILE}; \
elif `which xpdf 2>/dev/null >/dev/null`; \
then \
xpdf ${PDFFILE}; \
fi
else
$$PDF_VIEWER ${PDFFILE}
endif
gen_pdf: ${TEXFILES} $(IMAGES)
@ touch ${BBLFILE}&& \
pdflatex ${FILE} && \
if grep "\\citation" ${AUXFILE}; then \
bibtex ${FILE} && \
pdflatex ${FILE}; \
fi && \
pdflatex ${FILE} && \
pdflatex ${FILE}
bibtex: ${TEXFILES} $(IMAGES)
@ pdflatex ${FILE} && \
bibtex ${FILE}
clean:
@ rm -f ${TMPFILES}
cleanall: clean
@ rm -f ${PDFFILE} ${PSFILE} ${IMAGES} $(TMPIMAGES)
images: ${IMAGES}
showimages:
@echo ${IMAGES}
$(EPS_XFIG): %.eps: %.fig
@ fig2dev -L eps "$<" "$@"
$(PDF_XFIG): %.pdf: %.eps
@ epstopdf --outfile="$@" "$<"
$(PDF_PSTEX): %.pdf: %.pstex
@ epstopdf --outfile="$@" "$<"
$(PSTEX_XFIG): %.pstex: %.ltx.fig
@ fig2dev -L pstex "$<" "$@"
$(PSTEX_T_XFIG): %.pstex_t: %.ltx.fig
@ fig2dev -L pstex_t -p $*.pstex "$<" "$@" && \
perl -p -i -e "s/.pstex//;" "$@"
#perl -p -i -e "s/.pstex//;s/includegraphics{/includegraphics[\\\\psteximgoptions]{/;" "$@"
$(EPS_EPSGZ): %.eps: %.eps.gz
@ zcat "$<" > "$@"
$(PNG_PNGGZ): %.png: %.png.gz
@ zcat "$<" > "$@"
$(PNG_SVG): %.png: %.svg
@ inkscape --without-gui --export-png="$@" --export-background-opacity=0.0 --export-dpi=160 "$<"
$(EPS_SVG): %.eps: %.svg
@ inkscape --without-gui --export-eps="$@" "$<"
$(PDF_SVG): %.pdf: %.eps
@ epstopdf --outfile="$@" "$<"
|