/* Sort references in a neatroff document. ref | tbl | neatroff Here is a real-world script which calls this program. #!/bin/sh BASE="/home/kaa/src/neatroff_make" ROFF="$BASE/neatroff/roff" POST="$BASE/neatpost/post" PPDF="$BASE/neatpost/pdf" EQN="$BASE/neateqn/eqn" REFR="$BASE/neatrefer/refer" PIC="$BASE/troff/pic/pic" TBL="$BASE/troff/tbl/tbl" SOIN="$BASE/soin/soin" GRAP="$BASE/troff/all/grap/grap" ROFFOPTS="-F$BASE -M$BASE/tmac" ROFFMACS="-mpost" POSTOPTS="-F$BASE -w80" POSTOPTS="$POSTOPTS -pletter" REFROPTS="-m -e -o ct -p ref.bib" tmp=/mnt/mem #tmp=/tmp # PDF < $1 $SOIN | ref | $TBL | $GRAP | $PIC | $ROFF $ROFFOPTS $ROFFMACS | tee ${1%%[.]*}.int | $PPDF $POSTOPTS > $tmp/a.pdf mutool clean -gggg -z -c -s $tmp/a.pdf ${1%.*}.pdf #| gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -dSubsetFonts=true -dPermissions=-44 -o ${1%.*}.pdf - #gs -sDEVICE=pdfwrite -dSubsetFonts=true -o - - > ${1%%[.]*}.pdf # PS GS_FONTPATH=$BASE/fonts #< $1 $ROFF $ROFFOPTS $ROFFMACS | tee ${1%%.*}.int | $POST $POSTOPTS | tee ${1%%.*}.ps | ps2pdf -dPDFSETTINGS=/prepress - ${1%%.*}.pdf hup() { if ! [ $1 ] then return else kill -HUP $1 fi } mupid=$(ps ax | grep "mupdf.*${1%%tr}pdf" | \ grep -v grep) hup $mupid */ package main