ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Metfun macro for triangle
@ 2011-03-24  8:59 Otared Kavian
  2011-03-24  9:29 ` Stefan Müller
  0 siblings, 1 reply; 6+ messages in thread
From: Otared Kavian @ 2011-03-24  8:59 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi all,

I have a document in which I must draw several triangles for which two summits, say z0, z1, and the length of the two other sides are known, so that the third summit, say z2, is completly determined.
In order to draw one triangle the following works fine:

\setupcolors[state=start]
\starttext
\startMPcode
	z0 = (0cm,0cm) ;
	z1 = (5cm,0cm) ;
	path p, q ;	
	pickup pencircle scaled 2mm ;
	drawdot z0 ;
	drawdot z1 ;
	p := halfcircle scaled 8 cm ; % twice the length of the second side at z0
	p := p shifted z0 ;
	q := halfcircle scaled 6 cm ;  % twice the length of the second side at z1
	q := q shifted z1  ;
	z2 = p intersectionpoint q ;
	drawdot z2 ;
	pickup pencircle scaled 1mm ;
	draw z0--z1--z2--cycle withcolor blue ;
\stopMPcode
\stoptext

However I would like to have a macro, for instance named Triangle, which accepts four arguments z0,z1, length_1, length_2, so that in a MetaPost code i can use
	draw Triangle(z0,z1, 4, 3) withcolor blue ;
in order to draw the above triangle. 
Has anyone any idea about how to do this?

Thanks in advance for your help: OK
___________________________________________________________________________________
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
___________________________________________________________________________________


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

* Re: Metfun macro for triangle
  2011-03-24  8:59 Metfun macro for triangle Otared Kavian
@ 2011-03-24  9:29 ` Stefan Müller
  2011-03-24  9:57   ` Otared Kavian
  0 siblings, 1 reply; 6+ messages in thread
From: Stefan Müller @ 2011-03-24  9:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi,

what about

\startMPdefinitions
	vardef Triangle(expr za, zb, la, lb) =
		path p, q ;
		pair zc ;
		pickup pencircle scaled 2mm ;
		drawdot za ;
		drawdot zb ;
		p := fullcircle scaled la shifted za ;
		q := fullcircle scaled lb shifted zb ;
		zc = p intersectionpoint q ;
		drawdot zc ;
		pickup pencircle scaled 1mm ;
		za--zb--zc--cycle
	enddef;
\stopMPdefinitions

\starttext
\startMPcode
	draw Triangle((0cm,0cm), (5cm,0cm), 8cm, 6cm) withcolor blue ;	
\stopMPcode
\stoptext

Stefan

On 24.03.2011 09:59, Otared Kavian wrote:
> Hi all,
>
> I have a document in which I must draw several triangles for which two summits, say z0, z1, and the length of the two other sides are known, so that the third summit, say z2, is completly determined.
> In order to draw one triangle the following works fine:
>
> \setupcolors[state=start]
> \starttext
> \startMPcode
> 	z0 = (0cm,0cm) ;
> 	z1 = (5cm,0cm) ;
> 	path p, q ;	
> 	pickup pencircle scaled 2mm ;
> 	drawdot z0 ;
> 	drawdot z1 ;
> 	p := halfcircle scaled 8 cm ; % twice the length of the second side at z0
> 	p := p shifted z0 ;
> 	q := halfcircle scaled 6 cm ;  % twice the length of the second side at z1
> 	q := q shifted z1  ;
> 	z2 = p intersectionpoint q ;
> 	drawdot z2 ;
> 	pickup pencircle scaled 1mm ;
> 	draw z0--z1--z2--cycle withcolor blue ;
> \stopMPcode
> \stoptext
>
> However I would like to have a macro, for instance named Triangle, which accepts four arguments z0,z1, length_1, length_2, so that in a MetaPost code i can use
> 	draw Triangle(z0,z1, 4, 3) withcolor blue ;
> in order to draw the above triangle.
> Has anyone any idea about how to do this?
>
> Thanks in advance for your help: OK
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________
>
___________________________________________________________________________________
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
___________________________________________________________________________________


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

* Re: Metfun macro for triangle
  2011-03-24  9:29 ` Stefan Müller
