ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* MetaTricks?
@ 2003-02-05 21:38 Giuseppe Bilotta
  2003-02-06 13:16 ` MetaTricks? Jens-Uwe Morawski
  0 siblings, 1 reply; 30+ messages in thread
From: Giuseppe Bilotta @ 2003-02-05 21:38 UTC (permalink / raw)


Hello,

I was wondering if anybody (say, for example, Hans ;>) has ever
thought about developing a (Con)TeX(t)+Meta(Post|Fun) counterpart of
PSTricks? PSTricks is widely used, but has the disadvantage of not
being usable for direct PDF creation; a purely "texmf"ish way to
handle the stuff would be rather nice.

-- 
Giuseppe "Oblomov" Bilotta

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: MetaTricks?
  2003-02-05 21:38 MetaTricks? Giuseppe Bilotta
@ 2003-02-06 13:16 ` Jens-Uwe Morawski
  2003-02-06 14:29   ` Re[2]: MetaTricks? Giuseppe Bilotta
  0 siblings, 1 reply; 30+ messages in thread
From: Jens-Uwe Morawski @ 2003-02-06 13:16 UTC (permalink / raw)


On Wed, 5 Feb 2003 22:38:19 +0100
Giuseppe Bilotta <gip.bilotta@iol.it> wrote:

> I was wondering if anybody (say, for example, Hans ;>) has ever
> thought about developing a (Con)TeX(t)+Meta(Post|Fun) counterpart of
> PSTricks? PSTricks is widely used, but has the disadvantage of not
> being usable for direct PDF creation; a purely "texmf"ish way to
> handle the stuff would be rather nice.

Hmm, PSTricks consists of two parts:
a) a TeX-part that provides a user-interface and writes the
   PS-specials in the dvi-output
b) a set of PS-macros that provides a varity of interesting
   features

a) could be implemented, but in contrast to PSTricks it
   generates MP/MetaFun code.
   This is, for example, the way how the flow-chart module works.
b) could be done partially, since PS as full featured programming
   language provides many more capabilities than TeX/MP/MFun
   together

 So, what do want or what is missing in your opinion, since
 some of the PSTricks features are already available in ConTeXt/MFun.

Jens 

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re[2]: MetaTricks?
  2003-02-06 13:16 ` MetaTricks? Jens-Uwe Morawski
@ 2003-02-06 14:29   ` Giuseppe Bilotta
  2003-02-06 16:49     ` Jens-Uwe Morawski
  0 siblings, 1 reply; 30+ messages in thread
From: Giuseppe Bilotta @ 2003-02-06 14:29 UTC (permalink / raw)
  Cc: ntg-context

Thursday, February 6, 2003 Jens-Uwe Morawski wrote:

JUM> Hmm, PSTricks consists of two parts:
JUM> a) a TeX-part that provides a user-interface and writes the
JUM>    PS-specials in the dvi-output
JUM> b) a set of PS-macros that provides a varity of interesting
JUM>    features

[snip]

JUM>  So, what do want or what is missing in your opinion, since
JUM>  some of the PSTricks features are already available in ConTeXt/MFun.

I'm more interested in (a), even if, I assume, some part of (b)
would need to be implemented in MetaPost too ...

-- 
Giuseppe "Oblomov" Bilotta

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: Re[2]: MetaTricks?
  2003-02-06 14:29   ` Re[2]: MetaTricks? Giuseppe Bilotta
@ 2003-02-06 16:49     ` Jens-Uwe Morawski
  2003-02-06 22:35       ` Re[4]: MetaTricks? Giuseppe Bilotta
  0 siblings, 1 reply; 30+ messages in thread
From: Jens-Uwe Morawski @ 2003-02-06 16:49 UTC (permalink / raw)


On Thu, 6 Feb 2003 15:29:12 +0100
Giuseppe Bilotta <gip.bilotta@iol.it> wrote:

> Thursday, February 6, 2003 Jens-Uwe Morawski wrote:
> 
> JUM> Hmm, PSTricks consists of two parts:
> JUM> a) a TeX-part that provides a user-interface and writes the
> JUM>    PS-specials in the dvi-output
> JUM> b) a set of PS-macros that provides a varity of interesting
> JUM>    features
> 
> [snip]
> 
> JUM>  So, what do want or what is missing in your opinion, since
> JUM>  some of the PSTricks features are already available in ConTeXt/MFun.
> 
> I'm more interested in (a), even if, I assume, some part of (b)
> would need to be implemented in MetaPost too ...

as you know, PSTricks is a huge package, so where to start?

- what features are needed
- who can write the TeX interface
- i could help with some MP code

but one important fact is, that PSTricks is from the normal users point
of view a simple 1:1 interface. That means as long as the user is not
familiar with TeX-programming one PSTricks command results in specific
PS-code in the output. In contrast MetaPost is an easy to learn, clean
and simple graphic/programming language; therefore we should not move
too many features in the TeX interface since we will loose much of
MPs flexibility. IMO, the TeX-part should only be present where interaction
between TeX and MP is needed or where some complex MP-code can be hidden
with a single TeX-command.

Jens

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re[4]: MetaTricks?
  2003-02-06 16:49     ` Jens-Uwe Morawski
@ 2003-02-06 22:35       ` Giuseppe Bilotta
  2003-02-06 23:03         ` MetaTricks? Denis Roegel
  2003-02-07 16:42         ` Re[4]: MetaTricks? Jens-Uwe Morawski
  0 siblings, 2 replies; 30+ messages in thread
From: Giuseppe Bilotta @ 2003-02-06 22:35 UTC (permalink / raw)


Thursday, February 6, 2003 Jens-Uwe Morawski wrote:

JUM> as you know, PSTricks is a huge package, so where to start?

JUM> - what features are needed
JUM> - who can write the TeX interface
JUM> - i could help with some MP code

Ok, the precise set of features I need is the one used by the
excellent Eukleides program (http://perso.wanadoo.fr/obrecht/);
while I was trying to port it to MetaPost and begun converting the
instructions I knew how to convert I realized that a full (or as
complete as possible) PSTricks emulation would have been the best
thing ---and that it could have already been implemented. Which is
why I asked :)

In particular, there are a few things that I currently see as
"missing" in (plain) MetaPost (and which I couldn't find in
MetaFun either); for example, there is no macro that allows to
"add" drawoptions; you can only replace them altogether. PSTricks,
OTOH (at least for what I could see) has a default color, pensize
and line style which can be changed singularly (MetaPost seems to
only do this for the pen --currentpen; it doesn't have a
currentcolor or currentstyle).

-- 
Giuseppe "Oblomov" Bilotta

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: MetaTricks?
  2003-02-06 22:35       ` Re[4]: MetaTricks? Giuseppe Bilotta
