From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/45132 Path: news.gmane.org!not-for-mail From: "Wolfgang Schuster" Newsgroups: gmane.comp.tex.context Subject: Re: Colored labels with MetaPost in MkII Date: Mon, 27 Oct 2008 09:28:39 +0100 Message-ID: <115224fb0810270128u5e70796ek5d0a34f2ac6579f8@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 1225096226 15428 80.91.229.12 (27 Oct 2008 08:30:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 27 Oct 2008 08:30:26 +0000 (UTC) To: "mailing list for ConTeXt users" Original-X-From: ntg-context-bounces@ntg.nl Mon Oct 27 09:31:27 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 1KuNVW-0005e3-M2 for gctc-ntg-context-518@m.gmane.org; Mon, 27 Oct 2008 09:31:26 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id B63C71FB82; Mon, 27 Oct 2008 09:30:18 +0100 (CET) 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 02411-02-4; Mon, 27 Oct 2008 09:29:16 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id CD9F71FB30; Mon, 27 Oct 2008 09:29:15 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 07FC31FADC for ; Mon, 27 Oct 2008 09:29:14 +0100 (CET) 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 00440-03-4 for ; Mon, 27 Oct 2008 09:28:39 +0100 (CET) Original-Received: from mu-out-0910.google.com (mu-out-0910.google.com [209.85.134.186]) by ronja.ntg.nl (Postfix) with ESMTP id 8BCB51FB30 for ; Mon, 27 Oct 2008 09:28:39 +0100 (CET) Original-Received: by mu-out-0910.google.com with SMTP id w9so1593603mue.4 for ; Mon, 27 Oct 2008 01:28:39 -0700 (PDT) Original-Received: by 10.103.206.12 with SMTP id i12mr2603542muq.51.1225096119146; Mon, 27 Oct 2008 01:28:39 -0700 (PDT) Original-Received: by 10.103.215.10 with HTTP; Mon, 27 Oct 2008 01:28:39 -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:45132 Archived-At: On Fri, Oct 24, 2008 at 2: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. > >> \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)) ; > > But then you have to be careful about the differences between \sometxt in > MKII and MKIV (which I need to summarize on the wiki). Here is a new example where I can't even use \sometxt. \setupcolors[state=start] \def\labelstyle{bold} \def\labelcolor{red} \starttext \resetMPdrawing \startMPdrawing label(textext("\doattributes{label}{style}{color}{Label}"),origin) ; label(\sometxt{\doattributes{label}{style}{color}{Label}},origin) ; \stopMPdrawing \MPdrawingdonetrue \getMPdrawing \stoptext 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 ___________________________________________________________________________________