[Top][All Lists]

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

Re: [Groff] Re: begin page blues

From: Miklos Somogyi
Subject: Re: [Groff] Re: begin page blues
Date: Fri, 10 Mar 2006 23:28:20 +1100

On 24/02/2006, at 6:50 PM, Werner LEMBERG wrote:

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.

The `cat`ted file IS the new prologue. Having access to all of my routines, I see no need for \X'ps: def ..' or `mdef' to add defintions to the original part
of the prologue.

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.

I am not saying that you should, just the opposite. Grops encapsulates only
with a dictionary (that \X'ps: def ..' may bypass).
That's not much of a protection, save/restore would be better.
At least the reader needs to be reminded to use his/her own save/restore
if he/she is into more serious PS business with scalings, etc.

   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

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'.

Thank you. I guess you mean \\*x or .x
I've tried both and prepended the included file with \! and not.
Neither of these combinations went into the PS file as PS instructions, just
as text to be plotted or something to cause error exits.
What did I do wrong?

However, \X'ps: file ..' does work within a macro without prefixing the file with anything. That's good, ... (I bet that many of you can continue this line).

Question: I'll certainly have DCT encoded images in an ASCII85 coat to be read-in. These only contain printable characters but, alas, backslash is included.
Would I need to duplicate them? Other possible problems?


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.


reply via email to

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