@ 2003-02-06 23:03         ` Denis Roegel
  2003-02-06 23:14           ` Re[2]: MetaTricks? Giuseppe Bilotta
  2003-02-07 16:42         ` Re[4]: MetaTricks? Jens-Uwe Morawski
  1 sibling, 1 reply; 30+ messages in thread
From: Denis Roegel @ 2003-02-06 23:03 UTC (permalink / raw)
  Cc: Denis Roegel

On Thu, Feb 06, 2003 at 11:35:14PM +0100, Giuseppe Bilotta wrote:
> Thursday, February 6, 2003 Jens-Uwe Morawski wrote:
> 
> JUM> as you know, PSTricks is a huge package, so where to start?
> 
> JUM> - what features are needed
> JUM> - who can write the TeX interface
> JUM> - i could help with some MP code
> 
> Ok, the precise set of features I need is the one used by the
> excellent Eukleides program (http://perso.wanadoo.fr/obrecht/);
> while I was trying to port it to MetaPost and begun converting the
> instructions I knew how to convert I realized that a full (or as
> complete as possible) PSTricks emulation would have been the best
> thing ---and that it could have already been implemented. Which is
> why I asked :)
> 
> In particular, there are a few things that I currently see as
> "missing" in (plain) MetaPost (and which I couldn't find in
> MetaFun either); for example, there is no macro that allows to
> "add" drawoptions; you can only replace them altogether. PSTricks,
> OTOH (at least for what I could see) has a default color, pensize
> and line style which can be changed singularly (MetaPost seems to
> only do this for the pen --currentpen; it doesn't have a
> currentcolor or currentstyle).

Hello,

I suppose you have already had a look at metaobj? 

  ftp://ftp.tex.ac.uk/tex-archive/graphics/metapost/contrib/macros/metaobj/

It implements many of pstricks' features (see pages 93 and following
in the manual). If you develop something new, 
it is worth checking what ideas you could borrow from metaobj.

At the end of the metaobj manual, there are also hints for a TeX interface.

Denis

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re[2]: MetaTricks?
  2003-02-06 23:03         ` MetaTricks? Denis Roegel
@ 2003-02-06 23:14           ` Giuseppe Bilotta
  0 siblings, 0 replies; 30+ messages in thread
From: Giuseppe Bilotta @ 2003-02-06 23:14 UTC (permalink / raw)


Friday, February 7, 2003 Denis Roegel wrote:
DR> I suppose you have already had a look at metaobj?

DR>   ftp://ftp.tex.ac.uk/tex-archive/graphics/metapost/contrib/macros/metaobj/

DR> It implements many of pstricks' features (see pages 93 and following
DR> in the manual). If you develop something new, 
DR> it is worth checking what ideas you could borrow from metaobj.

DR> At the end of the metaobj manual, there are also hints for a TeX interface.

Well, it has been some time since the last time I had a look at it
(MiKTeX couldn't handle it because of memory issues). Thank you
for the hint, I'll look into that :)

-- 
Giuseppe "Oblomov" Bilotta

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: Re[4]: MetaTricks?
  2003-02-06 22:35       ` Re[4]: MetaTricks? Giuseppe Bilotta
  2003-02-06 23:03         ` MetaTricks? Denis Roegel
@ 2003-02-07 16:42         ` Jens-Uwe Morawski
  2003-02-07 20:34           ` Re[6]: MetaTricks? Giuseppe Bilotta
  2003-02-08 20:00           ` Re[4]: MetaTricks? Hans Hagen
  1 sibling, 2 replies; 30+ messages in thread
From: Jens-Uwe Morawski @ 2003-02-07 16:42 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 1075 bytes --]

On Thu, 6 Feb 2003 23:35:14 +0100
Giuseppe Bilotta <gip.bilotta@iol.it> wrote:

> Thursday, February 6, 2003 Jens-Uwe Morawski wrote:
> 
> JUM> as you know, PSTricks is a huge package, so where to start?
> 
 
> In particular, there are a few things that I currently see as
> "missing" in (plain) MetaPost (and which I couldn't find in
> MetaFun either); for example, there is no macro that allows to
> "add" drawoptions; you can only replace them altogether. PSTricks,
> OTOH (at least for what I could see) has a default color, pensize
> and line style which can be changed singularly (MetaPost seems to
> only do this for the pen --currentpen; it doesn't have a
> currentcolor or currentstyle).

Do you mean something like in the attached files?
keyvalmp.mp : package for key-value parameters in MP; used in mpt-conf.mp
              (BTW, if anybody knows a better way to implement this, please
               let me know)
mptricks.mp : base MPTricks package
mpt-conf.mp : MPTricks module that implements the requested feature
mpt-test.mp : the example file

Best,
  Jens

