From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/73634 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: How to define a command... Date: Thu, 5 Jan 2012 21:18:23 +0100 Message-ID: References: <6457E519-6F30-482B-98DC-08BD546F8B2F@gmail.com> <8739btj455.fsf@micropit.couberia.bzh> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1325794719 22498 80.91.229.12 (5 Jan 2012 20:18:39 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 5 Jan 2012 20:18:39 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Jan 05 21:18:34 2012 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 1Ritli-0000UF-F5 for gctc-ntg-context-518@m.gmane.org; Thu, 05 Jan 2012 21:18:34 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 463F8CB1D2; Thu, 5 Jan 2012 21:18:34 +0100 (CET) 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 0cgKhjcy+dkj; Thu, 5 Jan 2012 21:18:33 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 9D37ECB1D5; Thu, 5 Jan 2012 21:18:31 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 4098ACB1D5 for ; Thu, 5 Jan 2012 21:18:30 +0100 (CET) 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 79wgwO4c+rwm for ; Thu, 5 Jan 2012 21:18:28 +0100 (CET) Original-Received: from filter2-til.mf.surf.net (filter2-til.mf.surf.net [194.171.167.218]) by balder.ntg.nl (Postfix) with ESMTP id 6F287CB1D2 for ; Thu, 5 Jan 2012 21:18:28 +0100 (CET) Original-Received: from mail-ee0-f41.google.com (mail-ee0-f41.google.com [74.125.83.41]) by filter2-til.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id q05KIRSH007646 for ; Thu, 5 Jan 2012 21:18:27 +0100 Original-Received: by eekc41 with SMTP id c41so760664eek.14 for ; Thu, 05 Jan 2012 12:18:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; bh=w7Y+6PZm1jr0tvodrtqi8zpTLwKhVKn56EN2z1WjfiY=; b=Vp05L4F3eK+FPYfelgK2vfA59ltol7VKKg+xrX5w/Ynkp+UIJS/5U56EYu5bgYNAYj uffmUOYdgbXeqRUAELT3wavpSBLRC4AQZ1FLka+0ty586LG6ehHNFeQF7NE7VKhcn3L0 Q4zC6hk3J9FSRHT+CdwVwGijq5yw99K12BSsE= Original-Received: by 10.213.110.10 with SMTP id l10mr703549ebp.53.1325794706765; Thu, 05 Jan 2012 12:18:26 -0800 (PST) Original-Received: from [192.168.2.35] (p57AFC0E2.dip.t-dialin.net. [87.175.192.226]) by mx.google.com with ESMTPS id a60sm237958161eeb.4.2012.01.05.12.18.24 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 05 Jan 2012 12:18:25 -0800 (PST) In-Reply-To: <8739btj455.fsf@micropit.couberia.bzh> X-Mailer: Apple Mail (2.1251.1) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=74.125.83.41; 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: 0bGhUirar - 32e24b040742 - 20120105 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.218 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:73634 Archived-At: Am 05.01.2012 um 21:17 schrieb Peter M=FCnster: > On Thu, Jan 05 2012, Otared Kavian wrote: > = >> \define[3]\RandomCoeff{% >> \ctxlua{a =3D math.random(#2,#3)} >> % \csname{Coeff#1}\endcsname{\ctxlua{tex.print(a)}} %% this line does no= t work as expected... > = > \setuprandomize[2012] > \define[3]\RandomCoeff{% > \expandafter\def\csname Coeff#1\endcsname{\ctxlua{tex.print(math.random(= #2,#3))}}} \setvalue{Coeff#1}{=85} Wolfgang ___________________________________________________________________________= ________ If your question is of interest to others as well, please add an entry to t= he Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-cont= ext webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________= ________