summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkaa <kaa@disroot.org>2023-12-30 03:39:47 -0800
committerkaa <kaa@disroot.org>2023-12-30 03:39:47 -0800
commit79f52aee8d7d4f94fb64508abbae1ee05811d6dc (patch)
treeb01a77c902fe760c12c489555145ef79f80291f2
parentf4e2bea03af5db066b557b68d08cdc19dae3ad88 (diff)
Some realistic documentation.
-rw-r--r--doc.go50
1 files 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