From: "Stefan Müller" <warrence.stm@gmx.de>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Labels in MetaPost (MetaObj)
Date: Tue, 18 Jan 2011 13:17:45 +0100 [thread overview]
Message-ID: <4D3584E9.20603@gmx.de> (raw)
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).
<to be read again>
;
assignObj->(SUFFIX0)=incr(nObj_);
iname_[(SUFFIX0)]=str(SUFFIX0);addclass_((S...
newSegment->...roup.assignObj((SUFFIX2),"Segment")
;ObjPoint.a,b;ObjCode"@##b...
<to be read again>
;
<*> ...ar {E}") shifted n.a; enddef; newSegment.s;
s.a=origin;
drawObj(s); ;
! Redundant equation.
<to be read again>
;
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
___________________________________________________________________________________
next reply other threads:[~2011-01-18 12:17 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-18 12:17 Stefan Müller [this message]
2011-01-20 8:59 ` Taco Hoekwater
2011-01-21 23:10 ` Hans Hagen
2011-01-22 1:38 ` Aditya Mahajan
2011-01-22 13:25 ` Stefan Müller
2011-01-22 16:30 ` Aditya Mahajan
2011-01-23 11:40 ` Stefan Müller
2011-01-23 12:25 ` Stefan Müller
2011-01-23 17:22 ` Aditya Mahajan
2011-01-23 21:14 ` Stefan Müller
2011-01-24 15:34 ` Stefan Müller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D3584E9.20603@gmx.de \
--to=warrence.stm@gmx.de \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).