alias and technique for troff
peters at cubsvax.UUCP
peters at cubsvax.UUCP
Sat Jan 17 03:40:06 AEST 1987
Several people have been kind enough to suggest improvements to my technique.
I tried to thank some of them, but email didn't go through. The two simple
changes that I've incorporated are as follows:
(1) use ".\", not ".." to start the line; I was wrong:
".\" in fact introduces the troff comment sequence.
(2) use "sed -e 1q", rather than "sed -e 2,\$d".
So the alias now looks like this:
alias roff 'sed -e 1s/\.\\// -e 1s/@/!*/ -e 1q !* | sh &'
And the first line in the source file looks like this (for example):
.\ eqn @ | ltroff -me
If you missed the posting first time around, what this buys you is the
ability to record all the preprocessor and macro-package information in the
source file; the alias reads the first line, substitutes the "@" with the
file-name, and passes the result to /bin/sh for execution. To use, simply say:
roff fname
Enjoy!
Peter S. Shenkin Columbia Univ. Biology Dept., NY, NY 10027
{philabs,rna}!cubsvax!peters cubsvax!peters at columbia.ARPA
More information about the Comp.sources.unix
mailing list