[metapost] `withprescript' writing order

Taco Hoekwater taco at elvenkind.com
Sun Feb 10 11:28:54 CET 2008


Stephan Hennig wrote:
> Taco Hoekwater schrieb:
>> Lander wrote:
>>> The `.setopacityalpha' operator comes before `gsave' in the
>>> output file, but my intention is the other way round (just
>>> to alter the graphics state for the first circle).  I wonder
>>> whether this is a deliberate behaviour as intended by the
>>> developers: because it is a "prescript", it may make sense
>>> that LIFO writing order.  I find it a bit awkward, though;
>> I think I did that on purpose, because "picture"s can also have
>> their own pre- and postscripts, as well as the pre- and posts
>> of their constituent parts, and I had to resolve that case.
>> The "withpostscript" is  FIFO.
>>
>>> perhaps it is worth adding a line to the manual, as a
>>> clarification.
>> I agree.
> 
> Would someone like to add a note to the relevant section (presumably
> '9.5 Local specials')?  Or post one here?

Adding a paragraph after the already existing text should do it:

   When you specify more than one {\tt withprescript} or more than one
   {\tt withpostscript} option, be wary of the fact that the scripts
   use a form of nesting: the {\tt withprescript} items are written to
   the PostScript file in last in, first out order; whereas the {\tt
   withpostscript} items are written in first in, first out order.

Best wishes,
Taco


More information about the metapost mailing list