From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/24825 Path: news.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: color in textext Date: Thu, 29 Dec 2005 00:08:51 +0100 Message-ID: <43B31B03.6080507@wxs.nl> References: <43B2A555.6090900@wxs.nl> <86CF4C47-5B0E-4E21-8ACC-5C9E8FC53A6E@science.uva.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1135811431 9228 80.91.229.2 (28 Dec 2005 23:10:31 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 28 Dec 2005 23:10:31 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Thu Dec 29 00:10:24 2005 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 ciao.gmane.org with esmtp (Exim 4.43) id 1ErkPr-0007Vo-26 for gctc-ntg-context-518@m.gmane.org; Thu, 29 Dec 2005 00:09:11 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id AD59E127C3; Thu, 29 Dec 2005 00:09:06 +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 07295-02; Thu, 29 Dec 2005 00:09:00 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 527A3127A1; Thu, 29 Dec 2005 00:09:00 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 9042F127A1 for ; Thu, 29 Dec 2005 00:08:57 +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 07260-03 for ; Thu, 29 Dec 2005 00:08:54 +0100 (CET) Original-Received: from mail.pragma-ade.net (dsl-212-84-128-085.solcon.nl [212.84.128.85]) by ronja.ntg.nl (Postfix) with SMTP id 044DA1278B for ; Thu, 29 Dec 2005 00:08:52 +0100 (CET) Original-Received: from [10.100.1.102] (unverified [10.100.1.102]) by controller-1 (SurgeMail 3.5b3) with ESMTP id 9574 for ; Thu, 29 Dec 2005 00:17:05 +0300 User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en Original-To: mailing list for ConTeXt users In-Reply-To: <86CF4C47-5B0E-4E21-8ACC-5C9E8FC53A6E@science.uva.nl> X-Server: High Performance Mail Server - http://surgemail.com r=-274017400 X-Authenticated-User: hagen@controller-1 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-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:24825 Archived-At: Hans van der Meer wrote: > I'm sorry, I ran it in a few variations, but neither does work here: > ah .. all those users who want to stress this tex-mp game to the limits ... keep in mind that tex in mp is actually a hack! your unknown will go away when you redefine the color commands to be unexpandable \unexpanded\def\startcolor {\ifincolor \expandafter\doglobalstartcolor \else \expandafter\noglobalstartcolor \fi} \unexpanded\def\stopcolor {\ifincolor \doglobalstopcolor \else \noglobalstopcolor \fi} > \setupcolors[state=start] > \startMPenvironment % both with and without: [global] > \setupcolors[state=start] > \stopMPenvironment > \setupMPpage[offset=2mm] > \startuseMPgraphic{test} > label(textext("\color[green]{XYZ}"), (0,0)); % > returns black XYZ on execute > label(textext("\startcolor[red]{XYZ}\stopcolor"), (0,20)); % > returns "unknown" on execute > \stopuseMPgraphic > \starttext > \forceMPTEXgraphictrue > \startMPpage > \includeMPgraphic{test} > \stopMPpage > \stoptext > > I tried to run this on context-live but there got both outputs to > "unknown". color itself ... mp only reads back the character (+ some rule) data, nothing else, so color needs to be applied at another level (there is some limited and therefore useless special support) so, the best i can give you is: % output=pdf \unexpanded\def\startcolor {\ifincolor \expandafter\doglobalstartcolor \else \expandafter\noglobalstartcolor \fi} \unexpanded\def\stopcolor {\ifincolor \doglobalstopcolor \else \noglobalstopcolor \fi} \setupcolors[state=start] \startMPenvironment % both with and without: [global] % only font and macro defs make sense here \stopMPenvironment \setupMPpage[offset=2mm] \startuseMPgraphic{test} draw thelabel(textext("XYZ"), (0,0)) withcolor \MPcolor{green} ; draw thelabel(textext("XYZ"), (0,20)) withcolor \MPcolor{red} ; \stopuseMPgraphic \starttext \forceMPTEXgraphictrue \startMPpage \includeMPgraphic{test} \stopMPpage \stoptext