#! /bin/sh # combines the given ps files into a new ps file # the last file (without suffix) will be the outputfile # syntax: ps_combine -o ... # returns outputfile # written by Jan-Uwe Ness # c Oct 2001 if [ "x$1" == "x-o" ] then final=$2 shift shift fi LIST="$@" N=0 for ff in $LIST; do let "N = N + 1" # echo "$N = $ff" done if [ "x$final" == "x" ] then final=$ff if test -e $final then echo the outputfile $final already exists echo please indicate an outputfile with option -o filename echo an existing file given with -o will then be overwritten exit fi fi echo Outputfile will be $final out=`mktemp tempXXXXXX` || exit 1 trap "rm -f $out*" 0 1 2 3 5 texfile=$out.tex files=$(ls *.ps) #echo $files echo "\documentclass[12pt]{article}" > "$texfile" echo "\pagestyle{empty}" >> "$texfile" echo "\textheight 25.5cm" >> "$texfile" echo "\textwidth 16cm" >> "$texfile" echo "\voffset -3cm" >> "$texfile" echo "\hoffset -2cm" >> "$texfile" echo "\usepackage{graphicx}" >> "$texfile" echo "\begin{document}" >> "$texfile" for ff in $LIST; do if [ ! $ff == $final ] then echo "\begin{figure}" >> "$texfile" echo "\vspace{-2cm}" >> "$texfile" echo " \hspace{-1cm}\includegraphics[height=29cm]{$ff}" >> "$texfile" echo "\end{figure}" >> "$texfile" echo "\clearpage" >> "$texfile" echo "> including $ff" fi done echo "\end{document}" >> "$texfile" latex $texfile > "$out.output" dvips $out.dvi > "$out.output" mv "$out.ps" $final echo file $final created!