From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/31021 Path: news.gmane.org!not-for-mail From: Sanjoy Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: \sometxt in staticMPfigure Date: Tue, 26 Sep 2006 17:17:22 +0100 Message-ID: References: <4518F980.5040000@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1159287861 25047 80.91.229.2 (26 Sep 2006 16:24:21 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 26 Sep 2006 16:24:21 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Tue Sep 26 18:24:17 2006 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 1GSFcz-0001pK-QO for gctc-ntg-context-518@m.gmane.org; Tue, 26 Sep 2006 18:17:50 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 2F8691FF25; Tue, 26 Sep 2006 18:17: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 11268-05; Tue, 26 Sep 2006 18:17:39 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 7419F1FF1E; Tue, 26 Sep 2006 18:17:39 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 56CF01FF1E for ; Tue, 26 Sep 2006 18:17:35 +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 11632-03 for ; Tue, 26 Sep 2006 18:17:26 +0200 (CEST) Original-Received: from mraos.ra.phy.cam.ac.uk (mraos.ra.phy.cam.ac.uk [131.111.48.8]) by ronja.ntg.nl (Postfix) with SMTP id DF58E1FF19 for ; Tue, 26 Sep 2006 18:17:25 +0200 (CEST) Original-Received: from skye.ra.phy.cam.ac.uk ([131.111.48.158] ident=mail) by mraos.ra.phy.cam.ac.uk with esmtp (Exim 4.43) id 1GSFcY-0002Zs-8l; Tue, 26 Sep 2006 17:17:22 +0100 Original-Received: from sanjoy by skye.ra.phy.cam.ac.uk with local (Exim 3.36 #1) id 1GSFcY-00012D-00; Tue, 26 Sep 2006 17:17:22 +0100 Original-To: mailing list for ConTeXt users In-Reply-To: Your message of "Tue, 26 Sep 2006 11:57:20 +0200." <4518F980.5040000@wxs.nl> X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.7 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:31021 Archived-At: Hans Hagen wrote: > test case: > > \setupcolors[state=start,textcolor=red] > \starttext > red > \color[green]{green > \startMPcode > label(\sometxt{green\color[blue]{blue}green}, origin) > withcolor red; > draw fullcircle scaled 1cm xscaled 2; > \stopMPcode > green} > red > \stoptext The test case works as you say (2006.09.26 beta). Though I don't understand why [Note added later: I now understand, see at the end...]: e.g. why the 'green' text in the \sometxt is green. Shouldn't the withcolor red trump the \color[green] from ConTeXt? I take your point about the lack of a color stack in metapost and the difficulty of getting the metapost and context stacks to interact. Here's a shorter example of what I'm confused about. \setupcolors[state=start,textcolor=yellow] \starttext \startMPcode label(\sometxt{?red?}, origin) withcolor red; \stopMPcode \stoptext The label(\sometxt{...}) withcolor red would produce postscript code like 1 0 0 setrgbcolor 0 0 0 setrgbcolor and that would be surrounded by code to set textcolor to yellow. Oh, I understand now. The \sometxt{} wraps the ?red? in yellow setrgbcolor, since that's seen first by ConTeXt, and *then* it's wrapped by metapost in red setrgcolor, so the red is overridden by the yellow inside it. -Sanjoy `Never underestimate the evil of which men of power are capable.' --Bertrand Russell, _War Crimes in Vietnam_, chapter 1.