groff
[Top][All Lists]
Advanced

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

Re: [Groff] Re: begin page blues


From: Werner LEMBERG
Subject: Re: [Groff] Re: begin page blues
Date: Fri, 24 Feb 2006 08:50:18 +0100 (CET)

> > Well, the .devicem macro will be exactly the same as \Y.  To
> > create similar code with grops you have to use the `ps: def ...'
> > grops command to define a PS macro which is then executed with
> > `ps: exec' -- I'm sure you know that :-)
>
> I wouldn't do that. I have thousands of lines of PS routines that I
> cat together with the prologue. Troff works with the prologue, I
> work with my library.  Independence is as easy as apple pie.

Then simply use the -P option of grops (or the corresponding
GROPS_PROLOGUE environment variable) to pass your own prologue file.

grops intentionally has the limitation that you can't insert arbitrary
PS commands which aren't encapsulated.  I consider this a good thing,
and I'm not going to change this.

> a) The ability to mix groff and ps stuff in one macro.
>
>    E.g. one needs to reserve space (via groff's .sp) and scale
>    drawings (via PS's scale-translate-rotate).

This should work with a series of macro definitions within a macro as
described in another mail.

>    E.g. you need groff's .so in the middle of ps code, 'cause things
>    need to be initialized before the external code and things need
>    to be performed after it finished executing.

This doesn't work.  Instead, you have to use the `.trf' request -- to
define a macro `x' which contains the contents of file `f', say

  .ev 1
  .di x
  .  trf f
  .di
  .ev

This can be then expanded with \\*f.  BTW, there is a mild limitation
that only valid groff characters are accepted in the file passed as an
argument to `.trf'.

> b) The ability to pass parameters to both components (preferably via
>    \\$1 ... directly, rather than putting things into number
>    registers and strings).

See my other mail.

> > BTW, does SGI troff directly emit PostScript?  Otherwise all lines
> > with `\!' are put into the intermediate output file -- this also
> > needs an extension to the PS output device, starting and ending
> > rough PS data with `%' and `.', respectively.
>
> But I would not think that it did.

It *must* do something non-standard!  `\!', if not used within a
diversion, emits its argument verbatim into the intermediate output
file.  Probably SGI troff doesn't use intermediate output at all but
directly produces PS output?  Anyway, its use of `\!' is not portable.


    Werner




reply via email to

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