[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Groff] moving TOC to start
From: |
Keith Marshall |
Subject: |
Re: [Groff] moving TOC to start |
Date: |
Tue, 27 Sep 2005 19:46:17 +0100 |
On Tuesday 27 September 2005 2:06 pm, Tadziu Hoffmann wrote:
> > does anyone have any simple methods for placing the table of contents
> > at the start of the output file ?
> >
> > I have done it manually with Postscript output and should be able to
> > script that, but if anyone has other suggestions I would appreciate
> > hearing from them.
>
> I think manipulating the intermediate output given to the device
> postprocessor is easier than manipulating the final device code
> (ps, in your case). Something like this:
>
> [excellent example snipped] ...
Sorry to hijack this thread, for a potential development discussion.
Since I first saw this technique, in Tadziu's own `tmac.diss' documentation,
I've been toying with ideas on how I might adapt it for `pdfroff'. I'd
actually like to engineer the concept directly into groff itself. Here's how
I think that might be achieved:--
1) Define a new `command', in the troff intermediate output command set, or
adapt one of those already existing, to mark collation points with arbitrary
collating sequence serialisation indices.
2) Adapt troff's `\X' escape mechanism, so as to accommodate embedding of
such collating marks into the troff output stream, at strategic points
defined within the document source.
3) Provide a new intermediate postprocessor, (call it `grocol' perhaps?),
which would read the troff output stream, split it at the embedded collating
marks, then reassemble it in correctly collated sequence order, passing this
on as its own output, to the ultimate device postprocessor.
4) Modify the groff program itself, to insert this `grocol' postprocessor
between troff and the ultimate processor, in the normal processing pipeline;
this would be activated by a new command line switch.
I'd be willing to work on such an implementation, in parallel with ongoing
development of `pdfroff' and `pdfmark.tmac', if there is any interest in
pursuing the concept further.
Any thoughts?
Best regards,
Keith.
Re: [Groff] moving TOC to start, Keith MARSHALL, 2005/09/29