groff
[Top][All Lists]
Advanced

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

Re: [Groff] grog and mom.


From: Ralph Corderoy
Subject: Re: [Groff] grog and mom.
Date: Fri, 07 Jun 2002 10:36:21 +0100

Hi Peter,

> On Thu, Jun 06, 2002, Ralph Corderoy wrote:
> > As for adding -mom detection, that's easy enough by checking for
> > .PRINTSTYLE or .START.
> 
> This works for mom documents that are, in fact, fully
> document-processed using mom.  However, mom also has standalone
> typesetting capabilities (see typesetting.html in the docs) that don't
> require .PRINTSTYLE or .START.  That could make detecting mom
> difficult.

Thanks for the reference, I hadn't realised this.  But note that grog
has never been meant to determine with absolute correctness the groff
command to process a file, but just have a guess as an aid to the user.
Obviously, we'd like the guess to be a good one!  But adding more -mom
macros like .PAPER, .PAGE, and .NEWPAGE to the list grog looks out for
will increase its chances of being correct.

> A simple fix would be requiring that all mom documents start with a
> commented out keyword, say
> 
>     \#MOM
> 
> Not very elegant, I know, but all I'd have to do is add a note in the
> documentation.

Rather than do that I think it would be better to have a wider
convention of

    .\" #! groff -mom -e

as the first line.  It's a troff comment.  The #! as the second word,
reminiscent of execve's #! is our indicator that a formatting command
follows to the end of the line.

(I think this has been discussed before on the list.)

grog could check for this.

> > But -mom documents use .PS and .TS so that triggers pic and tbl
> > command line options.
> 
> If that's really a problem, the solution is simple -- aliases.  .TS is
> already an alias of .TAB_SET.  .PS could be changed in om.tmac to
> .PT_SIZE, with a built-in alias, .PS, for user convenience.  Users
> wishing to use pic and tbl in conjunction with mom would then simply
> have use the long names for .TS and .PS, or create their own aliases.

That sounds like there might still be a problem.  Are you aware that a
preprocessor, like pic, normally spots its input between a pair of tags,
like .PS/.PE, and produces its output *but leaves the tags alone*?  This
allows a macro package to define .PS/.PE so the picture is centered or
whatever.  See pic.tmac for some minimal definitions.  The same goes for
eqn, tbl, etc.

Cheers,


Ralph.


reply via email to

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