From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/68622 Path: news.gmane.org!not-for-mail From: =?UTF-8?Q?Vedran_Mileti=C4=87?= Newsgroups: gmane.comp.tex.context Subject: Re: MPdefinitions Date: Mon, 23 May 2011 17:37:16 +0200 Message-ID: References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1922819171==" X-Trace: dough.gmane.org 1306165085 5066 80.91.229.12 (23 May 2011 15:38:05 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 23 May 2011 15:38:05 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon May 23 17:38:01 2011 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QOXCi-0005C3-7F for gctc-ntg-context-518@m.gmane.org; Mon, 23 May 2011 17:38:00 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 92197CACE5; Mon, 23 May 2011 17:37:57 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id nQuO-TBfXNSu; Mon, 23 May 2011 17:37:57 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 5229DCAD29; Mon, 23 May 2011 17:37:50 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id A38E9CAD29 for ; Mon, 23 May 2011 17:37:49 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id ldkxV4dujlAm for ; Mon, 23 May 2011 17:37:38 +0200 (CEST) Original-Received: from filter3-til.mf.surf.net (filter3-til.mf.surf.net [194.171.167.219]) by balder.ntg.nl (Postfix) with ESMTP id 7590ECACE5 for ; Mon, 23 May 2011 17:37:38 +0200 (CEST) Original-Received: from mail-pv0-f169.google.com (mail-pv0-f169.google.com [74.125.83.169]) by filter3-til.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p4NFbaLe010336 for ; Mon, 23 May 2011 17:37:37 +0200 Original-Received: by pvc12 with SMTP id 12so3415845pvc.14 for ; Mon, 23 May 2011 08:37:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; bh=VMcZyJvrkV9s31A0w+UEhjdBWutIRHIwETFD/wRu0ps=; b=gu8UctkGajba1rIyx7ZabcXTM9dFmW1IxKoK9zlNsIh9jk4+GdmJtpW/mNAaK6eB4n gGCw567IIoMooEXNP1gZNGplfA4EUuBnil/4oCtlq4RHyi5wD9WDJOiyAVtanU5LSyba RewK6z2xcDBgSewIZLPOS5aDyeL1fDXP6lu9E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=YJIMVxezQVzZtCFeiHLzJq4sdrjWLfIXgnTdQhTBlW12720dduGgjDktRgA70NNo+O 00ckiesg84mkWE1r0g0Ok34o5xiTcubZzBZJ+E1+po1v7549SA9bBgWUagHPBG/eZjam Dx0A36ETVRBzoFphlJNJAS8aN9FJPHZ856CPI= Original-Received: by 10.68.27.197 with SMTP id v5mr2321961pbg.368.1306165056080; Mon, 23 May 2011 08:37:36 -0700 (PDT) Original-Received: by 10.68.49.233 with HTTP; Mon, 23 May 2011 08:37:16 -0700 (PDT) In-Reply-To: X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=74.125.83.169; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0eEL3BBAG - 23d5453b6ad0 - 20110523 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.219 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:68622 Archived-At: --===============1922819171== Content-Type: multipart/alternative; boundary=bcaec520eb172f8a8d04a3f340d2 --bcaec520eb172f8a8d04a3f340d2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 2011/5/23 Wolfgang Schuster > Please send a complete example! > Sure: \startMPdefinitions{solvers} \stopMPdefinitions \starttext Hello. \stoptext or this: \startMPdefinitions{solvers} def draw_problem (expr p, q, r, s, show_lables)=3D begingroup ; save x, y, a, b, c, d, e, f, g, h ; z11=3Dz42=3Dp ; z21=3Dz12=3Dq ; z31=3Dz22=3Dr ; z41=3Dz32=3Ds ; a=3Dx12-x11 ; b=3Dy12-y11 ; c=3Dx22-x21 ; d=3Dy22-y21 ; e=3Dx32-x31 ; f=3Dy32-y31 ; g=3Dx42-x41 ; h=3Dy42-y41 ; z11=3D(x11, y11) ; z12=3D(x12, y12) ; z13=3D(x12-b, y12+a) ; z14=3D(x11-b, y11+a) ; z21=3D(x21, y21) ; z22=3D (x22, y22); z23=3D(x22-s,y22+c) ; z24=3D(x21-d, y21+c) ; z31=3D(x31, y31) ; z32=3D(x32, y32) ; z33=3D(x32-f, y32+e) ; z34=3D(x31-f, y31+e); z41=3D(x41, y41) ; z42=3D(x42, y42) ; z43=3D(x42-h,y42+g) ; z44=3D(x41-h,y41+g) ; pickup pencircle scaled .5pt ; draw z11--z12--z13--z14--cycle ; draw z11--z13 ; draw z12--z14 ; draw z21--z22--z23--z24--cycle ; draw z21=E2=80=94z23 ; draw z22=E2=80=94z2= 4 ; draw z31--z32--z33--z34--cycle ; draw z31=E2=80=94z33 ; draw z32=E2=80=94z3= 4 ; draw z41--z42--z43--z44--cycle ; draw z41=E2=80=94z43 ; draw z42=E2=80=94z4= 4 ; z1=3D0.5[z11,z13] ; z2=3D0.5[z21,z23] ; z3=3D0.5[z31,z33] ; z4=3D0.5[z41,z43] ; draw z1--z3 dashed evenly ; draw z2--z4 dashed evenly ; z0=3Dwhatever[z1,z3]=3Dwhatever[z2,z4] ; mark_rt_angle (z1,z0,z2); if show_labels>0: draw_problem_labels ; fi; endgroup ; enddef ; \stopMPdefinitions \starttext Hello. \stoptext Result is the same. Vedran --bcaec520eb172f8a8d04a3f340d2 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 2011/5/23 Wolfgang Schuster <schuster.wolfgang@googlemail.com><= br>
Please send a complete example!

