summaryrefslogtreecommitdiff
path: root/dviware/dvisirule/cmd.mk
blob: eba7025525e2164e53668c983fcb090db54b6d63 (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

Lo =
LATEX ?= latex

texver = $(shell ${LATEX} --version | head -1)
tl = $(findstring TeX Live, ${texver})
mik = $(findstring MiKTeX, ${texver})
ifeq (${tl},TeX Live)
#$(info texlive)
LATEX += -no-mktex tfm
else ifeq (${mik},MiKTeX)
#$(info miktex)
LATEX += -quiet
else
$(error Unknown latex system)
endif

define Latex # texsrc
	tmp=/tmp/$${$$}; \
	rc=0; \
	{ \
	${LATEX} \
		-halt-on-error -interaction=nonstopmode \
		-file-line-error \
		-output-directory ${Dir} \
		${Lo}'\input' ${1} > $${tmp} ||\
		{ rc=$${?}; tail -20 $${tmp}; }; \
	${RM} $${tmp}; \
	test $${rc} -eq 0; \
	}
endef

TEXINPUTS := ${Dir}:${TEXINPUTS}
export TEXINPUTS
DVIPDFMX ?= dvipdfmx -q -f erewhon.map -f newtx.map -f Chivo.map
PDFCROP ?= pdfcrop --noverbose