From - Mon Mar  1 01:51:24 2004
Return-Path: <jazevedo@provide.com.br>
Received: from smtp-out6.blueyonder.co.uk (smtp-out6.blueyonder.co.uk [195.188.213.9])
          by nef.ens.fr (8.12.10/1.01.28121999) with ESMTP id i210pJ5v035343
          for <metafont@ens.fr>; Mon, 1 Mar 2004 01:51:19 +0100 (CET)
Received: from Lepc204 ([82.39.49.95]) by smtp-out6.blueyonder.co.uk with Microsoft SMTPSVC(5.0.2195.5600);
	 Mon, 1 Mar 2004 00:51:19 +0000
From: "Joao Pedro W. de Azevedo" <jazevedo@provide.com.br>
To: <metafont@ens.fr>
Subject: Text box in figure
Date: Mon, 1 Mar 2004 00:51:17 -0000
Message-ID: <000001c3ff27$4ea576e0$6d64a8c0@Lepc204>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook, Build 10.0.4510
Importance: Normal
In-Reply-To: <MBBBJFILCHONLINKEBBKMEHECCAA.romeomedina@libero.it>
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
X-OriginalArrivalTime: 01 Mar 2004 00:51:19.0599 (UTC) FILETIME=[4F5083F0:01C3FF27]

Hello, 
I would like to know if it is possible (and how?) to inserte a a text box
inside a metpost figure? I would to have a setence explaning a particular
line, and that metapost would automatically fit this sentence within the
limits of a predetermined box.
Many thanks in advance,
Joao Pedro


From - Mon Mar  1 13:40:07 2004
Return-Path: <romeomedina@libero.it>
Received: from smtp2.libero.it (smtp2.libero.it [193.70.192.52])
          by nef.ens.fr (8.12.10/1.01.28121999) with ESMTP id i21Ce55v098843
          for <metafont@ens.fr>; Mon, 1 Mar 2004 13:40:05 +0100 (CET)
Received: from a3i3g5 (151.26.91.60) by smtp2.libero.it (7.0.020-DD01)
        id 401CAD6A00BA0DC2 for metafont@ens.fr; Mon, 1 Mar 2004 13:40:45 +0100
From: "Rodolfo Medina" <romeomedina@libero.it>
To: <metafont@ens.fr>
Subject: Re: [metafont] Multi coloured text in the Metapost labels
Date: Mon, 1 Mar 2004 13:39:28 +0100
Message-ID: <MBBBJFILCHONLINKEBBKMEHHCCAA.romeomedina@libero.it>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0)
Importance: Normal
In-Reply-To: <MBBBJFILCHONLINKEBBKMEHECCAA.romeomedina@libero.it>
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Disposition-Notification-To: "Rodolfo Medina" <romeomedina@libero.it>

Hi, everybody.

I'm trying to insert some coloured text inside Metapost labels. I'm a plain
TeX user.
To get coloured text with plain TeX you just need to \input the file
color.tex into the tex file
and then say, for example,

\textcolor{red}{Hi!}

It works perfectly.
Now, with Metapost I tried to follow exeactly what is said on page 21 of
John Hobby's Metapost manual:
my metapost input file looks something like this:



verbatimtex \input color.tex etex

beginfig(1);
  .
  .

label(btex \textcolor{red}{Hi} etex,z2);
  .
  .



No complain, no error message;
but in the .ps file there's `Hi' normally black, not coloured.
What can I do?

Thanks in advance,
Rodolfo


From - Mon Mar  1 13:40:29 2004
Return-Path: <romeomedina@libero.it>
Received: from smtp2.libero.it (smtp2.libero.it [193.70.192.52])
          by nef.ens.fr (8.12.10/1.01.28121999) with ESMTP id i21CeQ5v099008
          for <metafont@ens.fr>; Mon, 1 Mar 2004 13:40:26 +0100 (CET)
Received: from a3i3g5 (151.26.91.60) by smtp2.libero.it (7.0.020-DD01)
        id 401CAD6A00BA0E40 for metafont@ens.fr; Mon, 1 Mar 2004 13:41:07 +0100
From: "Rodolfo Medina" <romeomedina@libero.it>
To: <metafont@ens.fr>
Subject: Re: [metafont] A macro to draw angles
Date: Mon, 1 Mar 2004 13:40:10 +0100
Message-ID: <MBBBJFILCHONLINKEBBKOEHHCCAA.romeomedina@libero.it>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0)
Importance: Normal
In-Reply-To: <MBBBJFILCHONLINKEBBKGEGLCCAA.romeomedina@libero.it>
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Disposition-Notification-To: "Rodolfo Medina" <romeomedina@libero.it>

-----Messaggio originale-----
Da: Rodolfo Medina [mailto:romeomedina@libero.it]
Inviato: marted́ 24 febbraio 2004 14.10
A: metafont@ens.fr
Oggetto: [metafont] A macro to draw angles


Hi, everyone.

I tried to write down a macro to draw angles, with metapost:

