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: Keith Marshall
Subject: Re: [Groff] groff 1.19.2 with pdfref
Date: Tue, 25 Jul 2006 23:58:19 +0100

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.




reply via email to

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