From: Sanjoy Mahajan <sanjoy@mrao.cam.ac.uk>
Subject: Re: \sometxt in staticMPfigure
Date: Tue, 26 Sep 2006 17:17:22 +0100 [thread overview]
Message-ID: <E1GSFcY-00012D-00@skye.ra.phy.cam.ac.uk> (raw)
In-Reply-To: Your message of "Tue, 26 Sep 2006 11:57:20 +0200." <4518F980.5040000@wxs.nl>
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
<font stuff for ?red?>
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.
next prev parent reply other threads:[~2006-09-26 16:17 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-25 3:51 Sanjoy Mahajan
2006-09-25 13:45 ` Hans Hagen
2006-09-25 20:39 ` Sanjoy Mahajan
2006-09-25 22:06 ` Hans Hagen
2006-09-25 23:04 ` Sanjoy Mahajan
2006-09-26 10:04 ` Hans Hagen
2006-09-26 12:11 ` Sanjoy Mahajan
2006-10-04 22:01 ` Aditya Mahajan
2006-10-05 8:00 ` Hans Hagen
2006-10-05 12:56 ` Sanjoy Mahajan
2006-09-26 0:53 ` Sanjoy Mahajan
2006-09-26 9:57 ` Hans Hagen
2006-09-26 12:02 ` Sanjoy Mahajan
2006-09-26 12:30 ` Hans Hagen
2006-09-26 13:33 ` Sanjoy Mahajan
2006-09-26 20:11 ` Hans Hagen
2006-09-27 4:29 ` Sanjoy Mahajan
2006-09-26 16:17 ` Sanjoy Mahajan [this message]
2006-09-26 16:21 ` Hans Hagen
2006-09-27 4:06 ` Sanjoy Mahajan
2006-09-27 8:03 ` Hans Hagen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1GSFcY-00012D-00@skye.ra.phy.cam.ac.uk \
--to=sanjoy@mrao.cam.ac.uk \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).