groff
[Top][All Lists]
Advanced

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

Re: [Groff] How to create updates for revised edition of book?


From: Greg 'groggy' Lehey
Subject: Re: [Groff] How to create updates for revised edition of book?
Date: Sun, 6 Jul 2003 10:49:30 +0930
User-agent: Mutt/1.4i

On Sunday, 29 June 2003 at 12:14:34 +0100, Ralph Corderoy wrote:
>
> Hi Greg,
>
>> That should be good, but the problem is that O'Reilly want only
>> changed pages.
>
> I thought at first that you meant they wanted you to make edits so the
> page breaks occur in the same place in the text, i.e. you only change
> page 3 and text doesn't flow off it onto page 4, etc.  Kernighan had to
> do that for a re-print of _The Practice of Programming_, e.g. by
> lengthening the area of the page used for the body text, and it was
> causing some problems with one particular program listing.

Well, yes, there's something like that too, but I can handle that with
some creative reformulations.

>> My current approach is pretty manual: I run diffs on the sources, find
>> the corresponding pages in the PostScript output, and use Emacs to
>> remove the rest.  I'm left with the feeling that there must be a
>> better way.
>
> How about using GhostScript to print each page to a PNM file, use
> netpbm, e.g. pnmcut(1), to strip off the outside-print-area markup, and
> then compare the images of each page from the before and after
> `printouts'.  As long as the resolution is suitably high enough it
> should catch small changes.

Hmm.  The slightest change of position could create false positives.
I suspect that's too much work.

On Saturday,  5 July 2003 at 14:10:22 +0100, Ted Harding wrote:
>> I'm currently preparing for a revised printing of my book "The
>> Complete FreeBSD" (http://www.oreilly.com/catalog/cfreebsd/desc.html),
>> and that after less than two months.  That should be good, but the
>> problem is that O'Reilly want only changed pages.  I've been wondering
>> how best to do that.
>>
>> My current approach is pretty manual: I run diffs on the sources, find
>> the corresponding pages in the PostScript output, and use Emacs to
>> remove the rest.  I'm left with the feeling that there must be a
>> better way.
>>
>> One obstacle to automatic comparison is the markup outside the print
>> area, which includes the title, chapter name, and most importantly the
>> format date--see the attachment.  If anybody has some good ideas about
>> how to approach this, I'd be grateful.  FWIW, they want page pairs
>> (both sides of the page).
>
> Not sure that I understand the problem (?problems). But if I do understand
> the "obstacle", I'm not sure what the problem is!
>
> Since you presumably have a macro to draw the crop-marks at each
> page-break (I think I'd evoke these at the bottom of the page, but never
> mind), you can surely include code to plant the date etc. in this macro?

Yes, the format date is there already.  That's one of the problems, in
fact, because it creates false positives.

> .de cropmarks
> .ds fmtDS \*[fmtDATE] The Complete BSD (\*[filename]) page \\n%
> [move drawing point to top LH corner of page area]
> X'\D'l -1c 0''\X'\D'l 0 -1c''\
> [move to position of format date string]
> \*[fmtDS]
> [more cropmarks]
> ..
>
> where in invoking groff you use
>
> groff ... -dfmtDATE="`date [options]`" ...
>
> (define string "filename" in whatever way is convenient).

This is probably the beginning of a good idea.  If I decide to put in
revision tags macros, they can write the page number to an output
file, and I can use the list to extract the correct page pairs.
Thanks.

Greg
--
Finger address@hidden for PGP public key
See complete headers for address and phone numbers

Attachment: pgplhimKTUUCV.pgp
Description: PGP signature


reply via email to

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