@ 2011-03-24  9:57   ` Otared Kavian
  2011-03-24 10:29     ` Stefan Müller
  0 siblings, 1 reply; 6+ messages in thread
From: Otared Kavian @ 2011-03-24  9:57 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi Stefan,

Thanks for the quick answer and solution!
Your solution works perfectly in mkiv; however typesetting with mkii results in
	! Undefined control sequence.
	l.3 \startMPdefinitions
Is there a solution with mkii?

May I ask one more question?
In the macro you wrote
		Triangle((0cm,0cm), (5cm,0cm), 8cm, 6cm)
one has to specify the double of the length of each side (because a unit circle in MetaPost is a circle having diameter one). Would it be possible to change slightly the lines
		p := fullcircle scaled la shifted za ;
		q := fullcircle scaled lb shifted zb ;
so that la and lb are replaced with their doubled values? I tried
		p := fullcircle scaled 2*la shifted za ;
but this does not work.

Thanks for your attention: OK

On 24 mars 2011, at 10:29, Stefan Müller wrote:

> Hi,
> 
> what about
> 
> \startMPdefinitions
> 	vardef Triangle(expr za, zb, la, lb) =
> 		path p, q ;
> 		pair zc ;
> 		pickup pencircle scaled 2mm ;
> 		drawdot za ;
> 		drawdot zb ;
> 		p := fullcircle scaled la shifted za ;
> 		q := fullcircle scaled lb shifted zb ;
> 		zc = p intersectionpoint q ;
> 		drawdot zc ;
> 		pickup pencircle scaled 1mm ;
> 		za--zb--zc--cycle
> 	enddef;
> \stopMPdefinitions
> 
> \starttext
> \startMPcode
> 	draw Triangle((0cm,0cm), (5cm,0cm), 8cm, 6cm) withcolor blue ;	
> \stopMPcode
> \stoptext
> 
> Stefan
> 
> On 24.03.2011 09:59, Otared Kavian wrote:
>> Hi all,
>> 
>> I have a document in which I must draw several triangles for which two summits, say z0, z1, and the length of the two other sides are known, so that the third summit, say z2, is completly determined.
>> In order to draw one triangle the following works fine:
>> 
>> \setupcolors[state=start]
>> \starttext
>> \startMPcode
>> 	z0 = (0cm,0cm) ;
>> 	z1 = (5cm,0cm) ;
>> 	path p, q ;	
>> 	pickup pencircle scaled 2mm ;
>> 	drawdot z0 ;
>> 	drawdot z1 ;
>> 	p := halfcircle scaled 8 cm ; % twice the length of the second side at z0
>> 	p := p shifted z0 ;
>> 	q := halfcircle scaled 6 cm ;  % twice the length of the second side at z1
>> 	q := q shifted z1  ;
>> 	z2 = p intersectionpoint q ;
>> 	drawdot z2 ;
>> 	pickup pencircle scaled 1mm ;
>> 	draw z0--z1--z2--cycle withcolor blue ;
>> \stopMPcode
>> \stoptext
>> 
>> However I would like to have a macro, for instance named Triangle, which accepts four arguments z0,z1, length_1, length_2, so that in a MetaPost code i can use
>> 	draw Triangle(z0,z1, 4, 3) withcolor blue ;
>> in order to draw the above triangle.
>> Has anyone any idea about how to do this?
>> 
>> Thanks in advance for your help: OK
>> ___________________________________________________________________________________
>> 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
>> ___________________________________________________________________________________
>> 
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________

%%%%%%%%%%%%%%%%%%
Otared Kavian
Département de Mathématiques
Université de Versailles Saint-Quentin
Bâtiment Fermat
45 avenue des Etats Unis
78035 Versailles cedex

Téléphone: +33 1 39 25 46 42
Secrétariat: +33 1 39 25 46 44 
Secrétariat: +33 1 39 25 46 46

e-mail: Otared.Kavian@math.uvsq.fr




___________________________________________________________________________________
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
___________________________________________________________________________________


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

* Re: Metfun macro for triangle
  2011-03-24  9:57   ` Otared Kavian
@ 2011-03-24 10:29     ` Stefan Müller
  2011-03-24 13:16       ` Otared Kavian
  2011-03-24 14:14       ` Aditya Mahajan
  0 siblings, 2 replies; 6+ messages in thread
