From 79f52aee8d7d4f94fb64508abbae1ee05811d6dc Mon Sep 17 00:00:00 2001 From: kaa Date: Sat, 30 Dec 2023 03:39:47 -0800 Subject: Some realistic documentation. --- doc.go | 50 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 48 insertions(+), 2 deletions(-) diff --git a/doc.go b/doc.go index 0aaaeb1..6bb9304 100644 --- a/doc.go +++ b/doc.go @@ -1,5 +1,51 @@ /* -Sort references in a troff document. -ref | tbl | troff +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 -- cgit v1.2.3