From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/58737 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Vianney_le_Cl=E9ment?= Newsgroups: gmane.comp.tex.context Subject: Re: processaction inside MP graphic Date: Thu, 13 May 2010 10:45:26 +0200 Message-ID: References: <4BEBAA96.7020108@elvenkind.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1273740355 20724 80.91.229.12 (13 May 2010 08:45:55 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 13 May 2010 08:45:55 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu May 13 10:45:53 2010 connect(): No such file or directory 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 1OCU3F-0002GI-G2 for gctc-ntg-context-518@m.gmane.org; Thu, 13 May 2010 10:45:53 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 13DD4C9B21; Thu, 13 May 2010 10:45:53 +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 j-xonpxnlzXm; Thu, 13 May 2010 10:45:50 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 2C43AC9B10; Thu, 13 May 2010 10:45:50 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id F3AA5C9B10 for ; Thu, 13 May 2010 10:45:48 +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 RSwH-fJyly3O for ; Thu, 13 May 2010 10:45:46 +0200 (CEST) Original-Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.153]) by balder.ntg.nl (Postfix) with ESMTP id BE485C9B0D for ; Thu, 13 May 2010 10:45:46 +0200 (CEST) Original-Received: by fg-out-1718.google.com with SMTP id e12so632649fga.2 for ; Thu, 13 May 2010 01:45:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=vnDsqf2yPpcGhZxzlRprZE8JREUzjNvrzZ09DOWJufw=; b=d9M8LZHuQ+YKRQSnWSaxiMPfXS9WeyE0/l9nrNtpA6jsuz2m8SEBAPsBtgGWzXLVuX 1p52mg1kdKbzKAwKM9/gKtayd+IYHVMAncA2gtp4UaTI2D2KqOLUzqY/IYdJ/+E+K0Ks 9B/FldyNuAICpDUicmzGTYrEX/v2V048x2VEY= 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:content-transfer-encoding; b=QE6W9qWj/Ps66hVh791edmkNcKswLVyAsWMBAPdE5QI29bRG6bSysFiyq95mBS8RPE z9czcyPco+AT52qAlHtNp2XR3QEL8Nm2UA8a7PKHqKBy6uAXQ6duB3LdI9az93pmhR9g /ArhO+8lhdCFBty6TBCUla/c9cbytX9xlz5oo= Original-Received: by 10.239.163.9 with SMTP id n9mr847439hbd.127.1273740346254; Thu, 13 May 2010 01:45:46 -0700 (PDT) Original-Received: by 10.239.174.12 with HTTP; Thu, 13 May 2010 01:45:26 -0700 (PDT) In-Reply-To: <4BEBAA96.7020108@elvenkind.com> 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:58737 Archived-At: On Thu, May 13, 2010 at 09:30, Taco Hoekwater wrote: > Like many of the more complex commands, \processaction does not > expand totally. If you are using mkiv, you could define \Shape > like this: > > \def\Shape#1% > =A0{\directlua{ > =A0 =A0 local known =3D {square =3D 'unitsquare', circle =3D 'unitcircle'= } > =A0 =A0 tex.sprint(known[#1] or 'unitsquare')}} Thanks Taco. That does the trick provided you enclose #1 with quotes: \def\Shape#1% {\directlua{ local known =3D {square =3D 'unitsquare', circle =3D 'unitcircle' } tex.sprint(known['#1'] or 'unitsquare')}} Another, maybe uglier but plain TeX, solution I've come up with is defining auxiliary macros: \def\ShapeSSSsquare{unitsquare} \def\ShapeSSScircle{unitcircle} \def\Shape#1{\csname ShapeSSS#1\endcsname} But of course, this does not handle unknown options (though that could be added). I'll add this to the wiki. Vianney ___________________________________________________________________________= ________ 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 ___________________________________________________________________________= ________