Blame view

swigra/parser/forest2pdf 1.08 KB
Jan Lupa authored
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
#! /bin/bash -ex
#
# Author: Marcin Woliński
# This file is in the public domain.

swigradir=`dirname $0`

if [ $# -eq 0 ]; then
    pliki=*.forest
else
    pliki=$*
fi


# if [ ! -f parstreepdf.sty ]; then cp $swigradir/parstreepdf$bw.sty ./parstreepdf.sty; fi
if [ ! -f incltree.sty ]; then cp $swigradir/incltree.sty .; fi


for i in $pliki
  do
    rdzen=`basename $i .forest`
    fullname=$rdzen.forest
    outname=$rdzen.treestex

    if grep '^sukces\.$' $fullname >/dev/null
    then
	echo '********* Przetwarzam (sukces) ' $fullname
    else
	echo '********* Pomijam (porażka)    ' $fullname
	continue	
    fi

#    swipl -t halt -g "['$swigradir/gfjp_swidzinskify','$fullname','$swigradir/trees2tex']" >$outname
    swipl -t halt -g "['$fullname','$swigradir/trees2tex']" >$outname

    cp $swigradir/wyniki.tex $rdzen.tex
#pdflatex --interaction=nonstopmode $rdzen
    latex --interaction=scrollmode $rdzen
    dvips $rdzen
    ps2pdf14 $rdzen.ps
    rm $outname $rdzen.{aux,log,tex,dvi,ps,out} 2>/dev/null
done

### Local Variables: 
### coding: utf-8
### mode: shell-script
### End: