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?
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
participants (2)
-
Aditya Mahajan
-
Yury G. Kudryashov