def draw_angle_(expr A,O,B,d) =
path r,q,s;
r := fullcircle scaled d shifted O;
q :=O..A;
s :=O..B;
A=(e,f); B=(g,h); O=(i,l);
if h=l:
  draw (r cutafter q);
  elseif f=l:
draw (r cutbefore s);
else:
draw (r cutafter q);
draw (r cutbefore s);
fi;
enddef;

It seemes to work with this angle:

beginfig(1);
a=.7in; b=.5in; c=.3in; d=.2in;
z0=(0,0); z1=(b,c); z2=(a,-c);
drawarrow z0..z1;
drawarrow z0..z2;
draw_angle_(z1,z0,z2,3mm);
endfig;

But with this:

beginfig(2);
z0=(0,-b); z1=(b,c); z2=(a,-c);
drawarrow z0..z1;
drawarrow z0..z2;
draw_angle_(z1,z0,z2,3mm);
endfig;

I get the following error message:


! Inconsistent equation (off by 36).
<to be read again>
                   ;
draw_angle_->...(e,f);(EXPR2)=(g,h);(EXPR1)=(i,l);

if.h=l:draw(r.cutafter.q);...
l.36   draw_angle_(z1,z0,z2,3mm)
                                ;


Could anyone explain the situation?

Thanks, indeed.
Rodolfo


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%
I seemed to work out the problem just typing

numeric e,f,g,h,i,l;

inside the draw_angle definition.

Thanks indeed to all who responded.

						Rodolfo







From - Mon Mar  1 16:52:11 2004
Return-Path: <jdiaz@etsiig.uniovi.es>
Received: from ALEPH.NET.UNIOVI.ES (aleph.net.uniovi.es [156.35.11.1])
          by nef.ens.fr (8.12.10/1.01.28121999) with ESMTP id i21Fq75v006236
          for <metafont@ens.fr>; Mon, 1 Mar 2004 16:52:07 +0100 (CET)
Received: from CONVERSION-DAEMON.aleph.net.uniovi.es by aleph.net.uniovi.es
 (PMDF V6.2-X17 #30549) id <01L77XGHHGN40001J8@aleph.net.uniovi.es> for
 metafont@ens.fr; Mon, 01 Mar 2004 16:51:31 +0100 (MET)
Received: from sirio.edv.uniovi.es (sirio.edv.uniovi.es [156.35.151.2])
 by aleph.net.uniovi.es (PMDF V6.2-X17 #30549)
 with SMTP id <01L77XGFUTP8000AQ7@aleph.net.uniovi.es>; Mon,
 01 Mar 2004 16:51:29 +0100 (MET)
Received: from localhost by sirio.edv.uniovi.es (SMI-8.6/SMI-SVR4)
	id QAA28328; Mon, 01 Mar 2004 16:51:27 +0100
Date: Mon, 01 Mar 2004 16:51:27 +0100 (MET)
From: "Jose Luis Diaz de Arriba." <jdiaz@etsiig.uniovi.es>
Subject: Re: [metafont] Multi coloured text in the Metapost labels
In-reply-to: <MBBBJFILCHONLINKEBBKMEHHCCAA.romeomedina@libero.it>
X-Sender: jdiaz@sirio.edv.uniovi.es
To: Rodolfo Medina <romeomedina@libero.it>
Cc: metafont@ens.fr
Message-id: <Pine.GSO.3.95.1040301164704.26146A-100000@sirio.edv.uniovi.es>
MIME-version: 1.0
Content-type: TEXT/PLAIN; charset=US-ASCII
Content-transfer-encoding: 7BIT

On Mon, 1 Mar 2004, Rodolfo Medina wrote:

romeomedina> Now, with Metapost I tried to follow exeactly what is said on page 21 of
romeomedina> John Hobby's Metapost manual:
romeomedina> my metapost input file looks something like this:
romeomedina> 
romeomedina> 
romeomedina> 
romeomedina> verbatimtex \input color.tex etex
romeomedina> 
romeomedina> beginfig(1);
romeomedina>   .
romeomedina>   .
romeomedina> 
romeomedina> label(btex \textcolor{red}{Hi} etex,z2);
romeomedina>   .
romeomedina>   .
romeomedina> 
romeomedina> 
romeomedina> 
romeomedina> No complain, no error message;
romeomedina> but in the .ps file there's `Hi' normally black, not coloured.
romeomedina> What can I do?

You can use the package "latexmp", available on CTAN, which allows
for parametrizable text, and for multicoloured labels.

Alternatively you can take a look at the method explained at
http://ltx.blogspot.com/2003_09_01_ltx_archive.html#106425083726331540
which requires to download the source code of metapost and applying it a
patch. After this, your example would produce the text in red as expected
(the mentioned website is in spanish, but I can post here a
translation if required)

Regards,

-----------------------------------------------------------------------
 Jose Luis Diaz de Arriba                  e-mail: jdiaz@atc.uniovi.es
-----------------------------------------------------------------------


