blob: 112e8737cec82640802ffab1a3d130d54c301192 (
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
|
#!/bin/bash
#
# $Id: runpltx,v 1.3 2007/01/04 21:59:25 frank Exp $
#
#set -x
MPFILE="FOOBAR"
PARAM=
crop=false
#
## Is string documentclass present in ltx file?
grep documentclass $1 >& /dev/null
if test $? = 1
then
# no "documentclass" present --> not LaTeX --> exit
echo "$1 not runnable LaTeX "
exit 0
fi
## If eps file already exists --> do nothing
F=`basename $1 .pltx`
if test -r $F.eps
then
echo $F.eps already made
exit
fi
## No EPS file yet --> run LaTeX
LATEX=latex
export TEXINPUTS=inputs:pstricks:
export HOMETEXMF=../texmf:
export TEXMFHOME=../texmf:
## in TL2004 the .map and .enc files are under texmf/fonts/[map,enc] only
## therefore I have to add the subdirectories where our such stuff resides.
#export TEXFONTMAPS=../texmf/dvips//:
#export ENCFONTS=../texmf/dvips//:
echo "*************************** latex $F.pltx FIRST RUN "
$LATEX $F.pltx
if test $? -gt 0
then
echo "*************************** latex $F.pltx has ERRORS"
exit 1
fi
# we need two runs for some PSTricks examples
echo "*************************** latex $F.pltx SECOND RUN "
$LATEX $F.pltx
if test $? -gt 0
then
echo "*************************** latex $F.pltx has ERRORS"
exit 1
fi
R=`grep ' Process ' $F.log` >& /dev/null
if test $? = 0
then
# We have to deal with Metapost
MFILE=`grep ' Process ' $F.log | tail -1 | awk '{print $3}'`
MPFILE=`basename $MFILE .mp`
echo "*************************** Metapost run $MFILE.mp "
mpost $MPFILE
if test $? -gt 0
then
echo "********************** Metapost $MPFILE.mp has ERRORS"
exit 1
fi
$LATEX $F.pltx
if test $? -gt 0
then
echo "*************************** latex $F.pltx has ERRORS"
exit 1
fi
else
R=`grep "t forget to process" $F.log` >& /dev/null
if test $? = 0
then
# We have to process Metafont file
MFILE=`grep "t forget to process" $F.log | tail -1 | \
awk '{print $6}' | sed 's/\!//'`
MFFILE=`basename $MFILE .mf`
mf "\\mode=ljfour; input $MFFILE"
if test $? -gt 0
then
echo "********************** Metafont $MFFILE.mf has ERRORS"
exit 1
fi
$LATEX $F.pltx
if test $? -gt 0
then
echo "*************************** latex $F.pltx has ERRORS"
exit 1
fi
gftopk $MFFILE.600gf
PARAM="-mode ljfour -D600"
else
R=`grep -i "musixtex" $F.log` >& /dev/null
if test $? = 0
then
# We have to process musxitex file with musixflex
PARAM="-mode ljfour -D600"
musixflx $F
$LATEX $F.pltx
if test $? -gt 0
then
echo "*************************** latex $F.pltx has ERRORS"
exit 1
fi
fi
fi
fi
#export KPATHSEA_DEBUG=32
dvips -o "$F-pics.ps" "$F.dvi"
ps2pdf -dAutoRotatePages=/None "$F-pics.ps" "$F-pics.pdf"
pdflatex "$F.pltx"
if $crop; then
pdfcrop "$F.pdf"
mv "$F-crop.pdf" "$F.pdf"
fi
pdftops -f 1 -l 1 -eps "$F.pdf"
#
#
./cleaneps $F.eps
if test ! -s $F.eps
then
rm $F.eps
echo "*************************** eps file $F.eps has zero size"
exit 1
fi
rm -f $F.dvi $F.aux $F.log $F.idx $MPFILE.* ftmp.mp mfpicex.* $F.mx1 $F.mx2 $F-pics.*
|