From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/65324 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Stefan_M=FCller?= Newsgroups: gmane.comp.tex.context Subject: Labels in MetaPost (MetaObj) Date: Tue, 18 Jan 2011 13:17:45 +0100 Message-ID: <4D3584E9.20603@gmx.de> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1295353083 19696 80.91.229.12 (18 Jan 2011 12:18:03 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 18 Jan 2011 12:18:03 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Jan 18 13:17:59 2011 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PfAVb-0008G2-0m for gctc-ntg-context-518@m.gmane.org; Tue, 18 Jan 2011 13:17:59 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 10148CA9D7; Tue, 18 Jan 2011 13:17:58 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 9XDff+DKhu3P; Tue, 18 Jan 2011 13:17:55 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 84F37CA943; Tue, 18 Jan 2011 13:17:55 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 15185CA943 for ; Tue, 18 Jan 2011 13:17:54 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Q8rkJMplgHuP for ; Tue, 18 Jan 2011 13:17:52 +0100 (CET) Original-Received: from filter7-ams.mf.surf.net (filter7-ams.mf.surf.net [192.87.102.75]) by balder.ntg.nl (Postfix) with ESMTP id 06778CA926 for ; Tue, 18 Jan 2011 13:17:52 +0100 (CET) Original-Received: from mailout-de.gmx.net (mailout-de.gmx.net [213.165.64.23]) by filter7-ams.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with SMTP id p0ICHnYx011885 for ; Tue, 18 Jan 2011 13:17:50 +0100 Original-Received: (qmail invoked by alias); 18 Jan 2011 12:17:47 -0000 Original-Received: from 77-64-133-119.dynamic.primacom.net (EHLO [192.168.100.108]) [77.64.133.119] by mail.gmx.net (mp025) with SMTP; 18 Jan 2011 13:17:47 +0100 X-Authenticated: #11064435 X-Provags-ID: V01U2FsdGVkX1826r1wBrY28kMskqXMpL2OSIfdWfLVAGYw1ILjFs ISKjcGtmt2Pgwk User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 X-Y-GMX-Trusted: 0 X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=213.165.64.23; country=DE; latitude=51.0000; longitude=9.0000; http://maps.google.com/maps?q=51.0000,9.0000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0DDV0hN0l - a3a0cf197f65 - 20110118 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.75 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 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 Xref: news.gmane.org gmane.comp.tex.context:65324 Archived-At: Hi list, I'm having some trouble with MetaPost in general and MetaObj in particular. I hope someone on this list can assist me here. I'm trying to run the appended ConTeXt file with a quite simple object "Segment" (from the manual [1], section 2.1). This script works fine as it is. I wanted to add a simple TeX label ("\tt \overbar{E}") to the drawing macro, but failed. When including the line marked with "% 1" the TeX run fails. I don't understand why. The line with "% 2" is taken frome the metaobj manual (section 5.8) [1], but including this doesn't work either. It would be great if someone could tell me what's wrong with the mp-code below and explain how to place a (TeX) label inside a metaobj object. Thanks in advance, Stefan. [1] http://tex.loria.fr/prod-graph/momanual.pdf PS: Both variants fail with mp error messages like this: "mplib > mp terminal: ! Inconsistent equation (off by 1). ; assignObj->(SUFFIX0)=incr(nObj_); iname_[(SUFFIX0)]=str(SUFFIX0);addclass_((S... newSegment->...roup.assignObj((SUFFIX2),"Segment") ;ObjPoint.a,b;ObjCode"@##b... ; <*> ...ar {E}") shifted n.a; enddef; newSegment.s; s.a=origin; drawObj(s); ; ! Redundant equation. ; assignObj->...bj_);iname_[(SUFFIX0)]=str(SUFFIX0); addclass_((SUFFIX0),(EXPR1... newSegment->...roup.assignObj((SUFFIX2),"Segment") ;ObjPoint.a,b;ObjCode"@##b..." <=======================================> \startMPinclusions input metaobj; \stopMPinclusions \startMPpage vardef newSegment@#= assignObj(@#,"Segment"); ObjPoint a,b; ObjCode "@#b-@#a=(1cm,2cm)"; enddef; def drawSegment(suffix n)= draw n.a--n.b; % draw btex \tt \overbar{E} etex shifted n.a; % 1 enddef; newSegment.s; % ObjLabel.s(btex hello! etex) "labpoint(a)"; % 2 s.a=origin; drawObj(s); \stopMPpage <=======================================> ___________________________________________________________________________________ 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________