software tools question
Henry McGilton -- Software Products
henry%angel at Sun.COM
Sat Dec 9 07:04:54 AEST 1989
In Article <19856 at dgis.dtic.dla.mil> jkrueger (Jon Krueger) writes:
* I have a table that is common to many different
* documents. I decided to keep it in a separate file, so
* I can maintain a single copy, and include it into my
* documents as needed. I'm using text processing tools
* commonly found on the UNIX (registered trademark of
* AT&T) timesharing system: troff and tbl. So I placed
* my tbl definitions into a file we'll call mytable. I
* figured I'd just use the the .so command in troff:
.so mytable.
* Right?
* Wrong: the .so command includes mytable *after* tbl is done.
This is indeed true. .so is a troff request, and as such is
processed by troff, which, regrettably, comes after its
preprocessors in the pipeline.
* It needs to be included before. So I went
* looking for an interpolation tool. The right tool on
* UNIX seemed to be simple macro preprocessor: m4. I
* changed the .so mytable to include(mytable), and
* generated my document with m4 mydoc | tbl | troff.
* This worked pretty well.
* . . . lines deleted detailing why m4 is not the whole answer.
This requirement occurs all the time. If you have access
to any UNIX system running the 4.x BSD (Berkeley) flavor of
UNIX, you should find a program called `soelim'. While
soelim was originally written for another purpose, it turns
out that it does just what you want, namely, to do the
source'ing of included files before the troff preprocessors
do their work. Then you run the pipeline of commands in the form:
soelim sourcefiles . . . | pic | tbl | eqn | troff . . .
I don't know if soelim is available on System V at this
point. If you have access to a BSD system, grab the source
from such a system. soelim was written by Bill Joy in
1977, and, as far as I know, is not copyrighted.
Anybody wish to elucidate on the issue of whether a
status of `not copyrighted' implies `publicly distributable'?
................ Henry
+------------------+------------------------+---------------------------+
| Henry McGilton | I saw the future, | arpa: hmcgilton at sun.com |
| Sun Microsystems | and it didn't work. | uucp: ...!sun!angel!henry |
| Mt. View, CA | | |
+------------------+------------------------+---------------------------+
More information about the Comp.unix.questions
mailing list