From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/22814 Path: news.gmane.org!not-for-mail From: Christopher Creutzig Newsgroups: gmane.comp.tex.context Subject: Re: Q: about \externalfile from metafun-p.pdf Date: Sun, 02 Oct 2005 22:36:37 +0200 Message-ID: <434044D5.8090109@creutzig.de> References: <20051002172755.GA17649@none.at> <43401ECE.2030309@creutzig.de> <20051002185852.GB19384@none.at> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1128285463 29386 80.91.229.2 (2 Oct 2005 20:37:43 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 2 Oct 2005 20:37:43 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Sun Oct 02 22:37:40 2005 Return-path: Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by ciao.gmane.org with esmtp (Exim 4.43) id 1EMAZm-0006F6-DF for gctc-ntg-context-518@m.gmane.org; Sun, 02 Oct 2005 22:36:50 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 45A211281C; Sun, 2 Oct 2005 22:36:49 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 10373-05; Sun, 2 Oct 2005 22:36:44 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 7D9AA12813; Sun, 2 Oct 2005 22:36:44 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 084CF12813 for ; Sun, 2 Oct 2005 22:36:44 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 10345-03 for ; Sun, 2 Oct 2005 22:36:43 +0200 (CEST) Original-Received: from bayes.math.uni-paderborn.de (bayes.math.uni-paderborn.de [131.234.116.40]) by ronja.ntg.nl (Postfix) with ESMTP id 0EDE612810 for ; Sun, 2 Oct 2005 22:36:40 +0200 (CEST) Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by bayes.math.uni-paderborn.de (Postfix) with ESMTP id AAC78E00010A for ; Sun, 2 Oct 2005 22:36:40 +0200 (CEST) Original-Received: from bayes.math.uni-paderborn.de ([127.0.0.1]) by localhost (bayes [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 04315-08 for ; Sun, 2 Oct 2005 22:36:39 +0200 (CEST) Original-Received: from [192.168.1.2] (p548B002E.dip0.t-ipconnect.de [84.139.0.46]) by bayes.math.uni-paderborn.de (Postfix) with ESMTP id B923CE0000BF for ; Sun, 2 Oct 2005 22:36:38 +0200 (CEST) User-Agent: Mozilla Thunderbird 1.0.6 (Macintosh/20050716) X-Accept-Language: en-us, en Original-To: mailing list for ConTeXt users In-Reply-To: <20051002185852.GB19384@none.at> X-Enigmail-Version: 0.92.0.0 X-Virus-Scanned: by mailscan-system at math.uni-paderborn.de X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.5 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 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on smtp.ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:22814 Archived-At: Alexander Lazic wrote: > Oh btw: i have see in the syntax-diagramm sin. >=20 > 1.) is this the sinus function? Sure. (The sine function as used by mathematicians. If you want the sine of an angle expressed in degrees, I believe you want sind.) > 2.) i have try >=20 > --- > \startreusableMPgraphic{sin} >=20 > sin (1); > \stopreusableMPgraphic{sin} This {sin} at the end is wrong; it's interpreted as text. >=20 > \reuseMPgraphic{sin} > --- >=20 > and get: >=20 > Isolated expression. >=20 > Do you know what's going wrong? It's the same error as trying to =93plot=94 the MP code 1; MetaPost is confused since it has no idea what to do with that number and tells you so. Since MP can handle more than just numbers, you get a slightly more general error message that talks about an =93expression=94 rather than a =93number.=94 What you can do is something like \starttext \startusableMPgraphic{sin} for x :=3D 0 step 0.6282 until 6.282: drawdot(10*x, 10*sin(x)) withpen pencircle scaled 1pt; endfor \stopusableMPgraphic \useMPgraphic{sin} \stoptext Or, you can use the fact that in MetaPost you can build up an expression within a for loop as follows: \starttext \startusableMPgraphic{sin} draw (0,0) for x :=3D 0 step 0.2 until 6.282: ..(10*x, 10*sin(x)) endfor; \stopusableMPgraphic \useMPgraphic{sin} \stoptext I think it really helps with MP programming to understand this type of loops. Christopher