From - Mon Aug  9 19:33:16 2004
Return-Path: <matthias.pospiech@gmx.de>
Received: from mail.gmx.net (pop.gmx.net [213.165.64.20])
          by nef.ens.fr (8.12.11/1.01.28121999) with SMTP id i79HXE7g071253
          for <metafont@ens.fr>; Mon, 9 Aug 2004 19:33:14 +0200 (CEST)
Received: (qmail 14295 invoked by uid 65534); 9 Aug 2004 17:33:13 -0000
Received: from pD9512E29.dip.t-dialin.net (EHLO matthias) (217.81.46.41)
  by mail.gmx.net (mp020) with SMTP; 09 Aug 2004 19:33:13 +0200
X-Authenticated: #2798017
From: Matthias Pospiech <matthias.pospiech@gmx.de>
Reply-To: matthias.pospiech@gmx.de
To: metafont@ens.fr
Subject: [Metapost] Set Text-Variable in btex ... etex ?
Date: Mon, 9 Aug 2004 21:35:36 +0200
User-Agent: KMail/1.6.1
MIME-Version: 1.0
Content-Disposition: inline
Content-Type: text/plain;
  charset="iso-8859-1"
Message-Id: <200408092135.36029.matthias.pospiech@gmx.de>
X-Greylist: Recipient e-mail whitelisted, not delayed by milter-greylist-1.3.3 (nef.ens.fr [129.199.96.32]); Mon, 09 Aug 2004 19:33:14 +0200 (CEST)
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by nef.ens.fr id i79HXE7g071253

To make Metapost easier readable I want to define some new definitions.
One important point is  a text-funktion. Unfortunately I cannot set a 
text-variable in btex..etex ?!

def mytext(text t) =
        btex t etex 
enddef;

