From: "Mojca Miklavec" <mojca.miklavec.lists@gmail.com>
Subject: Re: metafun & \sometxt: should black be "black" or "textcolor"?
Date: Mon, 7 Aug 2006 11:40:53 +0200 [thread overview]
Message-ID: <6faad9f00608070240x57e14c64v2313782c846523b6@mail.gmail.com> (raw)
In-Reply-To: <44D6F6A3.9050502@elvenkind.com>
On 8/7/06, Taco Hoekwater wrote:
>
> Mojca Miklavec wrote:
> >
> > The "real problem" appears in the following figure where the first
> > black is ignored and the second one is not, so it's rather
> > inconsistent:
>
> It is not really inconsistent, the rule is very simple:
>
> all use of "withcolor <black>" upto the first non-zero color
> is ignored by metapost.
OK, I "give up". I just have to reimplement the terminal to fist store
everything and then write out the black stuff before anything else ;)
> > I can image a "fair solution" to draw "withcolor black" in black and
> > to let the parts with no explicit color and an empty drawoptions()
> > string to use the "default color" (perhaps with gsave/grestore). But
> > I'm not entitled to judge about it.
>
> Yes, that's what I thought. But I need to patch metapost for
> that, so that solution won't be available in a reliable way
> for quite some time yet.
I realise that and I'll try to implement in an independant way.
> > In any case I'll have to use a solution which will not depend on this
> > behaviour. Is there any chance to get "withcolor somecolor", where
> > "somecolor" is the color set with "textcolor=somecolor"?
>
> Maybe withcolor \MPcolor{textcolor} ? (I am guessing)
Something that seems to work after some trial-and-error:
\definecolor[textcolor][\@@cltextcolor]
But I'm guessing as well. Let's wait for the next bug in the module then ;)
I now used
\definecolor[textcolor][\@@cltextcolor]
% \MPextensions, should be specific to \startGNUPLOTgraphic
\startMPextensions
if unknown context_gplot: input mp-gnuplot.mp ; fi;
% overloading
gp_color_foreground := \MPcolor{textcolor};
gp_color_lt[-2] := gp_color_foreground;
\stopMPextensions
(because there's probably no way to put \MPcolor{textcolor} to *.mp file)
But now there's a minor problem. I have to initialize
"\setupcolors[textcolor=blue]" *before* loading the gnuplot module,
otherwise it's all black.
In contrast, if I use
\setupcolors[state=start,textcolor=blue]
\usemodule[gnuplot]
a graphic here will be blue
\setupcolors[textcolor=red]
a graphic here will be red, but text will still be blue
And
\usemodule[gnuplot]
\setupcolors[state=start,textcolor=blue]
a graphic here will be black
\setupcolors[textcolor=red]
a graphic here will be black, but text will still be blue
I suspect what's going on: as long as textcolor= is undefined,
\@@cltextcolor will expand to black and remain black even if I set
"textcolor=something" later. If it's initialised before loading the
module, it will expand to some color and if I change
"textcolor=someothercolor" later, the color will follow the new
definition.
What's the best remedy for it? (And sorry for way too many questions.)
Thanks,
Mojca
(some files to play with are under http://pub.mojca.org/gnuplot/temp/)
next prev parent reply other threads:[~2006-08-07 9:40 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-06 2:32 Mojca Miklavec
2006-08-06 8:52 ` Taco Hoekwater
2006-08-06 11:26 ` Mojca Miklavec
2006-08-06 14:37 ` Taco Hoekwater
2006-08-06 17:02 ` Mojca Miklavec
2006-08-06 21:48 ` Hans Hagen
2006-08-06 22:02 ` Hans Hagen
2006-08-07 8:04 ` Mojca Miklavec
2006-08-07 8:15 ` Taco Hoekwater
2006-08-07 9:40 ` Mojca Miklavec [this message]
2006-08-07 10:25 ` 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=6faad9f00608070240x57e14c64v2313782c846523b6@mail.gmail.com \
--to=mojca.miklavec.lists@gmail.com \
--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).