[-- Attachment #2: keyvalmp.mp --]
[-- Type: application/octet-stream, Size: 5794 bytes --]

%H  package name: keyvalMP
%H  description:  support for key-value style parameters
%H  file:         keyvalmp.mp
%H  author:       Jens-Uwe Morawski <morawski@gmx.net>
%H  version:      0.0.1 2002/10/19

%L  Copyright 2002, Jens-Uwe Morawski
%L  License: LPPL 1.0, see LEGAL

%I basic macros:
%I   - declareBooleanKeys_kv, declareNumericKeys_kv,
%I     declarePairKeys_kv, declareStringKeys_kv,
%I     declarePathKeys_kv, declarePictureKeys_kv,
%I     declareColorKeys_kv, declarePenKeys_kv 
%I   - declareBooleanSyns_kv, declareNumericSyns_kv,
%I     declarePairSyns_kv, declareStringSyns_kv,
%I     declarePathSyns_kv, declarePictureSyns_kv,
%I     declareColorSyns_kv
%I   - processKeyvals_kv
%I   - ifSetKey_kv, ifUnsetKey_kv, ifValidValue_kv
%I additional macros:
%I   - forRangeOfNumerics_kv

%D initialisation
if known keyval_module: endinput ; fi ;
boolean keyval_module ; keyval_module := true ;

%D
%D declaration of keyval variables
%D

def declareBooleanKeys_kv(text _keys_) =
	forsuffixes $=_keys_: save $ ; boolean $ ; endfor;
enddef;

def declareNumericKeys_kv(text _keys_) =
	forsuffixes $=_keys_: save $ ; numeric $ ; endfor;
enddef;

def declarePairKeys_kv(text _keys_) =
	forsuffixes $=_keys_: save $ ; pair $ ; endfor;
enddef;

def declarePenKeys_kv(text _keys_) =
	forsuffixes $=_keys_: save $ ; pen $ ; endfor;
enddef;

def declarePathKeys_kv(text _keys_) =
	forsuffixes $=_keys_: save $ ; path $ ; endfor;
enddef;

def declareColorKeys_kv(text _keys_) =
	forsuffixes $=_keys_: save $ ; color $ ; endfor;
enddef;

def declareStringKeys_kv(text _keys_) =
	forsuffixes $=_keys_: save $ ; string $ ; endfor;
enddef;

%D
%D declaration of keyval synonyms
%D

def declareBooleanSyns_kv(text _syns_)(text _vals_) =
	forsuffixes $=_syns_: save $ ; boolean $ ; endfor;
	processKeyvals_kv(_vals_) ;
enddef;

def declareNumericSyns_kv(text _syns_)(text _vals_) =
	forsuffixes $=_syns_: save $ ; numeric $ ; endfor;
	processKeyvals_kv(_vals_) ;
enddef;

def declarePairSyns_kv(text _syns_)(text _vals_) =
	forsuffixes $=_syns_: save $ ; pair $ ; endfor;
	processKeyvals_kv(_vals_) ;
enddef;

def declarePathSyns_kv(text _syns_)(text _vals_) =
	forsuffixes $=_syns_: save $ ; path $ ; endfor;
	processKeyvals_kv(_vals_) ;
enddef;

def declareColorSyns_kv(text _syns_)(text _vals_) =
	forsuffixes $=_syns_: save $ ; color $ ; endfor;
	processKeyvals_kv(_vals_) ;
enddef;


def declareStringSyns_kv(text _syns_)(text _vals_) =
	forsuffixes $=_syns_: save $ ; string $ ; endfor;
	processKeyvals_kv(_vals_) ;
enddef;


%D
%D the macros above do not contain commands for
%D variables of type 'picture'. The problem is
%D that the command that process the keyval-parameters
%D changes the definition of symbols ',','(' and ')',
%D but they might be used in a picture definition in
%D unexpected way.
%D Therefore it is possible to pass variable-names
%D but no picture-expression:
%D
%D picture pic ; pic:=image(...) and the usage as
%D keyvalFunc(logo=pic)
%D
%D will work. But
%D keyvalFunc(logo=image(...)) doesn't work as well as
%D keyvalFunc(logo=btex hallo etex)
%D
%D Thus, use keys of type picture only to get a picture
%D by variable-name. Since pictures are not really useful
%D as keys, i hope this is not a big lack in this package.

def declarePictureKeys_kv(text _keys_) =
	forsuffixes $=_keys_: save $ ; picture $ ; endfor;
enddef;

def declarePictureSyns_kv(text _syns_)(text _vals_) =
	forsuffixes $=_syns_: save $ ; picture $ ; endfor;
	processKeyvals_kv(_vals_) ;
enddef;

%D keyval processing
%D 
%D the following command could be really short and simple:
%D
%D def processKeyvals_kv (text kvps)=
%D	begingroup;
%D	save , ; let ,=; ;
%D	kvps ;
%D	endgroup;
%D enddef;
%D
%D this makes a list like:    'bla=1,bloob=2,foo="hey"'
%D work when executed like:   'bla=1;bloob=2;foo="hey"'
%D
%D This looks like MetaPost. The problem are values of 
%D type pair and color, since they include commas (1,2)
%D or (0.1,0.4,0.2).
%D
%D so the macro became a little bit longer and more complex

def processKeyvals_kv (text _kvps_)=
	begingroup;
	
	save _co ; let _co=, ;		
	save _lb ; let _lb=( ;
	save _rb ; let _rb=) ;

	save _lbrace_kv, _rbrace_kv, _comma_kv ;
	
	primarydef l _comma_kv r =
		begingroup
		save , ; let ,=_co ;
		save ) ; let )=_rb ;
		save c ;
		if (pair l):
			((xpart l),(ypart l), r) endgroup
		elseif (numeric l):
			(l,r) endgroup
		else
			errmessage "keyvalMP: don't use macros on key-value parameters"
		fi
	enddef;
	
	def _lbrace_kv =
		begingroup
		save , ; let ,=_comma_kv ;
		save ( ; let (=_lb ;
	enddef;
	
	def _rbrace_kv = endgroup enddef;
	
	save ( ; let (=_lbrace_kv ;
	save ) ; let )=_rbrace_kv ;
	
	save , ; let ,=; ;
	
	_kvps_ ;
	endgroup;
enddef;


%D
%D evaluate keyval settings
%D

def ifSetKey_kv(suffix _key_)(text _commands_)=
	if known _key_: _commands_ ; fi;
enddef;

def ifUnsetKey_kv(suffix _key_)(text _commands_)=
	if unknown _key_: _commands_ ; fi;
enddef;

def ifValidValue_kv(text _validvals_)(suffix _key_)(text _commands_) =
	begingroup;
	save _isvalid_ ; boolean _isvalid_ ; _isvalid_ := false ;
	if known _key_:
		for v=_validvals_:
			if _key_=v: _isvalid_:= true ; fi ;
		endfor;
		
		if _isvalid_:
			_commands_ ;
		else:
			errmessage ("No valid parameter given for " & (str _key_)) ;
		fi;
	fi ;
	endgroup;
enddef;


%D
%D  additional macros
%D

%D
%D expands numeric list like 1,3-6,8 to 1,3,4,5,6,8
%D

def forRangeOfNumerics_kv(text _nl_)(text _commands_) =
	begingroup;
	save kv_minus_, _minus_kv ; let kv_minus_=- ;
	
	primarydef l _minus_kv r =
		if l<r:
			for i=l upto r:
				i,
			endfor
		else:
			for i=l step kv_minus_1 until r:
				i,
			endfor		
		fi
	enddef;
	
	save - ; let -=_minus_kv ; 
	for i=_nl_:
		begingroup;
		save - ; let -=kv_minus_ ;
		_commands_ ;
		endgroup;
	endfor;
	endgroup;
enddef;

[-- Attachment #3: mpt-conf.mp --]
[-- Type: application/octet-stream, Size: 2470 bytes --]

% MPTricks - configuration macros



%%% init
if known mptricks_conf_module: endinput ; fi ;

boolean mptricks_conf_module ; mptricks_conf_module:=true ;
string mptricks_conf_version ; mptricks_conf_version:="0.0.1" ;

%%% dependencies
message_mpt("Loading keyval package") ; input keyvalmp ;


%%% attribute based drawoptions

boolean mpt_drawattributeState, mpt_drawattributeDashedState ;
picture mpt_drawattributeDashPattern ;
pen     mpt_drawattributePen ;
color   mpt_drawattributeColor ;

mpt_drawattributeState       := false ;
mpt_drawattributeDashedState := false ;
mpt_drawattributeDashPattern := evenly ;
mpt_drawattributePen         := currentpen ;
mpt_drawattributeColor       := black ;


def definePen_mpt(suffix p)(text t)=
  begingroup;
    save currentpen ; pen currentpen ;
    save pen_lft, pen_rt, pen_top, pen_bot, currentpen_path ;
    numeric pen_lft, pen_rt, pen_top, pen_bot ;
    path currentpen_path ;
    
    pen p ;
    pickup t ;
    p:=currentpen ;
  endgroup ;
enddef;

def defineDashPattern_mpt(suffix p)(text t)=
  picture p ;
  p:= t ;
enddef;

def setupDrawingAttributes_mpt(text kvps) =
  begingroup;

    save state_has_been_changed ; boolean state_has_been_changed ;
    state_has_been_changed := false ;

    save exec_drawoptions ; string exec_drawoptions ;
    exec_drawoptions:="drawoptions(" ;
    
    declareBooleanKeys_kv(State,Style) ;
    declareBooleanSyns_kv(Start,Stop)(Start=true,Stop=false) ;
    declareBooleanSyns_kv(Stroked,Dashed)(Stroked=false,Dashed=true) ;
    declareColorKeys_kv(Color) ;
    declarePictureKeys_kv(Pattern) ;
    declarePenKeys_kv(Pen) ;

    processKeyvals_kv(kvps) ;

    ifValidValue_kv(Start,Stop)(State)(
      mpt_drawattributeState:=State; state_has_been_changed:=true) ;
    ifValidValue_kv(Stroked,Dashed)(Style)(
      mpt_drawattributeDashedState:=Style) ;

    ifSetKey_kv(Color)(mpt_drawattributeColor:=Color) ;
    ifSetKey_kv(Pattern)(mpt_drawattributeDashPattern:=Pattern) ;
    ifSetKey_kv(Pen)(mpt_drawattributePen:=Pen) ;

    if state_has_been_changed and (not mpt_drawattributeState):
      drawoptions();
    fi;

    if mpt_drawattributeState:
      if mpt_drawattributeDashedState:
	exec_drawoptions:= exec_drawoptions &
	  "dashed mpt_drawattributeDashPattern ";
      fi;
      exec_drawoptions:= exec_drawoptions &
          "withpen mpt_drawattributePen withcolor mpt_drawattributeColor )";
      scantokens exec_drawoptions ;
    fi;
    
  endgroup;
enddef;


[-- Attachment #4: mpt-test.mp --]
[-- Type: application/octet-stream, Size: 736 bytes --]



input mptricks ;

definePen_mpt(MyPen)(pencircle scaled 8pt)

definePen_mpt(SquarePen)(pensquare scaled 6pt rotated 45)

defineDashPattern_mpt(MyPattern)(withdots) ;


path p ; p := origin--(8cm,0) ;

beginfig(1);

  draw p;
  
  setupDrawingAttributes_mpt(
    State=Start,
    Style=Dashed,
    Pen=MyPen,
    Pattern=MyPattern,
    Color=red) ;
  
  draw  p shifted (0,1cm) ;

  setupDrawingAttributes_mpt(Pen=SquarePen,Color=green) ;

  draw p shifted (0,2cm) ;

  setupDrawingAttributes_mpt(State=Stop,Pen=MyPen) ;
  
  draw p shifted (0,3cm) ;

  setupDrawingAttributes_mpt(State=Start,Style=Stroked) ;

  draw p shifted (0,4cm) ;

  setupDrawingAttributes_mpt(Style=Dashed,Color=blue) ;

  draw p shifted (0,5cm) ;
endfig;
end

[-- Attachment #5: mptricks.mp --]
[-- Type: application/octet-stream, Size: 339 bytes --]

% MPTricks

%%% init
if known mptricks_module: endinput ; fi ;
boolean mptricks_module ; mptricks_module:=true ;
string mptricks_version ; mptricks_version:="0.0.1" ;

string mpt_messagePrefix ; mpt_messagePrefix:="MPTricks: " ;
def message_mpt(expr msg) =
  message(mpt_messagePrefix & msg) ;
enddef;

%%% dependencies
input mpt-conf ;



^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re[6]: MetaTricks?
  2003-02-07 16:42         ` Re[4]: MetaTricks? Jens-Uwe Morawski
@ 2003-02-07 20:34           ` Giuseppe Bilotta
  2003-02-08  2:20             ` Jens-Uwe Morawski
  2003-02-08 20:00           ` Re[4]: MetaTricks? Hans Hagen
  1 sibling, 1 reply; 30+ messages in thread
From: Giuseppe Bilotta @ 2003-02-07 20:34 UTC (permalink / raw)


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!

-- 
Giuseppe "Oblomov" Bilotta

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: Re[6]: MetaTricks?
  2003-02-07 20:34           ` Re[6]: MetaTricks? Giuseppe Bilotta
@ 2003-02-08  2:20             ` Jens-Uwe Morawski
  2003-02-08 16:21               ` Denis Roegel
  0 siblings, 1 reply; 30+ messages in thread
From: Jens-Uwe Morawski @ 2003-02-08  2:20 UTC (permalink / raw)


On Fri, 7 Feb 2003 21:34:55 +0100
Giuseppe Bilotta <gip.bilotta@iol.it> 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.
I've never used PSTricks, esp since i think that the docu
is a mess.

Jens 

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: Re[6]: MetaTricks?
  2003-02-08  2:20             ` Jens-Uwe Morawski
@ 2003-02-08 16:21               ` Denis Roegel
  2003-02-08 19:23                 ` Hans Hagen
  2003-02-08 20:07                 ` Jens-Uwe Morawski
  0 siblings, 2 replies; 30+ messages in thread
From: Denis Roegel @ 2003-02-08 16:21 UTC (permalink / raw)
  Cc: 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 <gip.bilotta@iol.it> 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

I didn't study the details of your new implementation, but it looks
very promising. When you give options like `a=b', 
can a and b be defined as macros beforehand, or is that incompatible?
That's one of the problems I had in metaobj, hence my contrived
way of passing parameters. 

I am thinking that it would be nice if sometime in the future
we could have metaobj with your syntax for options. 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.
That's also why I found the metaobj syntax sufficient for my purpose

Denis

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: Re[6]: MetaTricks?
  2003-02-08 16:21               ` Denis Roegel
@ 2003-02-08 19:23                 ` Hans Hagen
  2003-02-08 23:18                   ` Jens-Uwe Morawski
  2003-02-08 20:07                 ` Jens-Uwe Morawski
  1 sibling, 1 reply; 30+ messages in thread
From: Hans Hagen @ 2003-02-08 19:23 UTC (permalink / raw)
  Cc: Denis Roegel

At 05:21 PM 2/8/2003 +0100, Denis Roegel wrote:
>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 <gip.bilotta@iol.it> 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
>
>I didn't study the details of your new implementation, but it looks
>very promising. When you give options like `a=b',
>can a and b be defined as macros beforehand, or is that incompatible?
>That's one of the problems I had in metaobj, hence my contrived
>way of passing parameters.
>
>I am thinking that it would be nice if sometime in the future
>we could have metaobj with your syntax for options. 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.
>That's also why I found the metaobj syntax sufficient for my purpose

in any case it makes sense to cook up a decent system for namespacing so 
that all those mpt, metaobj and metafun can work together

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: Re[4]: MetaTricks?
  2003-02-07 16:42         ` Re[4]: MetaTricks? Jens-Uwe Morawski
  2003-02-07 20:34           ` Re[6]: MetaTricks? Giuseppe Bilotta
@ 2003-02-08 20:00           ` Hans Hagen
  2003-02-10 15:36             ` Jens-Uwe Morawski
  1 sibling, 1 reply; 30+ messages in thread
From: Hans Hagen @ 2003-02-08 20:00 UTC (permalink / raw)


At 05:42 PM 2/7/2003 +0100, Jens-Uwe Morawski wrote:
>On Thu, 6 Feb 2003 23:35:14 +0100
>Giuseppe Bilotta <gip.bilotta@iol.it> wrote:
>
> > Thursday, February 6, 2003 Jens-Uwe Morawski wrote:
> >
> > JUM> as you know, PSTricks is a huge package, so where to start?
> >
>
> > In particular, there are a few things that I currently see as
> > "missing" in (plain) MetaPost (and which I couldn't find in
> > MetaFun either); for example, there is no macro that allows to
> > "add" drawoptions; you can only replace them altogether. PSTricks,
> > OTOH (at least for what I could see) has a default color, pensize
> > and line style which can be changed singularly (MetaPost seems to
> > only do this for the pen --currentpen; it doesn't have a
> > currentcolor or currentstyle).
>
>Do you mean something like in the attached files?
>keyvalmp.mp : package for key-value parameters in MP; used in mpt-conf.mp
>               (BTW, if anybody knows a better way to implement this, please
>                let me know)

nice example of expansion and redefinition of symbols

about this picture key/val problem: how about passing it as string, say

   SomePic=pic("picture stuff")

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: Re[6]: MetaTricks?
  2003-02-08 16:21               ` Denis Roegel
  2003-02-08 19:23                 ` Hans Hagen
@ 2003-02-08 20:07                 ` Jens-Uwe Morawski
  2003-02-08 21:10                   ` Denis Roegel
  1 sibling, 1 reply; 30+ messages in thread
From: Jens-Uwe Morawski @ 2003-02-08 20:07 UTC (permalink / raw)


On Sat, 8 Feb 2003 17:21:14 +0100
Denis Roegel <Denis.Roegel@loria.fr> wrote:

> 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 <gip.bilotta@iol.it> 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

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: Re[6]: MetaTricks?
  2003-02-08 20:07                 ` Jens-Uwe Morawski
@ 2003-02-08 21:10                   ` Denis Roegel
  2003-02-09 13:14                     ` Jens-Uwe Morawski
  0 siblings, 1 reply; 30+ messages in thread
From: Denis Roegel @ 2003-02-08 21:10 UTC (permalink / raw)
  Cc: Denis Roegel

On Sat, Feb 08, 2003 at 09:07:32PM +0100, Jens-Uwe Morawski wrote:

> > 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 ;)

Thanks, at least it was useful to provide ideas to others!

> My first implementation based also on strings, i.e.
> "logo=something,shape=anything"
> but this doesn't allow strings to be passed as values. 

Yes, but there are workarounds. If you always expect a string as a value,
and if this value doesn't contain commas, you can make it a string
afterwards. That is what I do in metaobj. For instance, what you just 
wrote becomes

  "logo(something)","shape(anything)"   (you get used to it, and a TeX interface 
                                         can hide it if necessary)

In cases where the value is a string, for instance when I specify the
drawing direction of a tree, I write "treemode(U)" for treemode="U",
but the parser knows to make a string of it.

I found that this works reasonably well and I don't have constraints
on my keys and values.

> it will not work, since metaobj relies on macros as values.

What example did you have in mind?

> Or would you like to rewrite metaobj completely? :)

Of course not. It took me a while to write it.

> if you hide MP with TeX code then you will loose the programming
> capabilities of MP. 

I was not thinking of hiding it completely, but just like in PSTricks
where one can mix TeX and PS, here one could mix TeX and MP. Actually,
this is already the case in ConTeXt when you embed MP code.

Denis

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: Re[6]: MetaTricks?
  2003-02-08 19:23                 ` Hans Hagen
@ 2003-02-08 23:18                   ` Jens-Uwe Morawski
  2003-02-09 18:18                     ` Hans Hagen
  0 siblings, 1 reply; 30+ messages in thread
From: Jens-Uwe Morawski @ 2003-02-08 23:18 UTC (permalink / raw)


On Sat, 08 Feb 2003 20:23:07 +0100
Hans Hagen <pragma@wxs.nl> wrote:


> in any case it makes sense to cook up a decent system for namespacing so 
> that all those mpt, metaobj and metafun can work together

currently i use a prefix for variables and a postfix for macros, i.e
mpt_VariableName or Macro_mpt for the mptricks package. The problem is
that it is useful for internal macros and variables but not for the
user interface.

Additionally, this problem is not only important in the ConTeXt arena,
so what do you think about opening a MetaPost or TeX-and-Graphics
mailinglist. There things like the current thread could be discussed.
Has anybody good conections, for example to NTG, to organize this.

Jens

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: Re[6]: MetaTricks?
  2003-02-08 21:10                   ` Denis Roegel
@ 2003-02-09 13:14                     ` Jens-Uwe Morawski
  2003-02-09 18:30                       ` Denis Roegel
  0 siblings, 1 reply; 30+ messages in thread
From: Jens-Uwe Morawski @ 2003-02-09 13:14 UTC (permalink / raw)


On Sat, 8 Feb 2003 22:10:22 +0100
Denis Roegel <Denis.Roegel@loria.fr> wrote:

> On Sat, Feb 08, 2003 at 09:07:32PM +0100, Jens-Uwe Morawski wrote:
> 
> > > 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 ;)
> 
> Thanks, at least it was useful to provide ideas to others!

IMO it is very useful for its task, esp since it has no
limitations like keyvalMP.
 
> > My first implementation based also on strings, i.e.
> > "logo=something,shape=anything"
> > but this doesn't allow strings to be passed as values. 
> 
> Yes, but there are workarounds. If you always expect a string as a value,
> and if this value doesn't contain commas, you can make it a string
> afterwards.

what are you doing here? Do you read the parameter as suffix and
convert it with 'str' in a string?

> That is what I do in metaobj. For instance, what you just 
> wrote becomes
> 
>   "logo(something)","shape(anything)"   (you get used to it, and a TeX interface 
>                                          can hide it if necessary)
> 
> In cases where the value is a string, for instance when I specify the
> drawing direction of a tree, I write "treemode(U)" for treemode="U",
> but the parser knows to make a string of it.
> 
> I found that this works reasonably well and I don't have constraints
> on my keys and values.

agree, but in case of a workaround i could use ';' as seperators
in the keyval-list and so all problems are gone:

YourKeyValMacro(logo=image(draw origin); shape=fullcircle scaled 2)

or one can use special symbols to mark strings

"logo=something,shape=anything,text=''some words'' "

But the question i had was to write a keyval package
that implements an interface the users know or are familiar with.

> > it will not work, since metaobj relies on macros as values.
> 
> What example did you have in mind?

nothing specific, but for example the treemode-thing you gave above;
here treemode is a macro and i believe that it does more than
assigning the parameter "U" to an internal variable. So you have to
rewrite many parts of metaobj. We can try it if you are interested but
currently keyvalMP is only used in 3 of my packages and none of them
is released. so, we need some testing and have to look if the
limitations allow all things required for meatobj to be implemented.

Jens 

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: Re[6]: MetaTricks?
  2003-02-08 23:18                   ` Jens-Uwe Morawski
@ 2003-02-09 18:18                     ` Hans Hagen
  2003-02-10 22:36                       ` Jens-Uwe Morawski
  0 siblings, 1 reply; 30+ messages in thread
From: Hans Hagen @ 2003-02-09 18:18 UTC (permalink / raw)


At 12:18 AM 2/9/2003 +0100, you wrote:
>On Sat, 08 Feb 2003 20:23:07 +0100
>Hans Hagen <pragma@wxs.nl> wrote:
>
>
> > in any case it makes sense to cook up a decent system for namespacing so
> > that all those mpt, metaobj and metafun can work together
>
>currently i use a prefix for variables and a postfix for macros, i.e
>mpt_VariableName or Macro_mpt for the mptricks package. The problem is
>that it is useful for internal macros and variables but not for the
>user interface.
>
>Additionally, this problem is not only important in the ConTeXt arena,
>so what do you think about opening a MetaPost or TeX-and-Graphics
>mailinglist. There things like the current thread could be discussed.
>Has anybody good conections, for example to NTG, to organize this.

getting an ntg list is no problem, as long as we keep that list low 
bandwidth, keep the context related questions on the context list, since  -)

something ntg-metapost for mp specific things sounds ok to me

Hans


-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: Re[6]: MetaTricks?
  2003-02-09 13:14                     ` Jens-Uwe Morawski
@ 2003-02-09 18:30                       ` Denis Roegel
  2003-02-10 15:05                         ` Jens-Uwe Morawski
  0 siblings, 1 reply; 30+ messages in thread
From: Denis Roegel @ 2003-02-09 18:30 UTC (permalink / raw)
  Cc: Denis Roegel

On Sun, Feb 09, 2003 at 02:14:19PM +0100, Jens-Uwe Morawski wrote:

> what are you doing here? Do you read the parameter as suffix and
> convert it with 'str' in a string?

I am working with strings only. If I have an option like "dx(1cm)",
somewhere there is an assignment ...dx=1cm, and if I have an option
like "treemode(U)", then somewhere I do ...treemode="U".
I am not using str in this case. For each option, I have a way to know
what is its expected type.

> But the question i had was to write a keyval package
> that implements an interface the users know or are familiar with.

I understand.

> nothing specific, but for example the treemode-thing you gave above;
> here treemode is a macro and i believe that it does more than
> assigning the parameter "U" to an internal variable. 

treemode is not really a macro, only the name of an option. There is a variable
corresponding to this option, but since it is local to a class, it has a name
such as Tree_treemode (I am simplifying, but that's the idea.) 
Actually, there is a default value, and then it can be overriden.

> So you have to rewrite many parts of metaobj. 

I am actually not sure of that. When I setup options or when I create an object,
I am parsing the options and making a number of assignments. That's basically it.
I think that the changes would be very much isolated.
It would be worth having a look, but I am a bit busy these days. I could 
take out of metaobj what has to be changed. There is very little, I think.

Denis

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: Re[6]: MetaTricks?
  2003-02-09 18:30                       ` Denis Roegel
@ 2003-02-10 15:05                         ` Jens-Uwe Morawski
  0 siblings, 0 replies; 30+ messages in thread
From: Jens-Uwe Morawski @ 2003-02-10 15:05 UTC (permalink / raw)


On Sun, 9 Feb 2003 19:30:00 +0100
Denis Roegel <Denis.Roegel@loria.fr> wrote:

> On Sun, Feb 09, 2003 at 02:14:19PM +0100, Jens-Uwe Morawski wrote:

> > So you have to rewrite many parts of metaobj. 
> 
> I am actually not sure of that. When I setup options or when I create an object,
> I am parsing the options and making a number of assignments. That's basically it.
> I think that the changes would be very much isolated.
> It would be worth having a look, but I am a bit busy these days. I could 
> take out of metaobj what has to be changed. There is very little, I think.

Our discussion inspired me to try another, string-based keyval implementation.
It allows different kind of parameters, so one can mix them all together:

YourKeyValFunction "state=start,color=blue","treemode(U)","framed(r),dashes=off"

or
YourKeyValFunction "state=start,color=blue,dashes=off","treemode(U),framed(r)"

i'm currently working on the string-parser and after i've finished some
additional macros that make writing key/val macros easier i will post
it here. Then we can dicuss the pros and cons and you can pick the package
you prefer.

Jens

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: Re[4]: MetaTricks?
  2003-02-08 20:00           ` Re[4]: MetaTricks? Hans Hagen
@ 2003-02-10 15:36             ` Jens-Uwe Morawski
  0 siblings, 0 replies; 30+ messages in thread
From: Jens-Uwe Morawski @ 2003-02-10 15:36 UTC (permalink / raw)


On Sat, 08 Feb 2003 21:00:00 +0100
Hans Hagen <pragma@wxs.nl> wrote:

> At 05:42 PM 2/7/2003 +0100, Jens-Uwe Morawski wrote:

> >Do you mean something like in the attached files?
> >keyvalmp.mp : package for key-value parameters in MP; used in mpt-conf.mp
> >               (BTW, if anybody knows a better way to implement this, please
> >                let me know)
> 
> nice example of expansion and redefinition of symbols
> 
> about this picture key/val problem: how about passing it as string, say
> 
>    SomePic=pic("picture stuff")

in keyvalmp.mp i've simplified the problem to picture-keys, since the
problem will occur mostly in those cases.

But the problem exists for all given values that contain groups of (...)
where the (...) is not a pair or color.

For example, using MetaFun, even foreground=cmyk(1,0,1,0) does not work.
  (BTW, this problem with a list of 4 numerics in a (...) could be solved,
   but not if the (...) contains a list of 5 and more numerics)

Therefore i prefer something like:

defineLogo(MyLogo)(
  label("some text",origin) ;
  ) ;

TheKeyValMacro(logo=MyLogo) ;

In contrast to your suggestion, here one can use strings in the picture
expression.

Jens

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: Re[6]: MetaTricks?
  2003-02-09 18:18                     ` Hans Hagen
@ 2003-02-10 22:36                       ` Jens-Uwe Morawski
  2003-02-12 12:25                         ` Hans Hagen
  0 siblings, 1 reply; 30+ messages in thread
From: Jens-Uwe Morawski @ 2003-02-10 22:36 UTC (permalink / raw)


On Sun, 09 Feb 2003 19:18:31 +0100
Hans Hagen <pragma@wxs.nl> wrote:

> At 12:18 AM 2/9/2003 +0100, you wrote:
> >On Sat, 08 Feb 2003 20:23:07 +0100
> >Hans Hagen <pragma@wxs.nl> wrote:
> >
> >
> > > in any case it makes sense to cook up a decent system for namespacing so
> > > that all those mpt, metaobj and metafun can work together
> >
> >currently i use a prefix for variables and a postfix for macros, i.e
> >mpt_VariableName or Macro_mpt for the mptricks package. The problem is
> >that it is useful for internal macros and variables but not for the
> >user interface.
> >
> >Additionally, this problem is not only important in the ConTeXt arena,
> >so what do you think about opening a MetaPost or TeX-and-Graphics
> >mailinglist. There things like the current thread could be discussed.
> >Has anybody good conections, for example to NTG, to organize this.
> 
> getting an ntg list is no problem, as long as we keep that list low 
> bandwidth, keep the context related questions on the context list, since  -)
> 
> something ntg-metapost for mp specific things sounds ok to me

could you ask for this list?

Jens

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: Re[6]: MetaTricks?
  2003-02-10 22:36                       ` Jens-Uwe Morawski
@ 2003-02-12 12:25                         ` Hans Hagen
  2003-02-12 14:25                           ` Jens-Uwe Morawski
  2003-02-12 18:28                           ` Denis Roegel
  0 siblings, 2 replies; 30+ messages in thread
From: Hans Hagen @ 2003-02-12 12:25 UTC (permalink / raw)


Hi

>could you ask for this list?

in progress: metapost@ntg.nl

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: Re[6]: MetaTricks?
  2003-02-12 12:25                         ` Hans Hagen
@ 2003-02-12 14:25                           ` Jens-Uwe Morawski
  2003-02-12 18:28                           ` Denis Roegel
  1 sibling, 0 replies; 30+ messages in thread
From: Jens-Uwe Morawski @ 2003-02-12 14:25 UTC (permalink / raw)


On Wed, 12 Feb 2003 13:25:25 +0100
Hans Hagen <pragma@wxs.nl> wrote:

> >could you ask for this list?
> 
> in progress: metapost@ntg.nl

it's available, see http://www.ntg.nl/mailman/listinfo/metapost

Many thanks.

Jens

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: Re[6]: MetaTricks?
  2003-02-12 12:25                         ` Hans Hagen
  2003-02-12 14:25                           ` Jens-Uwe Morawski
@ 2003-02-12 18:28                           ` Denis Roegel
  2003-02-13  0:22                             ` Jens-Uwe Morawski
  1 sibling, 1 reply; 30+ messages in thread
From: Denis Roegel @ 2003-02-12 18:28 UTC (permalink / raw)
  Cc: Denis Roegel

On Wed, Feb 12, 2003 at 01:25:25PM +0100, Hans Hagen wrote:
> Hi
> 
> >could you ask for this list?
> 
> in progress: metapost@ntg.nl

What about the list metafont@ens.fr which was also used for metapost
related questions? Was it really necessary to create a new list?

Denis

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: Re[6]: MetaTricks?
  2003-02-12 18:28                           ` Denis Roegel
@ 2003-02-13  0:22                             ` Jens-Uwe Morawski
  2003-02-13  0:58                               ` Denis Roegel
  2003-02-13 10:53                               ` Hans Hagen
  0 siblings, 2 replies; 30+ messages in thread
From: Jens-Uwe Morawski @ 2003-02-13  0:22 UTC (permalink / raw)


On Wed, 12 Feb 2003 19:28:28 +0100
Denis Roegel <Denis.Roegel@loria.fr> wrote:

> On Wed, Feb 12, 2003 at 01:25:25PM +0100, Hans Hagen wrote:
> > Hi
> > 
> > >could you ask for this list?
> > 
> > in progress: metapost@ntg.nl
> 
> What about the list metafont@ens.fr which was also used for metapost
> related questions? Was it really necessary to create a new list?

I've ask for opinions about creating a new list. The only answer came
from Hans.

Is it really a problem to have a dedicated MP-list? Many MP questions are
not interesting to MF users and vice versa. The new list will be a low
traffic list. Thus, subscriptions to both should cause not much trouble.

Jens

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: Re[6]: MetaTricks?
  2003-02-13  0:22                             ` Jens-Uwe Morawski
@ 2003-02-13  0:58                               ` Denis Roegel
  2003-02-13 10:51                                 ` Jens-Uwe Morawski
  2003-02-13 10:52                                 ` Hans Hagen
  2003-02-13 10:53                               ` Hans Hagen
  1 sibling, 2 replies; 30+ messages in thread
From: Denis Roegel @ 2003-02-13  0:58 UTC (permalink / raw)
  Cc: Denis Roegel

On Thu, Feb 13, 2003 at 01:22:26AM +0100, Jens-Uwe Morawski wrote:
> Is it really a problem to have a dedicated MP-list? Many MP questions are
> not interesting to MF users and vice versa. The new list will be a low
> traffic list. Thus, subscriptions to both should cause not much trouble.

It's not a problem for me, but since the metafont/metapost list traffic
is already very low, I was wondering whether it would be necessary
to split it. Btw, would metafont questions be accepted on the new list?

Denis

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: Re[6]: MetaTricks?
  2003-02-13  0:58                               ` Denis Roegel
@ 2003-02-13 10:51                                 ` Jens-Uwe Morawski
  2003-02-13 10:52                                 ` Hans Hagen
  1 sibling, 0 replies; 30+ messages in thread
From: Jens-Uwe Morawski @ 2003-02-13 10:51 UTC (permalink / raw)


On Thu, 13 Feb 2003 01:58:05 +0100
Denis Roegel <Denis.Roegel@loria.fr> wrote:

> On Thu, Feb 13, 2003 at 01:22:26AM +0100, Jens-Uwe Morawski wrote:
> > Is it really a problem to have a dedicated MP-list? Many MP questions are
> > not interesting to MF users and vice versa. The new list will be a low
> > traffic list. Thus, subscriptions to both should cause not much trouble.
> 
> It's not a problem for me, but since the metafont/metapost list traffic
> is already very low, I was wondering whether it would be necessary
> to split it.

Hmm, it was not a split for me. I've ask in some news groups and mailing
lists if somebody can tell me a mailing list for MP. I've never got an
answer.

> Btw, would metafont questions be accepted on the new list?

Dont ask me, i'm not the master of the list. ;)
I would accept them, esp since MF and MP share some concepts.
I would even accept LaTeX and ConTeXt questions that are related to
MetaPost.

IMO, we should give this list a chance. There are already 12 subscribers
after i've have announced it at TeX-D-L (a german TeX mailing list)
yesterday. So, there seems to be some interest.

Best,
  Jens 

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: Re[6]: MetaTricks?
  2003-02-13  0:58                               ` Denis Roegel
  2003-02-13 10:51                                 ` Jens-Uwe Morawski
@ 2003-02-13 10:52                                 ` Hans Hagen
  1 sibling, 0 replies; 30+ messages in thread
From: Hans Hagen @ 2003-02-13 10:52 UTC (permalink / raw)


At 01:58 AM 2/13/2003 +0100, you wrote:
>On Thu, Feb 13, 2003 at 01:22:26AM +0100, Jens-Uwe Morawski wrote:
> > Is it really a problem to have a dedicated MP-list? Many MP questions are
> > not interesting to MF users and vice versa. The new list will be a low
> > traffic list. Thus, subscriptions to both should cause not much trouble.
>
>It's not a problem for me, but since the metafont/metapost list traffic
>is already very low, I was wondering whether it would be necessary
>to split it. Btw, would metafont questions be accepted on the new list?

no, just focus on mp

Hans


-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: Re[6]: MetaTricks?
  2003-02-13  0:22                             ` Jens-Uwe Morawski
  2003-02-13  0:58                               ` Denis Roegel
@ 2003-02-13 10:53                               ` Hans Hagen
  1 sibling, 0 replies; 30+ messages in thread
From: Hans Hagen @ 2003-02-13 10:53 UTC (permalink / raw)


At 01:22 AM 2/13/2003 +0100, you wrote:
>On Wed, 12 Feb 2003 19:28:28 +0100
>Denis Roegel <Denis.Roegel@loria.fr> wrote:
>
> > On Wed, Feb 12, 2003 at 01:25:25PM +0100, Hans Hagen wrote:
> > > Hi
> > >
> > > >could you ask for this list?
> > >
> > > in progress: metapost@ntg.nl
> >
> > What about the list metafont@ens.fr which was also used for metapost
> > related questions? Was it really necessary to create a new list?
>
>I've ask for opinions about creating a new list. The only answer came
>from Hans.
>
>Is it really a problem to have a dedicated MP-list? Many MP questions are
>not interesting to MF users and vice versa. The new list will be a low
>traffic list. Thus, subscriptions to both should cause not much trouble.

the list is already there fo ra few days, but not yet moderated

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2003-02-13 10:53 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-05 21:38 MetaTricks? Giuseppe Bilotta
2003-02-06 13:16 ` MetaTricks? Jens-Uwe Morawski
2003-02-06 14:29   ` Re[2]: MetaTricks? Giuseppe Bilotta
2003-02-06 16:49     ` Jens-Uwe Morawski
2003-02-06 22:35       ` Re[4]: MetaTricks? Giuseppe Bilotta
2003-02-06 23:03         ` MetaTricks? Denis Roegel
2003-02-06 23:14           ` Re[2]: MetaTricks? Giuseppe Bilotta
2003-02-07 16:42         ` Re[4]: MetaTricks? Jens-Uwe Morawski
2003-02-07 20:34           ` Re[6]: MetaTricks? Giuseppe Bilotta
2003-02-08  2:20             ` Jens-Uwe Morawski
2003-02-08 16:21               ` Denis Roegel
2003-02-08 19:23                 ` Hans Hagen
2003-02-08 23:18                   ` Jens-Uwe Morawski
2003-02-09 18:18                     ` Hans Hagen
2003-02-10 22:36                       ` Jens-Uwe Morawski
2003-02-12 12:25                         ` Hans Hagen
2003-02-12 14:25                           ` Jens-Uwe Morawski
2003-02-12 18:28                           ` Denis Roegel
2003-02-13  0:22                             ` Jens-Uwe Morawski
2003-02-13  0:58                               ` Denis Roegel
2003-02-13 10:51                                 ` Jens-Uwe Morawski
2003-02-13 10:52                                 ` Hans Hagen
2003-02-13 10:53                               ` Hans Hagen
2003-02-08 20:07                 ` Jens-Uwe Morawski
2003-02-08 21:10                   ` Denis Roegel
2003-02-09 13:14                     ` Jens-Uwe Morawski
2003-02-09 18:30                       ` Denis Roegel
2003-02-10 15:05                         ` Jens-Uwe Morawski
2003-02-08 20:00           ` Re[4]: MetaTricks? Hans Hagen
2003-02-10 15:36             ` Jens-Uwe Morawski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).