only results in a 't' :-(

Is there a possibility to do in still ?


Matthias
-- 
---------------------------------------------------------------
Matthias Pospiech
Schneiderberg 28, 30167 Hannover
email: matthias.pospiech@gmx.de
Web: http://www.matthiaspospiech.de/
ICQ: 60941314
Tel: +49 (0)511-3534318
Mobil: +49 (0)170-5586781
---------------------------------------------------------------


From - Wed Aug 11 11:50:21 2004
Return-Path: <taco@elvenkind.com>
Received: from glenfiddich.elvenkind.com (elvenknd.xs4all.nl [213.84.171.68])
          by nef.ens.fr (8.12.11/1.01.28121999) with ESMTP id i7B9oHK9000406
          for <metafont@ens.fr>; Wed, 11 Aug 2004 11:50:17 +0200 (CEST)
Received: from localhost (localhost.localdomain [127.0.0.1])
	by glenfiddich.elvenkind.com (Postfix) with ESMTP id C2F94179E0
	for <metafont@ens.fr>; Wed, 11 Aug 2004 11:50:12 +0200 (CEST)
Received: from glenfiddich.elvenkind.com ([127.0.0.1])
 by localhost (glenfiddich.elvenkind.com [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 20905-04 for <metafont@ens.fr>;
 Wed, 11 Aug 2004 11:50:12 +0200 (CEST)
Received: from glenlivet.elvenkind.com (glenlivet.elvenkind.com [10.10.0.6])
	by glenfiddich.elvenkind.com (Postfix) with SMTP id 16453D78B
	for <metafont@ens.fr>; Wed, 11 Aug 2004 11:50:12 +0200 (CEST)
Date: Wed, 11 Aug 2004 11:50:16 +0200
From: Taco Hoekwater <taco@elvenkind.com>
To: metafont@ens.fr
Subject: Re: [metafont] [Metapost] Set Text-Variable in btex ... etex ?
Message-Id: <20040811115016.2decd92e@glenlivet.elvenkind.com>
In-Reply-To: <200408092135.36029.matthias.pospiech@gmx.de>
References: <200408092135.36029.matthias.pospiech@gmx.de>
Organization: Elvenkind
X-Mailer: Sylpheed-Claws 0.9.12 (GTK+ 1.2.10; i586-mandrake-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
X-Virus-Scanned: by amavisd-new at elvenkind.net
X-Greylist: Recipient e-mail whitelisted, not delayed by milter-greylist-1.3.3 (nef.ens.fr [129.199.96.32]); Wed, 11 Aug 2004 11:50:17 +0200 (CEST)
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by nef.ens.fr id i7B9oHK9000406

On Mon, 9 Aug 2004 21:35:36 +0200, Matthias wrote:

> To make Metapost easier readable I want to define some new definitions.
> One important point is  a text-funktion. Unfortunately I cannot set a 
> text-variable in btex..etex ?!
> 
> def mytext(text t) =
>         btex t etex 
> enddef;
> 
> only results in a 't' :-(
> 
> Is there a possibility to do in still ?

You can't do it using btex ... etex, but there should be an input file
called TEX.mp in your distribution that defines the command 
	TEX(t)
which does precisely what you want to achieve, using a trick.

The problem is that whenever MetaPost "sees" the command
btex ... etex, it will replace it with it's low-level substitution
right away, so you macro definition effectively becomes

  def mytext(text t) =
     "t" infont "cmr10"
  enddef;

the 'TEX()'  command solves this by writing a string concatenation
to a temporary file, then re-reading that file.

-- 
groeten,

Taco


From - Thu Aug 12 15:27:02 2004
Return-Path: <texnician@163.com>
Received: from 163.com ([202.108.44.170])
          by nef.ens.fr (8.12.11/1.01.28121999) with SMTP id i7CDQtuM087652
          for <metafont@ens.fr>; Thu, 12 Aug 2004 15:26:56 +0200 (CEST)
Received: from xoo.shemale.8866.org (unknown [222.163.18.0])
	by 192.168.1.170 (Coremail) with SMTP id RwDyYxVwG0H8LRIB.1
	for <metafont@ens.fr>; Thu, 12 Aug 2004 21:26:47 +0800 (CST)
X-Originating-IP: [222.163.18.0]
To: metafont@ens.fr
Subject: [question about metapost]How to make color text in boxes?
From: light <texnician@163.com>
Date: Fri, 13 Aug 2004 21:26:45 +0800
Message-ID: <m2ekmb419m.fsf@xoo.shemale.8866.org>
User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3.50 (gnu/linux)
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEWDZjH83KsOHBfvtX3i
 jlUDAQNnhjxmNhb6ff7eAAACeUlEQVR4nFWUQYvbMBCFh6xYn03CnlOB4mtciT0r1dBci0HdazdL
 5aswSfT3+0bypu1AwMyneSM9jUIppVkjTNTGxKgPH33/giStYJqMmeIU43R4f4C06CnquIZOkm/A
 TCK15kE+waWqP0IfPoH+u34Va+Bi0OK/QMkBYPlMl7KURT5+Qh1Ar03fiInohu8JSYKSfJZSrmyZ
 fdcAekixLop9sL21zkv5+yuAFnEVrB37vt9ad6vgQrOBOPJ9C+s2AF9eEl1i/MGhLm/gbOp+6XeM
 e7afBdDyywMM/CgA4M5UcBMQHsBaPut/wJp2OCF7g6MngmJmZtmt6/SQKfCtAuwq+0Xr4Wk8LqVk
 DjjJIS0AkzrDvuFqPSnUouL6DJBiVB7SXQ6OuYLCz2mmZKJCR/gXnKfi2VJ2Xky8xUzkiXncsVKy
 gk5HARc097mwOzkr2wvslRMwL/AcbrnTLjix3nkWcP9V9oy24Thun5rxbGtFymKi7R38aP7SuJsF
 qMySwW87VhfVuBNLDj5zTVQIJX8dRQpFWa2rezuiwD/1L/NdpM64WWQgHkTJK5xcwMcRTcbtOXfl
 VMFzG9Hlw8mQbM8lw3oAbtM+6yt38Kq3LEIQXEEa9u5MODmCqwN+BZcDlXoRMp/QZG+XBvA8suIO
 joXQy/ja9AD7VlE7sepf7/eZirzlAd3RNdTzqfGbjI+OeJlaprdZyKRajwFPdlkwNW1Kne9Cf7lL
 BcCwDPCrmuUxFP339L1KmX3Rhbi2weZqKQD+LPYb81ZIAi8Oho72VROU4v42vZU1rjCAaBNJ9pSN
 1l3LZ9jpaWMiyTGybLgUHQe55e3XqcT4B53DG3QGASewAAAAAElFTkSuQmCC
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Greylist: Recipient e-mail whitelisted, not delayed by milter-greylist-1.3.3 (nef.ens.fr [129.199.96.32]); Thu, 12 Aug 2004 15:26:57 +0200 (CEST)

Hi

I make a circle box and fill it with black background. The default
text color is black too, so the text and the background  mix up and
can't be distinguished from each other.

Is there any way to specify a different color for the text? for
instance, white, red and so on.

I have tried to use LaTeX's "color" package as follows:
--------------------------------------------------------------
verbatimtex
%&latex
\documentclass{article}
\usepackage{color}
\begin{document}
etex
...
circleit.a(btex \textcolor{white}{$A$} etex);
fill bpath.a withcolor (0,0,0);
drawboxed(a);
...
verbatimtex
\end{document}
etex
---------------------------------------------------------------
very disappointed, The text color remains black and the "color"
package seems can't to change the text color.

Who can help me achieve this goal?

Thanks for any advise!

Tang



From - Thu Aug 12 15:44:32 2004
Return-Path: <jim@joshua.smcvt.edu>
Received: from joshua.smcvt.edu (joshua.smcvt.edu [192.80.64.209])
          by nef.ens.fr (8.12.11/1.01.28121999) with ESMTP id i7CDiSuI095590
          for <metafont@ens.fr>; Thu, 12 Aug 2004 15:44:28 +0200 (CEST)
Received: from joshua.smcvt.edu (localhost.localdomain [127.0.0.1])
	by joshua.smcvt.edu (8.12.11/8.12.11) with ESMTP id i7CDiPP1010410;
	Thu, 12 Aug 2004 09:44:25 -0400
Received: (from jim@localhost)
	by joshua.smcvt.edu (8.12.11/8.12.11/Submit) id i7CDiOls010409;
	Thu, 12 Aug 2004 09:44:24 -0400
Subject: Re: [metafont] [question about metapost]How to make color text in
	boxes?
From: Jim Hefferon <jim@joshua.smcvt.edu>
To: light <texnician@163.com>
Cc: metafont@ens.fr
In-Reply-To: <m2ekmb419m.fsf@xoo.shemale.8866.org>
References: <m2ekmb419m.fsf@xoo.shemale.8866.org>
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Message-Id: <1092318264.10368.6.camel@joshua.smcvt.edu>
Mime-Version: 1.0
X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) 
Date: Thu, 12 Aug 2004 09:44:24 -0400
X-Greylist: Recipient e-mail whitelisted, not delayed by milter-greylist-1.3.3 (nef.ens.fr [129.199.96.32]); Thu, 12 Aug 2004 15:44:29 +0200 (CEST)

On Fri, 2004-08-13 at 09:26, light wrote:
> Hi
> 
> I make a circle box and fill it with black background. The default
> text color is black too, so the text and the background  mix up and
> can't be distinguished from each other.
> 
> Is there any way to specify a different color for the text? for
> instance, white, red and so on.
I think I remember using "drawoptions", on p 37 of the mpost manual. 
Probably not the Right answer, but sometimes you just want _an_ answer.

Jim


From - Thu Aug 12 18:32:24 2004
Return-Path: <texnician@163.com>
Received: from 163.com ([202.108.44.205])
          by nef.ens.fr (8.12.11/1.01.28121999) with SMTP id i7CGWGXD073879
          for <metafont@ens.fr>; Thu, 12 Aug 2004 18:32:17 +0200 (CEST)
Received: from xoo.shemale.8866.org (unknown [222.163.18.0])
	by 192.168.1.205 (Coremail) with SMTP id HQCicombG0HXB4kE.1
	for <metafont@ens.fr>; Fri, 13 Aug 2004 00:32:10 +0800 (CST)
X-Originating-IP: [222.163.18.0]
To: Jim Hefferon <jim@joshua.smcvt.edu>
Cc: light <texnician@163.com>, metafont@ens.fr
Subject: Re: [metafont] [question about metapost]How to make color text in
 boxes?
References: <m2ekmb419m.fsf@xoo.shemale.8866.org>
	<1092318264.10368.6.camel@joshua.smcvt.edu>
From: light <texnician@163.com>
Date: Sat, 14 Aug 2004 00:32:09 +0800
Message-ID: <m2hdr72e46.fsf@xoo.shemale.8866.org>
User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3.50 (gnu/linux)
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEWDZjH83KsOHBfvtX3i
 jlUDAQNnhjxmNhb6ff7eAAACeUlEQVR4nFWUQYvbMBCFh6xYn03CnlOB4mtciT0r1dBci0HdazdL
 5aswSfT3+0bypu1AwMyneSM9jUIppVkjTNTGxKgPH33/giStYJqMmeIU43R4f4C06CnquIZOkm/A
 TCK15kE+waWqP0IfPoH+u34Va+Bi0OK/QMkBYPlMl7KURT5+Qh1Ar03fiInohu8JSYKSfJZSrmyZ
 fdcAekixLop9sL21zkv5+yuAFnEVrB37vt9ad6vgQrOBOPJ9C+s2AF9eEl1i/MGhLm/gbOp+6XeM
 e7afBdDyywMM/CgA4M5UcBMQHsBaPut/wJp2OCF7g6MngmJmZtmt6/SQKfCtAuwq+0Xr4Wk8LqVk
 DjjJIS0AkzrDvuFqPSnUouL6DJBiVB7SXQ6OuYLCz2mmZKJCR/gXnKfi2VJ2Xky8xUzkiXncsVKy
 gk5HARc097mwOzkr2wvslRMwL/AcbrnTLjix3nkWcP9V9oy24Thun5rxbGtFymKi7R38aP7SuJsF
 qMySwW87VhfVuBNLDj5zTVQIJX8dRQpFWa2rezuiwD/1L/NdpM64WWQgHkTJK5xcwMcRTcbtOXfl
 VMFzG9Hlw8mQbM8lw3oAbtM+6yt38Kq3LEIQXEEa9u5MODmCqwN+BZcDlXoRMp/QZG+XBvA8suIO
 joXQy/ja9AD7VlE7sepf7/eZirzlAd3RNdTzqfGbjI+OeJlaprdZyKRajwFPdlkwNW1Kne9Cf7lL
 BcCwDPCrmuUxFP339L1KmX3Rhbi2weZqKQD+LPYb81ZIAi8Oho72VROU4v42vZU1rjCAaBNJ9pSN
 1l3LZ9jpaWMiyTGybLgUHQe55e3XqcT4B53DG3QGASewAAAAAElFTkSuQmCC
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Greylist: Recipient e-mail whitelisted, not delayed by milter-greylist-1.3.3 (nef.ens.fr [129.199.96.32]); Thu, 12 Aug 2004 18:32:18 +0200 (CEST)

Jim Hefferon <jim@joshua.smcvt.edu> writes:

Thank you very much! I have solved this problem in your advice.

Through the script is somewhat awkward due to my poor programming
skill, it just can perfectly do what i wanted.

Thanks!

Tang
> On Fri, 2004-08-13 at 09:26, light wrote:
>> Hi
>> 
>> I make a circle box and fill it with black background. The default
>> text color is black too, so the text and the background  mix up and
>> can't be distinguished from each other.
>> 
>> Is there any way to specify a different color for the text? for
>> instance, white, red and so on.
> I think I remember using "drawoptions", on p 37 of the mpost manual. 
> Probably not the Right answer, but sometimes you just want _an_ answer.
>
> Jim


From - Thu Aug 12 19:21:48 2004
Return-Path: <mick@mickmcquaid.com>
Received: from web107.biz.mail.yahoo.com (web107.biz.mail.yahoo.com [216.136.174.209])
          by nef.ens.fr (8.12.11/1.01.28121999) with SMTP id i7CHLkc2094930
          for <metafont@ens.fr>; Thu, 12 Aug 2004 19:21:47 +0200 (CEST)
Message-ID: <20040812172145.46541.qmail@web107.biz.mail.yahoo.com>
Received: from [128.2.196.178] by web107.biz.mail.yahoo.com via HTTP; Thu, 12 Aug 2004 10:21:45 PDT
Date: Thu, 12 Aug 2004 10:21:45 -0700 (PDT)
From: Mick McQuaid <mick@mickmcquaid.com>
Subject: Re: [metafont] [question about metapost]How to make color text in boxes?
To: metafont@ens.fr
In-Reply-To: <1092318264.10368.6.camel@joshua.smcvt.edu>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Greylist: Recipient e-mail whitelisted, not delayed by milter-greylist-1.3.3 (nef.ens.fr [129.199.96.32]); Thu, 12 Aug 2004 19:21:47 +0200 (CEST)

This may be a kludge, but does provide
white text on a colored background
surrounded by a black border.
 
  boxit.a(btex   XML  etex ); 
  fill bpath a withcolor (0.0,5.0,5.0); 
  drawboxed(a);
  draw pic a withcolor white;

I modified a diagram of mine in response
to this question.  Personally, I prefer
all black text, with very pale colors in
the boxes to denote different classes
of boxes.  This is mainly because someone
invariably insists on printing things on
a black and white printer, so the pale
background colors are the least troublesome
way to convey information that will be lost
in b/w.

Before I attempted this, I tried to use
the LaTeX color package and insert a
color directive between the btex etex
construct.  I noticed that the drawboxed(a)
commands were trashing the results, drawing
over everything in ink.  I still wanted the
black border around the box, so I checked
a Metapost tutorial and found a command,
draw pic, that would affect only the
contents of the box without the border.

I say that it may be a kludge because
I don't understand the internal workings
of Metapost, and also because there seem
to be elegant shortcuts for so many common
tasks.

--- Jim Hefferon <jim@joshua.smcvt.edu> wrote:
&gt; On Fri, 2004-08-13 at 09:26, light wrote:
&gt; &gt; Hi
&gt; &gt; 
&gt; &gt; I make a circle box and fill it with black
&gt; background. The default
&gt; &gt; text color is black too, so the text and the
&gt; background  mix up and
&gt; &gt; can't be distinguished from each other.
&gt; &gt; 
&gt; &gt; Is there any way to specify a different
color for
&gt; the text? for
&gt; &gt; instance, white, red and so on.
&gt; I think I remember using "drawoptions", on p 37
of
&gt; the mpost manual. 
&gt; Probably not the Right answer, but sometimes you
&gt; just want _an_ answer.
&gt; 
&gt; Jim
&gt; 

From - Thu Aug 12 19:26:14 2004
Return-Path: <mick@mickmcquaid.com>
Received: from web107.biz.mail.yahoo.com (web107.biz.mail.yahoo.com [216.136.174.209])
          by nef.ens.fr (8.12.11/1.01.28121999) with SMTP id i7CHQBCo096639
          for <metafont@ens.fr>; Thu, 12 Aug 2004 19:26:12 +0200 (CEST)
Message-ID: <20040812172611.47692.qmail@web107.biz.mail.yahoo.com>
Received: from [128.2.196.178] by web107.biz.mail.yahoo.com via HTTP; Thu, 12 Aug 2004 10:26:11 PDT
Date: Thu, 12 Aug 2004 10:26:11 -0700 (PDT)
From: Mick McQuaid <mick@mickmcquaid.com>
Subject: Re: [metafont] [question about metapost]How to make color text in boxes?
To: metafont@ens.fr
In-Reply-To: <20040812172145.46541.qmail@web107.biz.mail.yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Greylist: Recipient e-mail whitelisted, not delayed by milter-greylist-1.3.3 (nef.ens.fr [129.199.96.32]); Thu, 12 Aug 2004 19:26:12 +0200 (CEST)

In my previous message, where I said "drawing
over everything in ink" I meant to say
"drawing over everything in black" although
it sometimes seems as if ink is involved.

--- Mick McQuaid <mick@mickmcquaid.com> wrote:
&gt; This may be a kludge, but does provide
&gt; white text on a colored background
&gt; surrounded by a black border.
&gt;  
&gt;   boxit.a(btex   XML  etex ); 
&gt;   fill bpath a withcolor (0.0,5.0,5.0); 
&gt;   drawboxed(a);
&gt;   draw pic a withcolor white;
&gt; 
&gt; I modified a diagram of mine in response
&gt; to this question.  Personally, I prefer
&gt; all black text, with very pale colors in
&gt; the boxes to denote different classes
&gt; of boxes.  This is mainly because someone
&gt; invariably insists on printing things on
&gt; a black and white printer, so the pale
&gt; background colors are the least troublesome
&gt; way to convey information that will be lost
&gt; in b/w.
&gt; 
&gt; Before I attempted this, I tried to use
&gt; the LaTeX color package and insert a
&gt; color directive between the btex etex
&gt; construct.  I noticed that the drawboxed(a)
&gt; commands were trashing the results, drawing
&gt; over everything in ink.  I still wanted the
&gt; black border around the box, so I checked
&gt; a Metapost tutorial and found a command,
&gt; draw pic, that would affect only the
&gt; contents of the box without the border.
&gt; 
&gt; I say that it may be a kludge because
&gt; I don't understand the internal workings
&gt; of Metapost, and also because there seem
&gt; to be elegant shortcuts for so many common
&gt; tasks.
&gt; 
&gt; --- Jim Hefferon &lt;jim@joshua.smcvt.edu&gt;
wrote:
&gt; &amp;gt; On Fri, 2004-08-13 at 09:26, light
wrote:
&gt; &amp;gt; &amp;gt; Hi
&gt; &amp;gt; &amp;gt; 
&gt; &amp;gt; &amp;gt; I make a circle box and fill it
with black
&gt; &amp;gt; background. The default
&gt; &amp;gt; &amp;gt; text color is black too, so the
text and
&gt; the
&gt; &amp;gt; background  mix up and
&gt; &amp;gt; &amp;gt; can't be distinguished from
each other.
&gt; &amp;gt; &amp;gt; 
&gt; &amp;gt; &amp;gt; Is there any way to specify a
different
&gt; color for
&gt; &amp;gt; the text? for
&gt; &amp;gt; &amp;gt; instance, white, red and so on.
&gt; &amp;gt; I think I remember using "drawoptions",
on p 37
&gt; of
&gt; &amp;gt; the mpost manual. 
&gt; &amp;gt; Probably not the Right answer, but
sometimes
&gt; you
&gt; &amp;gt; just want _an_ answer.
&gt; &amp;gt; 
&gt; &amp;gt; Jim
&gt; &amp;gt; 

From - Fri Aug 13 23:38:52 2004
Return-Path: <wolfgang.huber@iheyo.org>
Received: from ns.1qaz.ws (ns.1qaz.ws [209.120.181.97])
          by nef.ens.fr (8.12.11/1.01.28121999) with ESMTP id i7DLcpwq094335
          for <metafont@ens.fr>; Fri, 13 Aug 2004 23:38:51 +0200 (CEST)
Received: from iheyo.org (localhost.localdomain [127.0.0.1])
	(authenticated (0 bits))
	by ns.1qaz.ws (8.11.6/8.11.6) with ESMTP id i7DLcjb29804
	for <metafont@ens.fr>; Fri, 13 Aug 2004 16:38:45 -0500
Received: from 140.78.254.52
        (SquirrelMail authenticated user wolfgang.huber@iheyo.org)
        by www.iheyo.org with HTTP;
        Fri, 13 Aug 2004 16:38:45 -0500 (CDT)
Message-ID: <3074.140.78.254.52.1092433125.squirrel@www.iheyo.org>
Date: Fri, 13 Aug 2004 16:38:45 -0500 (CDT)
Subject: [metapost] problems with courbes
From: <wolfgang.huber@iheyo.org>
To: <metafont@ens.fr>
X-Priority: 3
Importance: Normal
X-Mailer: SquirrelMail (version 1.2.11)
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Greylist: Recipient e-mail whitelisted, not delayed by milter-greylist-1.3.3 (nef.ens.fr [129.199.96.32]); Fri, 13 Aug 2004 23:38:52 +0200 (CEST)

Hi!

I tried the following code:

prologues:= 2;
input courbes;

vardef fx(expr t) =
        t
enddef;
vardef fy(expr t) =(if t=0: 1 else: t + t/th(t) fi) enddef;

beginfig(1);

repere(10cm,10cm,0.5cm,0.5cm,5cm,2.5cm);
trace.axes(0.5pt);
marque.unites(1mm);
pair p,q;
path m;
m= rpoint(0,1.25)--rpoint(2,1.25);
trace.courbe(0,5,50,1.5pt,0.3blue);

p = m intersectionpoint ftrace(0,2,2000);


dotlabel.ulft("anti-bonding",p)
decoupe.repere;

endfig;
end
---
but metapost says: paths don't intersect
what do I do wrong?
(in an ideal world they would intersect :-)

wolfgang
-- 
Please avoid sending me Word or PowerPoint attachments.
See http://www.fsf.org/philosophy/no-word-attachments.html




From - Thu Aug 19 11:12:57 2004
Return-Path: <ben.hiller@freenet.de>
Received: from mout2.freenet.de (mout2.freenet.de [194.97.50.155])
          by nef.ens.fr (8.12.11/1.01.28121999) with ESMTP id i7J9Cto3092194
          for <metafont@ens.fr>; Thu, 19 Aug 2004 11:12:55 +0200 (CEST)
Received: from [194.97.55.148] (helo=mx5.freenet.de)
	by mout2.freenet.de with asmtp (Exim 4.41)
	id 1Bxiyd-0004DE-CB
	for metafont@ens.fr; Thu, 19 Aug 2004 11:12:55 +0200
Received: from www14.emo.freenet-rz.de ([194.97.107.207])
	by mx5.freenet.de with esmtp (Exim 4.41 #1)
	id 1Bxiyd-0000sI-BC
	for metafont@ens.fr; Thu, 19 Aug 2004 11:12:55 +0200
Received: from www-data by www14.emo.freenet-rz.de with local (Exim 4.32 1 (Panther_1))
	id 1Bxiyd-0002no-2a
	for <metafont@ens.fr>; Thu, 19 Aug 2004 11:12:55 +0200
To: metafont@ens.fr
From: ben.hiller@freenet.de
Subject: Re: Re: [metafont] [question about metapost]How to make color text in boxes?
X-Priority: 3
MIME-Version: 1.0
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Message-Id: <E1Bxiyd-0002no-2a@www14.emo.freenet-rz.de>
Date: Thu, 19 Aug 2004 11:12:55 +0200
X-Greylist: Recipient e-mail whitelisted, not delayed by milter-greylist-1.3.3 (nef.ens.fr [129.199.96.32]); Thu, 19 Aug 2004 11:12:55 +0200 (CEST)

Hi,<br>
<br>
I tried to make colored text in MetaPost via LaTeX's "color"-command, too. =
As you already<br>
noticed this did not work. I did some experiments to study this problem. I =
think the main<br>
reason for this issue is that TeX (and LaTeX, too) itself does not now anyt=
hing about colors.<br>
Colors are implemented in add-on manner via so-called DVI-specials, which h=
ave to be<br>
interpreted by the DVI-driver (usually dvips). The problem is that the prog=
ram "dvitomp"<br>
used by MetaPost to generate MetaPost code from TeX output does not support=
 these<br>
specials and thus _everything_ taken from TeX is drawn in the current color=
.<br>
<br>
I use the following workaround to avoid typing "withcolor bla" over and ove=
r:<br>
<br>
color current_color;<br>
current_color:=3D black; % compatible to default<br>
extra_beginfig:=3D extra_beginfig & "drawoptions(withcolor current_color);"=
;<br>
<br>
If I want do some drawing in, say, yellow, I simply set<br>
<br>
current_color:=3D yellow;<br>
draw ...;<br>
label.top(btex yellow text etex, ...);<br>
<br>
and so on.<br>
<br>
Of course this is not as powerful as using the LaTeX's color-package.<br>
But it might be a good idea to implement support for some of the specials u=
nderstood<br>
by dvips and other drivers for MetaPost as well.<br>
<br>
Benjamin<br>
<br>
<br>
<br>
<br>



<br>--<br><!-- AdSpace freenet EMO Webmail Banner -->=20
<a href=3D"http://adserver.freenet.de/click.ng/site=3Dfn&prod=3Dchetools&ka=
t=3Drub&tbl=3Dwebmail&ppos=3D1&TransactionID=3D109290677566510&rgtg=3D256" =
target=3D"_blank"><img src=3D"http://adserver.freenet.de/image.ng/site=3Dfn=
&prod=3Dchetools&kat=3Drub&tbl=3Dwebmail&ppos=3D1&TransactionID=3D109290677=
566510&rgtg=3D256" border=3D"0"></a><!-- / AdSpace -->


From - Thu Aug 19 11:44:08 2004
Return-Path: <texnician@163.com>
Received: from 163.com ([202.108.44.204])
          by nef.ens.fr (8.12.11/1.01.28121999) with SMTP id i7J9i4bA007341
          for <metafont@ens.fr>; Thu, 19 Aug 2004 11:44:05 +0200 (CEST)
Received: from xoo.shemale.8866.org (unknown [222.163.18.155])
	by 192.168.1.204 (Coremail) with SMTP id IsAnSlx2JEHcZrsC.1
	for <metafont@ens.fr>; Thu, 19 Aug 2004 17:43:58 +0800 (CST)
X-Originating-IP: [222.163.18.155]
To: Mick McQuaid <mick@mickmcquaid.com>
Cc: metafont@ens.fr
Subject: Re: [metafont] [question about metapost]How to make color text in
 boxes?
References: <20040812172145.46541.qmail@web107.biz.mail.yahoo.com>
From: Tang Yaguang <texnician@163.com>
Date: Fri, 20 Aug 2004 01:43:57 +0800
Message-ID: <m2vfffyqea.fsf@xoo.shemale.8866.org>
User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3.50 (gnu/linux)
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEWDZjH83KsOHBfvtX3i
 jlUDAQNnhjxmNhb6ff7eAAACeUlEQVR4nFWUQYvbMBCFh6xYn03CnlOB4mtciT0r1dBci0HdazdL
 5aswSfT3+0bypu1AwMyneSM9jUIppVkjTNTGxKgPH33/giStYJqMmeIU43R4f4C06CnquIZOkm/A
 TCK15kE+waWqP0IfPoH+u34Va+Bi0OK/QMkBYPlMl7KURT5+Qh1Ar03fiInohu8JSYKSfJZSrmyZ
 fdcAekixLop9sL21zkv5+yuAFnEVrB37vt9ad6vgQrOBOPJ9C+s2AF9eEl1i/MGhLm/gbOp+6XeM
 e7afBdDyywMM/CgA4M5UcBMQHsBaPut/wJp2OCF7g6MngmJmZtmt6/SQKfCtAuwq+0Xr4Wk8LqVk
 DjjJIS0AkzrDvuFqPSnUouL6DJBiVB7SXQ6OuYLCz2mmZKJCR/gXnKfi2VJ2Xky8xUzkiXncsVKy
 gk5HARc097mwOzkr2wvslRMwL/AcbrnTLjix3nkWcP9V9oy24Thun5rxbGtFymKi7R38aP7SuJsF
 qMySwW87VhfVuBNLDj5zTVQIJX8dRQpFWa2rezuiwD/1L/NdpM64WWQgHkTJK5xcwMcRTcbtOXfl
 VMFzG9Hlw8mQbM8lw3oAbtM+6yt38Kq3LEIQXEEa9u5MODmCqwN+BZcDlXoRMp/QZG+XBvA8suIO
 joXQy/ja9AD7VlE7sepf7/eZirzlAd3RNdTzqfGbjI+OeJlaprdZyKRajwFPdlkwNW1Kne9Cf7lL
 BcCwDPCrmuUxFP339L1KmX3Rhbi2weZqKQD+LPYb81ZIAi8Oho72VROU4v42vZU1rjCAaBNJ9pSN
 1l3LZ9jpaWMiyTGybLgUHQe55e3XqcT4B53DG3QGASewAAAAAElFTkSuQmCC
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Greylist: Recipient e-mail whitelisted, not delayed by milter-greylist-1.3.3 (nef.ens.fr [129.199.96.32]); Thu, 19 Aug 2004 11:44:06 +0200 (CEST)

Thank you very much.
I think your solution is more elegant. ;)
I have written this macros to draw black nodes of red-black-tree:

def makeblack(text t) =
  forsuffixes $:=t:
    fill bpath$ withcolor black;
    draw pic $ withcolor white;
   endfor
enddef;

best regards!
Tang


From - Mon Aug 30 22:12:47 2004
Return-Path: <kevin.rowanet@wanadoo.fr>
Received: from mwinf0412.wanadoo.fr (smtp4.wanadoo.fr [193.252.22.27])
          by nef.ens.fr (8.12.11/1.01.28121999) with ESMTP id i7UKCkBS031346
          for <metafont@ens.fr>; Mon, 30 Aug 2004 22:12:46 +0200 (CEST)
Received: from me-wanadoo.net (localhost [127.0.0.1])
	by mwinf0412.wanadoo.fr (SMTP Server) with SMTP id 0E4A41800110
	for <metafont@ens.fr>; Mon, 30 Aug 2004 22:12:46 +0200 (CEST)
Received: from wanadoo.fr (Mix-Toulouse-209-1-152.w193-248.abo.wanadoo.fr [193.248.127.152])
	by mwinf0412.wanadoo.fr (SMTP Server) with ESMTP id DA91A18000E2
	for <metafont@ens.fr>; Mon, 30 Aug 2004 22:12:44 +0200 (CEST)
Message-ID: <4133A6C4.1050902@wanadoo.fr>
Date: Tue, 31 Aug 2004 00:14:28 +0200
From: Kevin Rowanet <kevin.rowanet@wanadoo.fr>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020623 Debian/1.0.0-0.woody.1
X-Accept-Language: en
MIME-Version: 1.0
To: metafont@ens.fr
Subject: help metapost
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Greylist: Recipient e-mail whitelisted, not delayed by milter-greylist-1.3.3 (nef.ens.fr [129.199.96.32]); Mon, 30 Aug 2004 22:12:46 +0200 (CEST)

Hello,

can anybody help me to understand what happens et how to correct the bug ?
If my way to do this is wrong, could you please tell me what is the 
right one ?

Sincerely

******************************************************************
% This macro is to build a part of a circle, center=0, radius=R
% and we build the part of the circle between [O,X) and [O,Y)
% NB : X and Y have not to be on the circle
def karccercle(expr X,Y,O,R) =
    (
        subpath (
            ypart(
                ((O--X) shifted -O scaled (R/length(O-X)) shifted O)
                intersectiontimes (fullcircle scaled R shifted O)
                ),
            ypart(
                ((O--Y) shifted -O scaled (R/length(O-Y)) shifted O)
                intersectiontimes (fullcircle scaled R shifted O)
                )
            )
        of (fullcircle scaled R shifted O)
        )
        enddef;
%==========================
	
beginfig(1)

%  figure(0,0,8u,8u);

     pair A,B,D,E,F,O;
     path pieceADF, pieceEDB;
     numeric u;

     u=3cm;
z0 = origin;
-x1=x2=y4=u;
y1=y2=x4=x0;

O=origin;
A:=z1;
B:=z2;
D:=z4;

  dotlabel.ulft("O",O);
  dotlabel.llft("A",A);
  dotlabel.lrt("B",B);
  dotlabel.bot("D",D);


  draw A--B--D--cycle;

%======================
% I build the point E : bow(BE) is a part of a circle centered in A
z6= z1 + abs(z2-z1)*dir(angle(z4-z1));
E:=z6;
dotlabel.top("E",E);

draw karccercle(B,E,A,2*length(B-A));
   draw D--E;

%======================
% I build the point F : bow(AF) is a part of a circle centered in B
  z5= z2 + abs(z2-z1)*dir(angle(z4-z2));
  F:=z5;
  dotlabel.top("F",F);

draw karccercle(F,A,B,2*length(B-A));
   draw D--F;


% what follows works perfectly :
       pieceADF = buildcycle(A--D,D--F,karccercle(F,A,B,2*abs(B-A)));
       fill pieceADF withcolor green;

%% but this is refused by mpost saying :
%% "! Paths 1 and 3 don't  intersect." Why ???
%% (and same problem when permuting B and E in karccercle)
%       pieceEDB = buildcycle(E--D,D--B,karccercle(B,E,A,2*abs(B-A)));
%       fill pieceEDB withcolor red;


endfig;
end
******************************************************************



From - Mon Aug 30 22:49:38 2004
Return-Path: <hartmut_henkel@gmx.de>
Received: from mail.gmx.net (mail.gmx.net [213.165.64.20])
          by nef.ens.fr (8.12.11/1.01.28121999) with SMTP id i7UKnXva044230
          for <metafont@ens.fr>; Mon, 30 Aug 2004 22:49:33 +0200 (CEST)
Received: (qmail 25251 invoked by uid 65534); 30 Aug 2004 20:49:32 -0000
Received: from p508BC7CD.dip0.t-ipconnect.de (EHLO hahepc1.hahe) (80.139.199.205)
  by mail.gmx.net (mp008) with SMTP; 30 Aug 2004 22:49:32 +0200
X-Authenticated: #6218946
Received: from hahe (helo=localhost)
	by hahepc1.hahe with local-esmtp (Exim 4.41)
	id 1C1t5i-00010v-Qh; Mon, 30 Aug 2004 22:49:26 +0200
Date: Mon, 30 Aug 2004 22:49:26 +0200 (CEST)
From: Hartmut Henkel <hartmut_henkel@gmx.de>
To: Kevin Rowanet <kevin.rowanet@wanadoo.fr>
cc: metafont@ens.fr
Subject: Re: [metafont] help metapost
In-Reply-To: <4133A6C4.1050902@wanadoo.fr>
Message-ID: <Pine.LNX.4.61.0408302244590.3723@hahepc1.hahe>
References: <4133A6C4.1050902@wanadoo.fr>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Greylist: Recipient e-mail whitelisted, not delayed by milter-greylist-1.3.3 (nef.ens.fr [129.199.96.32]); Mon, 30 Aug 2004 22:49:33 +0200 (CEST)

On Tue, 31 Aug 2004, Kevin Rowanet wrote:

> can anybody help me to understand what happens et how to correct the bug ?
> If my way to do this is wrong, could you please tell me what is the right one
>
> %% but this is refused by mpost saying :
> %% "! Paths 1 and 3 don't  intersect." Why ???
> %% (and same problem when permuting B and E in karccercle)
> %       pieceEDB = buildcycle(E--D,D--B,karccercle(B,E,A,2*abs(B-A)));

       pieceEDB = buildcycle(E--D,D--B,karccercle(B,E,A,1.9999*abs(B-A)));

with 1.9999 instead of 2.0 it works (it doesn't with 1.99999), seems to
be a border problem, maybe just let the things really intersect a
little, to be safe.

Regards, Hartmut