From: Stefan Müller @ 2011-03-24 10:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users



On 24.03.2011 10:57, Otared Kavian wrote:
> Hi Stefan,
>
> Thanks for the quick answer and solution!
> Your solution works perfectly in mkiv; however typesetting with mkii results in
> 	! Undefined control sequence.
> 	l.3 \startMPdefinitions
> Is there a solution with mkii?

Then just drop the MPdefinitions section and put the complete vardef 
before your normal mp code in the MPcode section. That should work, I think.

> May I ask one more question?
> In the macro you wrote
> 		Triangle((0cm,0cm), (5cm,0cm), 8cm, 6cm)
> one has to specify the double of the length of each side (because a unit circle in MetaPost is a circle having diameter one). Would it be possible to change slightly the lines

Now that's strange... But I see what you mean. I didn't notice.

> 		p := fullcircle scaled la shifted za ;
> 		q := fullcircle scaled lb shifted zb ;
> so that la and lb are replaced with their doubled values? I tried
> 		p := fullcircle scaled 2*la shifted za ;

Yeah, you need parentheses here, because otherwise Metapost tries to 
scale by 2 and then doesn't know how to multiply the result (the path 
"fullcircle scaled 2") with "la".

		p := fullcircle scaled (2 * la) shifted za ;
		q := fullcircle scaled (2 * lb) shifted zb ;


> but this does not work.
>
> Thanks for your attention: OK

np, Stefan.

> On 24 mars 2011, at 10:29, Stefan Müller wrote:
>
>> Hi,
>>
>> what about
>>
>> \startMPdefinitions
>> 	vardef Triangle(expr za, zb, la, lb) =
>> 		path p, q ;
>> 		pair zc ;
>> 		pickup pencircle scaled 2mm ;
>> 		drawdot za ;
>> 		drawdot zb ;
>> 		p := fullcircle scaled la shifted za ;
>> 		q := fullcircle scaled lb shifted zb ;
>> 		zc = p intersectionpoint q ;
>> 		drawdot zc ;
>> 		pickup pencircle scaled 1mm ;
>> 		za--zb--zc--cycle
>> 	enddef;
>> \stopMPdefinitions
>>
>> \starttext
>> \startMPcode
>> 	draw Triangle((0cm,0cm), (5cm,0cm), 8cm, 6cm) withcolor blue ;	
>> \stopMPcode
>> \stoptext
>>
>> Stefan
>>
>> On 24.03.2011 09:59, Otared Kavian wrote:
>>> Hi all,
>>>
>>> I have a document in which I must draw several triangles for which two summits, say z0, z1, and the length of the two other sides are known, so that the third summit, say z2, is completly determined.
>>> In order to draw one triangle the following works fine:
>>>
>>> \setupcolors[state=start]
>>> \starttext
>>> \startMPcode
>>> 	z0 = (0cm,0cm) ;
>>> 	z1 = (5cm,0cm) ;
>>> 	path p, q ;	
>>> 	pickup pencircle scaled 2mm ;
>>> 	drawdot z0 ;
>>> 	drawdot z1 ;
>>> 	p := halfcircle scaled 8 cm ; % twice the length of the second side at z0
>>> 	p := p shifted z0 ;
>>> 	q := halfcircle scaled 6 cm ;  % twice the length of the second side at z1
>>> 	q := q shifted z1  ;
>>> 	z2 = p intersectionpoint q ;
>>> 	drawdot z2 ;
>>> 	pickup pencircle scaled 1mm ;
>>> 	draw z0--z1--z2--cycle withcolor blue ;
>>> \stopMPcode
>>> \stoptext
>>>
>>> However I would like to have a macro, for instance named Triangle, which accepts four arguments z0,z1, length_1, length_2, so that in a MetaPost code i can use
>>> 	draw Triangle(z0,z1, 4, 3) withcolor blue ;
>>> in order to draw the above triangle.
>>> Has anyone any idea about how to do this?
>>>
>>> Thanks in advance for your help: OK
>>> ___________________________________________________________________________________
>>> 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
>>> ___________________________________________________________________________________
>>>
>> ___________________________________________________________________________________
>> 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
>> ___________________________________________________________________________________
>
> %%%%%%%%%%%%%%%%%%
> Otared Kavian
> Département de Mathématiques
> Université de Versailles Saint-Quentin
> Bâtiment Fermat
> 45 avenue des Etats Unis
> 78035 Versailles cedex
>
> Téléphone: +33 1 39 25 46 42
> Secrétariat: +33 1 39 25 46 44
> Secrétariat: +33 1 39 25 46 46
>
> e-mail: Otared.Kavian@math.uvsq.fr
>
>
>
>
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________
>
___________________________________________________________________________________
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
___________________________________________________________________________________


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

