From: "Stefan Müller" <warrence.stm@gmx.de>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: MetaObj with labels in built-in objects (MetaObj Standard Library)
Date: Tue, 20 Sep 2011 15:25:38 +0200 [thread overview]
Message-ID: <4E789452.2050807@gmx.de> (raw)
Hi list,
some time ago I posted on this list about problems with MetaObj in
ConTeXt when using labels. There's a wiki article about this now [1].
Just recently I was forced to notice that this solution does not work
when the label to be drawn is part of the object definition. So the
example from [1] works fine with the added boolean flag, but the
following example (which means basically all built-in MetaObj objects
with text) does not. It compiles well but there is no text.
--8<--------------------start--------------------8<--
\startMPinclusions[+]
input metaobj;
boolean firstrun; firstrun := true;
\stopMPinclusions
\startMPpage
if firstrun:
newBox.a(\sometxt{Text});
a.c = origin;
fi;
drawObj(a);
firstrun := false;
\stopMPpage
-->8--------------------stop-------------------->8--
I'm out of ideas how to fix this. I tried putting the text into a
separate pictrue variable and use this in "newBox". In addition, I
thought it should be possible to modify metaobj.mp to check for a
boolean variable (e.g. "firstrun") and let the macros there react to its
value accordingly , but I always got either no text or errors.
I can draw the picture I wanted to get in the first place with plain
MetaFun, but I thought MetaObj would be even more "fun". Now I'm very
curious if someone on this list can come up with something. I think it
would be great if MetaObj could be fully used within ConTeXt.
Thanks in advance for taking the time to think about this and any hints!
Kind regards,
Stefan.
[1] http://wiki.contextgarden.net/MetaObj_and_Labels
___________________________________________________________________________________
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
___________________________________________________________________________________
reply other threads:[~2011-09-20 13:25 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=4E789452.2050807@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).