Article View: net.text
Article #618Re: Table of contents help for troff - please
From: Chris Miller
Date: Sat, 10 Aug 1985 07:50
Date: Sat, 10 Aug 1985 07:50
34 lines
2238 bytes
2238 bytes
In article <1710002@acf2.UUCP> siritzky@acf2.UUCP (Brian Siritzky) writes:
> ...
>We have formatted a book using troff with the 'me' package. ...
>.... At the end of each
>chapter we generate a table of contents for that chapter. Now we want to merge
>them all together. We use the '.xp' to print out the TOC. Is there a way to
>divert part of the output to a different file? ...
The only way to divert output from [nt]roff that I am aware of (at least
int the versions normally distributed with V6, V7 and 4.xBSD; I don't
know whether anyone has extended it since) is to use the ".tm" macro
which writes a "terminal message" to the standard stream. Of course,
if you use ".tm" for diverted output then any error messages written in
this way by the macro package get interspersed with your TOC.
To catch the standard error stream, either do
troff -me chapterN.n >chapterN.out 2>>toc
if you use the Bourne shell or do
(troff -me chapterN.n >chapterN.out) >&toc
from the Cshell (horrible, isn't it - I like the CShell, but sometimes ...
however, this is net.text, not net.unix).
I have used this technique for capturing and producing the index of
a book; I also have a post-processor (alternative versions in Spitbol
and Icon) for generating a troff file to print the sorted index, merging
duplicate entries, collecting common entries under a single main heading,
etc., which I could post or supply by mail if there is interest.
--
Chris Miller, Heriot-Watt University, Edinburgh
...!ukc!{cstvax,kcl-cs}!hwcs!chris chris@hwcs.uucp
Technical Details
Message-ID:
<595@hwcs.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!mcvax!ukc!cstvax!hwcs!chrisReferences:
<1710002@acf2.UUCP>Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83 (MC830713); site hwcs.UUCP Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!mcvax!ukc!cstvax!hwcs!chris From: chris@hwcs.UUCP (Chris Miller) Newsgroups: net.text Subject: Re: Table of contents help for troff - please Message-ID: <595@hwcs.UUCP> Date: Sat, 10-Aug-85 03:50:36 EDT Article-I.D.: hwcs.595 Posted: Sat Aug 10 03:50:36 1985 Date-Received: Sun, 18-Aug-85 01:06:36 EDT References: <1710002@acf2.UUCP> Reply-To: chris@brahma.UUCP (Chris Miller) Organization: Computer Sci., Heriot-Watt U., Scotland Lines: 34