On Sat, 8 Feb 2003 17:21:14 +0100
Denis Roegel
On Sat, Feb 08, 2003 at 03:20:39AM +0100, Jens-Uwe Morawski wrote:
On Fri, 7 Feb 2003 21:34:55 +0100 Giuseppe Bilotta
wrote: Friday, February 7, 2003 Jens-Uwe Morawski wrote: JUM> Do you mean something like in the attached files? JUM> keyvalmp.mp : package for key-value parameters in MP; used in mpt-conf.mp JUM> (BTW, if anybody knows a better way to implement this, please JUM> let me know) JUM> mptricks.mp : base MPTricks package JUM> mpt-conf.mp : MPTricks module that implements the requested feature JUM> mpt-test.mp : the example file
EXTREMELY interesting! Thank you very much!
Hmm, it's only the beginning ;-) Can you point me to an up-to-date and good documentation about PSTricks basics, so I can see what else is needed.
The only documentation is from 1993. You can find it on CTAN. Or here:
http://tex.loria.fr/graph-pack/pstricks/pst-usr1.pdf http://tex.loria.fr/graph-pack/pstricks/pst-usr2.pdf http://tex.loria.fr/graph-pack/pstricks/pst-usr3.pdf http://tex.loria.fr/graph-pack/pstricks/pst-usr4.pdf http://tex.loria.fr/graph-pack/pstricks/pst-doc1.pdf http://tex.loria.fr/graph-pack/pstricks/pst-doc2.pdf
hmm, this is the docu i know. I really do not like to find out in pst-doc* what has changed compared to pst-usr*. Currently i have no plans for MPTricks, eps since MP has IMO too many limitations.
When you give options like `a=b', can a and b be defined as macros beforehand, or is that incompatible?
a (the key) is only a local variable of specific type The macro that processes the keyval-parameters changes the meaning of ',' to be like a ';' Since colors and pairs contain commas too, it changes also the meaning of '(' and ')', so the grouping of (...) is not broken. But now it expects that (...) is a pair or color. Therefore you cannot use something that contains '(' and ')' as the value b if it is no color or pair. for example: picture pic ; pic:=image(draw origin) ; YourKeyValMacro(logo=pic) ; is possible, but not YourKeyValMacro(logo=image(draw origin)) ; on the other hand, some simple primaries work: YourKeyValMacro(shape=fullcircle scaled 2) ;
That's one of the problems I had in metaobj, hence my contrived way of passing parameters.
your way inspired me to try something like the keyvalMP package ;) My first implementation based also on strings, i.e. "logo=something,shape=anything" but this doesn't allow strings to be passed as values.
I am thinking that it would be nice if sometime in the future we could have metaobj with your syntax for options.
it will not work, since metaobj relies on macros as values. Or would you like to rewrite metaobj completely? :) It's a nice and useful package, as it currently is.
On the other hand, if one uses a metapost package within context, the syntax doesn't have so many constraints, because you can hide it with TeX's syntax.
if you hide MP with TeX code then you will loose the programming capabilities of MP. Thus, the user is forced to TeX-programming that is much harder to learn. IMO, using TeX on top of MP makes sense for specific applications (for example, contexts flow-chart module or my piechartMP package) but not for "low-level" graphics operations. AND i really like the metapost language. draw MyNicePath withcolor red this is not programming, this is conversation ;) Best, Jens