groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Groff] groff 1.19.2 with pdfref


From: Bill Ward
Subject: Re: [Groff] groff 1.19.2 with pdfref
Date: Wed, 26 Jul 2006 08:46:39 -0500
User-agent: Microsoft-Entourage/10.1.4.030702.0

If you send the TOC to a file and include it on the next troff run, it works
fine.  In particular, if you write a file (using the troff stream feature)
on run "n" with each line a call to a macro that writes one TOC line, then
this file can be included on the command line in the appropriate place in
the document in run "n+1" to create the TOC.  After you work on a document a
while, the TOC doesn't change that much.  For the final copy, just make sure
you run troff twice.  Since one can forget to rerun, it's not foolproof, but
it is simple.

I'm sure there are better ways, but this worked for me.

Good luck,

Bill Ward

> From: Keith Marshall <address@hidden>
> Reply-To: address@hidden
> Date: Tue, 25 Jul 2006 23:58:19 +0100
> To: Larry Kollar <address@hidden>, <address@hidden>
> Subject: Re: [Groff] groff 1.19.2 with pdfref
> 
> On Tuesday 25 July 2006 5:04 pm, Larry Kollar wrote:
>> I've woven the pdfmark macros into the -ms extensions I'm using for
>> documentation at work, and they work well enough. I'm having trouble
>> with pdfroff though; it repeats the output twice in the PDF.
> 
> Does `pdfroff --no-toc-relocation ...' help?
> 
>> I haven't had time to figure out what's happening there;
> 
> Ok.  I need to document this.  It's on the `round tuit' list.
> 
> I think you are being bitten by the rather crude, and ugly method pdfroff
> uses to collate a TOC section, traditionally placed at the end of the
> original document by the `.TC' macro in ms.  To relocate this to its
> rightful place, at the beginning of the document, pdfroff formats the
> input twice, concatenates the two copies, and filters the combined output
> with sed, to remove the unwanted duplicate pages from the finished output.
> 
> The magic for recognising the unwanted duplicate pages is implemented in
> the `OP' macro, defined in `spdf.tmac', and triggered by `-dOPMODE=1' and
> `-dOPMODE=2' in the respective groff invocations for the two copies,
> together with a redefined `TC' macro.  Simply put, `OP' causes groff to
> format in `pen up' mode from start of input until `.TC', then with `pen
> down' to the end, when OPMODE is 1, and vice versa, when OPMODE is 2,
> then the sed filter within pdfroff eliminates the pages with no `printed'
> content, from the data stream passed to GhostScript.
> 
> Yeah.  It's crude, it's ugly, and it's unreliable.  There are better ways
> to produce correctly placed TOCs, as we've discussed previously on this
> list.  I'm working on a generic solution, based on a new `toc.tmac'
> package, which I plan to integrate transparently into pdfroff,
> (automatically activating `--no-toc-relocation' if `.toc' is used to
> define TOC entries), but it's in a very embryonic state at the moment,
> and my available time to work on it is limited.
> 
> Regards,
> Keith.
> 
> 
> _______________________________________________
> Groff mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/groff
> 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]