Re: [NTG-context] graphics "styles"

2010-08-23 Thread Aditya Mahajan

On Tue, 24 Aug 2010, Yury G. Kudryashov wrote:


Hi!

In tikz I can say
\draw[help lines] (0, 0) circle (1cm);
and setup what does "help lines" mean (color, linewidth etc.) in the
environment file with \tikzset{help lines/.style={...}}.

Is there any way to do something similar with ConTeXt+MetaPost?


Currently, no.


Should I add
drawoptions(\MPvar{another-style-name}) before each draw/fill command, and
drawoptions() after it?


One option is to define two macros: definestyle (or perhaps newstyle, 
which is more in line with metapost naming conventions) and withstyle so 
that you can say


definestyle(helplines, withpen pencircle scaled 1bp withcolor 0.5white) ;

and then

draw fullcircle xyscaled 1cm withstyle helplines ;

It should be possible to do this in metapost, but if not (I am really bad 
at metapost "programming"), then it is straightforward to do this in TeX 
so that you write


\startMPcode
\defineMPstyle[helplines][withpen pencircle scaled 1bp withcolor 0.5white]

draw fullcircle xyscaled 1cm \withstyle{helplines} ;
\stopMPcode

but the first solution will be more cleaner.

Aditya
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] graphics "styles"

2010-08-23 Thread Yury G. Kudryashov
Hi!

In tikz I can say
\draw[help lines] (0, 0) circle (1cm);
and setup what does "help lines" mean (color, linewidth etc.) in the 
environment file with \tikzset{help lines/.style={...}}.

Is there any way to do something similar with ConTeXt+MetaPost? Should I add 
drawoptions(\MPvar{another-style-name}) before each draw/fill command, and 
drawoptions() after it?

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___