* Re: Metfun macro for triangle
  2011-03-24 10:29     ` Stefan Müller
@ 2011-03-24 13:16       ` Otared Kavian
  2011-03-24 14:14       ` Aditya Mahajan
  1 sibling, 0 replies; 6+ messages in thread
From: Otared Kavian @ 2011-03-24 13:16 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 6456 bytes --]

Hi Stefan,

Thanks for your explanations: everything works as expected and your solution is very instructive for me.
Later this weekend I'll put it on the wiki.

Have a nice day.
Best regards: OK

On 24 mars 2011, at 11:29, Stefan Müller wrote:

> 
> 
> On 24.03.2011 10:57, Otared Kavian wrote:
>> Hi Stefan,
>> 
>> Thanks for the quick answer and solution!
>> Your solution works perfectly in mkiv; however typesetting with mkii results in
>> 	! Undefined control sequence.
>> 	l.3 \startMPdefinitions
>> Is there a solution with mkii?
> 
> Then just drop the MPdefinitions section and put the complete vardef before your normal mp code in the MPcode section. That should work, I think.
> 
>> May I ask one more question?
>> In the macro you wrote
>> 		Triangle((0cm,0cm), (5cm,0cm), 8cm, 6cm)
>> one has to specify the double of the length of each side (because a unit circle in MetaPost is a circle having diameter one). Would it be possible to change slightly the lines
> 
> Now that's strange... But I see what you mean. I didn't notice.
> 
>> 		p := fullcircle scaled la shifted za ;
>> 		q := fullcircle scaled lb shifted zb ;
>> so that la and lb are replaced with their doubled values? I tried
>> 		p := fullcircle scaled 2*la shifted za ;
> 
> Yeah, you need parentheses here, because otherwise Metapost tries to scale by 2 and then doesn't know how to multiply the result (the path "fullcircle scaled 2") with "la".
> 
> 		p := fullcircle scaled (2 * la) shifted za ;
> 		q := fullcircle scaled (2 * lb) shifted zb ;
> 
> 
>> but this does not work.
>> 
>> Thanks for your attention: OK
> 
> np, Stefan.
> 
>> On 24 mars 2011, at 10:29, Stefan Müller wrote:
>> 
>>> Hi,
>>> 
>>> what about
>>> 
>>> \startMPdefinitions
>>> 	vardef Triangle(expr za, zb, la, lb) =
>>> 		path p, q ;
>>> 		pair zc ;
>>> 		pickup pencircle scaled 2mm ;
>>> 		drawdot za ;
>>> 		drawdot zb ;
>>> 		p := fullcircle scaled la shifted za ;
>>> 		q := fullcircle scaled lb shifted zb ;
>>> 		zc = p intersectionpoint q ;
>>> 		drawdot zc ;
>>> 		pickup pencircle scaled 1mm ;
>>> 		za--zb--zc--cycle
>>> 	enddef;
>>> \stopMPdefinitions
>>> 
>>> \starttext
>>> \startMPcode
>>> 	draw Triangle((0cm,0cm), (5cm,0cm), 8cm, 6cm) withcolor blue ;	
>>> \stopMPcode
>>> \stoptext
>>> 
>>> Stefan
>>> 
>>> On 24.03.2011 09:59, Otared Kavian wrote:
>>>> Hi all,
>>>> 
>>>> I have a document in which I must draw several triangles for which two summits, say z0, z1, and the length of the two other sides are known, so that the third summit, say z2, is completly determined.
>>>> In order to draw one triangle the following works fine:
>>>> 
>>>> \setupcolors[state=start]
>>>> \starttext
>>>> \startMPcode
>>>> 	z0 = (0cm,0cm) ;
>>>> 	z1 = (5cm,0cm) ;
>>>> 	path p, q ;	
>>>> 	pickup pencircle scaled 2mm ;
>>>> 	drawdot z0 ;
>>>> 	drawdot z1 ;
>>>> 	p := halfcircle scaled 8 cm ; % twice the length of the second side at z0
>>>> 	p := p shifted z0 ;
>>>> 	q := halfcircle scaled 6 cm ;  % twice the length of the second side at z1
>>>> 	q := q shifted z1  ;
>>>> 	z2 = p intersectionpoint q ;
>>>> 	drawdot z2 ;
>>>> 	pickup pencircle scaled 1mm ;
>>>> 	draw z0--z1--z2--cycle withcolor blue ;
>>>> \stopMPcode
>>>> \stoptext
>>>> 
>>>> However I would like to have a macro, for instance named Triangle, which accepts four arguments z0,z1, length_1, length_2, so that in a MetaPost code i can use
>>>> 	draw Triangle(z0,z1, 4, 3) withcolor blue ;
>>>> in order to draw the above triangle.
>>>> Has anyone any idea about how to do this?
>>>> 
>>>> Thanks in advance for your help: OK
>>>> ___________________________________________________________________________________
>>>> 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
>>>> ___________________________________________________________________________________
>>>> 
>>> ___________________________________________________________________________________
>>> 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
>>> ___________________________________________________________________________________
>> 
>> %%%%%%%%%%%%%%%%%%
>> Otared Kavian
>> Département de Mathématiques
>> Université de Versailles Saint-Quentin
>> Bâtiment Fermat
>> 45 avenue des Etats Unis
>> 78035 Versailles cedex
>> 
>> Téléphone: +33 1 39 25 46 42
>> Secrétariat: +33 1 39 25 46 44
>> Secrétariat: +33 1 39 25 46 46
>> 
>> e-mail: Otared.Kavian@math.uvsq.fr
>> 
>> 
>> 
>> 
>> ___________________________________________________________________________________
>> 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
>> ___________________________________________________________________________________
>> 
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________

%%%%%%%%%%%%%%%%%%
Otared Kavian
Département de Mathématiques
Université de Versailles Saint-Quentin
Bâtiment Fermat
45 avenue des Etats Unis
78035 Versailles cedex

Téléphone: +33 1 39 25 46 42
Secrétariat: +33 1 39 25 46 44 
Secrétariat: +33 1 39 25 46 46

e-mail: Otared.Kavian@math.uvsq.fr





[-- Attachment #1.2: Type: text/html, Size: 21586 bytes --]

[-- Attachment #2: Type: text/plain, Size: 486 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

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

* Re: Metfun macro for triangle
  2011-03-24 10:29     ` Stefan Müller
  2011-03-24 13:16       ` Otared Kavian
@ 2011-03-24 14:14       ` Aditya Mahajan
  1 sibling, 0 replies; 6+ messages in thread
