summaryrefslogtreecommitdiff
path: root/info/examples/lgc2/runltxb
blob: 78b4263349f3cdb82ba1744830d550b819d0ee1d (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
#!/bin/bash 
#
# $Id: runltxb,v 1.5 2007/06/05 21:36:56 frank Exp $
#

F=`basename $1 .ltxb`
if test `ls $F-*.eps 2>/dev/null | wc -l` -gt 0
then
  echo $F-*.eps already made
  exit
fi

## No EPS file yet --> run LaTeX

LATEX=latex
export HOMETEXMF=../texmf:
export TEXMFHOME=../texmf:
#export TEXINPUTS=../figures/beamer:
    echo "*************************** latex $F.ltxb FIRST RUN "

$LATEX $F.ltxb
if test $? -gt 0
  then
    echo "*************************** latex $F.ltxb has ERRORS"
    exit 1
fi
# we need two runs for some PSTricks examples
    echo "*************************** latex $F.ltxb SECOND RUN "

$LATEX $F.ltxb
if test $? -gt 0
  then
    echo "*************************** latex $F.ltxb has ERRORS"
    exit 1
fi
PAGES=`grep "% Show page(s)" $F.ltxb | sed 's/% Show page(s)//'| sed 's/,/ /g'`

for p in $PAGES ; do
  echo run dvips on page $p to make $F-$p.eps
  dvips -j0 -E $PARAM $F -p $p -n 1 -o $F-$p.eps

grep 'graphic converted to gray in book' $F.ltxb >  /dev/null
if test $? = 0
then
  awk -f dogray.awk $F-$p.eps > tmp.eps
  mv tmp.eps  $F-$p.eps
fi  

./cleaneps $F-$p.eps
done
echo made pages $PAGES
rm -f tmp.eps $F.dvi $F.aux $F.log $F.nav $F.out $F.snm $F.toc $F.vrb