Sure:

\startMPdefinitions{solvers}
\stopMPdefinitions<= br>
\starttext
Hello.
\stoptext
or this:

\startMPdefinitions{solvers}
def draw_problem (expr p, = q, r, s, show_lables)=3D
begingroup ; save x, y, a, b, c, d, e, f, g, = h ;
z11=3Dz42=3Dp ; z21=3Dz12=3Dq ; z31=3Dz22=3Dr ; z41=3Dz32=3Ds ; a=3Dx12-x11 ; b=3Dy12-y11 ; c=3Dx22-x21 ; d=3Dy22-y21 ;
e=3Dx32-x31 ; f=3Dy32-y31 ; g=3Dx42-x41 ; h=3Dy42-y41 ;
z11=3D(x11, = y11) ; z12=3D(x12, y12) ;
z13=3D(x12-b, y12+a) ; z14= =3D(x11-b, y11+a) ;
z21=3D(x21, y21) ; z22=3D (x22, y22);=
z23=3D(x22-s,y22+c) ; z24=3D(x21-d, y21+c) ;
z31=3D(x31, y31) ; z32=3D(x32, y32) ;
z33=3D(x32-f, y32= +e) ; z34=3D(x31-f, y31+e);
z41=3D(x41, y41) ; z42= =3D(x42, y42) ;
z43=3D(x42-h,y42+g) ; z44=3D(x41-h,y41+g) ;
= pickup pencircle scaled .5pt ;
draw z11--z12--z13--z14--cycle ; draw z11--z13 ; draw z12--z14 ;
dra= w z21--z22--z23--z24--cycle ; draw z21=E2=80=94z23 ; draw z22=E2=80=94z24 ;=
draw z31--z32--z33--z34--cycle ; draw z31=E2=80=94z33 ; draw z32=E2= =80=94z34 ;
draw z41--z42--z43--z44--cycle ; draw z41=E2=80=94z43 ; dr= aw z42=E2=80=94z44 ;
z1=3D0.5[z11,z13] ; z2=3D0.5[z21,z23] ;
z3=3D0.5[z31,z33] ; z4=3D0.5= [z41,z43] ;
draw z1--z3 dashed evenly ; draw z2--z4 dashed evenly ; z0=3Dwhatever[z1,z3]=3Dwhatever[z2,z4] ;
mark_rt_angle (z1,z0,z2);<= br> if show_labels>0:
draw_problem_labels ;
fi;
endgroup ;
enddef ;
\stopMPde= finitions

\starttext
Hello.
\= stoptext

Result is the same.

Vedran
--bcaec520eb172f8a8d04a3f340d2-- --===============1922819171== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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 ___________________________________________________________________________________ --===============1922819171==--