From: Aditya Mahajan @ 2011-03-24 14:14 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: TEXT/PLAIN, Size: 679 bytes --]

On Thu, 24 Mar 2011, Stefan Müller wrote:

>
>
> On 24.03.2011 10:57, Otared Kavian wrote:
>> Hi Stefan,
>> 
>> Thanks for the quick answer and solution!
>> Your solution works perfectly in mkiv; however typesetting with mkii 
>> results in
>> 	! Undefined control sequence.
>> 	l.3 \startMPdefinitions
>> Is there a solution with mkii?
>
> Then just drop the MPdefinitions section and put the complete vardef before 
> your normal mp code in the MPcode section. That should work, I think.

Or you can use

\startMPinclusions[+]
....
\stopMPinclusions

[+] appends to the existing content of MPinclusion, so you can have 
multiple such sections.

Aditya

[-- Attachment #2: Type: text/plain, Size: 486 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

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

end of thread, other threads:[~2011-03-24 14:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-24  8:59 Metfun macro for triangle Otared Kavian
2011-03-24  9:29 ` Stefan Müller
2011-03-24  9:57   ` Otared Kavian
2011-03-24 10:29     ` Stefan Müller
2011-03-24 13:16       ` Otared Kavian
2011-03-24 14:14       ` Aditya Mahajan

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