From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/45076 Path: news.gmane.org!not-for-mail From: "Wolfgang Schuster" Newsgroups: gmane.comp.tex.context Subject: Re: Colored labels with MetaPost in MkII Date: Fri, 24 Oct 2008 15:32:58 +0200 Message-ID: <115224fb0810240632j568c0d14ne25f577f0abe294d@mail.gmail.com> References: <115224fb0810240148o31a5b87blacbac5bc7caca9a@mail.gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1224857248 26138 80.91.229.12 (24 Oct 2008 14:07:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 24 Oct 2008 14:07:28 +0000 (UTC) To: "mailing list for ConTeXt users" Original-X-From: ntg-context-bounces@ntg.nl Fri Oct 24 16:08:28 2008 connect(): Connection refused 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 lo.gmane.org with esmtp (Exim 4.50) id 1KtNKj-0008TA-Os for gctc-ntg-context-518@m.gmane.org; Fri, 24 Oct 2008 16:08:09 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 51A521FB3C; Fri, 24 Oct 2008 16:07:01 +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 23605-01-2; Fri, 24 Oct 2008 16:05:58 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 5EB171FBD0; Fri, 24 Oct 2008 16:05:56 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 570421FB3C for ; Fri, 24 Oct 2008 16:05:55 +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 19610-05-10 for ; Fri, 24 Oct 2008 16:04:51 +0200 (CEST) Original-Received: from gv-out-0910.google.com (gv-out-0910.google.com [216.239.58.188]) by ronja.ntg.nl (Postfix) with ESMTP id E7FD51FB6D for ; Fri, 24 Oct 2008 15:32:58 +0200 (CEST) Original-Received: by gv-out-0910.google.com with SMTP id l14so117208gvf.1 for ; Fri, 24 Oct 2008 06:32:58 -0700 (PDT) Original-Received: by 10.103.6.6 with SMTP id j6mr1026898mui.89.1224855178115; Fri, 24 Oct 2008 06:32:58 -0700 (PDT) Original-Received: by 10.103.215.10 with HTTP; Fri, 24 Oct 2008 06:32:58 -0700 (PDT) In-Reply-To: Content-Disposition: inline X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.9 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:45076 Archived-At: On Fri, Oct 24, 2008 at 3:15 PM, Aditya Mahajan wrote: > On Fri, 24 Oct 2008, Wolfgang Schuster wrote: > >> Hi all, >> >> what is the best method to format MetaPost labels in MkII with \doattributes. > > \startMPenvironment[global] >> \setupcolors[state=start] >> >> \def\labelstyle{bold} >> \def\labelcolor{red} > \stopMPenvironment > > This gives you only bold label. I try to avoid this. >> \starttext >> \startMPcode >> label(textext("\doattributes{label}{style}{color}{Label}"),origin) ; >> \stopMPcode >> \stoptext > > Tex colors do not work inside textext. Try > > label(textext("\startcolor[red] red \stopcolor"), origin) ; > > One way to get around this is to use \sometxt. > > label(\sometxt{\doattributes{label}{style}{color}{Label}},(5cm,0)) ; This helped me. > But then you have to be careful about the differences between \sometxt in > MKII and MKIV (which I need to summarize on the wiki). I use different code for MkII and MkIV and could use the best for each file. Thanks and regards, Wolfgang ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________