summary refs log tree commit diff
path: root/pkgs/misc/tex/nix/dot2pdf.sh
blob: 755cc645710561adaa77a14b0bf4fc571dbfea34 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
. $stdenv/setup

ensureDir $out

dot2pdf() {
    sourceFile=$1
    targetName=$out/$(basename $(stripHash $sourceFile; echo $strippedName) .dot).pdf
    echo "convering $sourceFile to $targetName..."
    dot -Tps $sourceFile > tmp.ps
    epstopdf --outfile $targetName tmp.ps
}

for i in $dotGraph; do
    if test -d $i; then
        for j in $i/*; do dot2pdf $j; done
    else
        dot2pdf $i
    fi
done