From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/38048 Path: news.gmane.org!not-for-mail From: Taco Hoekwater Newsgroups: gmane.comp.tex.context Subject: Re: color expansion at runtime Date: Mon, 17 Dec 2007 11:33:53 +0100 Message-ID: <47665091.5020407@elvenkind.com> References: <4762B608.1010107@gmx.net> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1197899204 21612 80.91.229.12 (17 Dec 2007 13:46:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 17 Dec 2007 13:46:44 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Dec 17 14:46:56 2007 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by lo.gmane.org with esmtp (Exim 4.50) id 1J4GIw-0003N8-N1 for gctc-ntg-context-518@m.gmane.org; Mon, 17 Dec 2007 14:46:46 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id CF8261FB1F; Mon, 17 Dec 2007 14:46:27 +0100 (CET) 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 04375-01; Mon, 17 Dec 2007 14:45:54 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 5581B1FA67; Mon, 17 Dec 2007 12:04:33 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id B9C7A1FA55 for ; Mon, 17 Dec 2007 12:04:28 +0100 (CET) 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 10518-01 for ; Mon, 17 Dec 2007 12:04:20 +0100 (CET) Original-Received: from tullamore.elvenkind.com (elvenknd.xs4all.nl [82.95.203.226]) by ronja.ntg.nl (Postfix) with ESMTP id 8FB291FF3F for ; Mon, 17 Dec 2007 11:33:53 +0100 (CET) Original-Received: from glenlivet.elvenkind.com (glenlivet.elvenkind.com [10.10.0.6]) by tullamore.elvenkind.com (Postfix) with ESMTP id 5B7B43050290 for ; Mon, 17 Dec 2007 11:33:53 +0100 (CET) User-Agent: Thunderbird 2.0.0.0 (X11/20070522) In-Reply-To: <4762B608.1010107@gmx.net> X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.9 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-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:38048 Archived-At: Peter Rolf wrote: > > I have written such a macro, but sadly it crashes when used inside > \color or \definecolor. Tried to debug it, but this is my first > experience with the trace commands (probably not the best example to > start with). Sigh, still so much to learn.. :) The problem is that it defines things, and you can't do that inside an argument. Solution: rewrite the macro to define a new macro (like \def\currentStateDependentColor{green}) instead of expanding on the fly. Then you have to do something like this: \StateDependentColor[stateA=green,stateC=blue,whatever=yellow,...] \ color[\currentStateDependentColor] And that should work. Best wishes, Taco ___________________________________________________________________________________ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________