From: Hans Hagen <pragma@wxs.nl>
Subject: Re: \sometxt in staticMPfigure
Date: Tue, 26 Sep 2006 22:11:59 +0200 [thread overview]
Message-ID: <4519898F.4070903@wxs.nl> (raw)
In-Reply-To: <E1GSD3q-0007y3-00@skye.ra.phy.cam.ac.uk>
Sanjoy Mahajan wrote:
>> you can test the beta
>>
>
> This gives the clearboxes error:
>
> =================== box.tex ===================
> \startMPinclusions
> input boxes
> \stopMPinclusions
>
> \starttext
> \startstaticMPfigure{fig}
> boxit.h(btex h etex);
> drawboxed(h);
> \stopstaticMPfigure
> \usestaticMPfigure[fig]
> \stoptext
> =====================================
>
> The cause is that it produces this intermediate mp file:
>
> ========= box-fig.mp ===============
> input boxes
> boxit.h(btex h etex);
> drawboxed(h);
> ===================================
>
> This fails because all three lines go into a beginfig..endfig and
> metapost fails. That may be a metapost bug in this case, but for
> robustness I think it should become:
>
> input boxes
> beginfig(1)
> boxit.h(btex h etex);
> drawboxed(h);
> endfig;
> end
>
> In order to do that transformation, box-fig.mp would need separate
> sections for the inclusions and for the main figure code.
>
> Am I using inclusions incorrectly? i.e. Should I instead use
> MPextensions to get material placed at the top of the metapost file
> for use by all figures? Like this:
>
> =============== box-e.tex ================
> \startMPextensions
> input boxes
> \stopMPextensions
>
> \starttext
> \startstaticMPfigure{fig}
> boxit.h(btex h etex);
> drawboxed(h);
> \stopstaticMPfigure
> \usestaticMPfigure[fig]
> \stoptext
> =======================================
>
> But that produces
>
> (texexec-mpgraph.mp
> >> boxit.h
> ! Isolated expression.
> <to be read again>
> (
> l.148 boxit.h(
> btex h etex
> ?
>
> because the added extensions ('input boxes') are not included in
> texexec-mpgraph.mp.
>
the problem (if you look into the mp file) is that there is *no*
beginfig; this is because we now use a more stupid (stripped down)
variant of saving the graphic.
\startstaticMPfigure{fig}
beginfig(1);
boxit.h(btex h etex);
drawboxed(h);
endfig;
\stopstaticMPfigure
i'll add the b/e to the main macro.
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
| www.pragma-pod.nl
-----------------------------------------------------------------
next prev parent reply other threads:[~2006-09-26 20:11 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-25 3:51 Sanjoy Mahajan
2006-09-25 13:45 ` Hans Hagen
2006-09-25 20:39 ` Sanjoy Mahajan
2006-09-25 22:06 ` Hans Hagen
2006-09-25 23:04 ` Sanjoy Mahajan
2006-09-26 10:04 ` Hans Hagen
2006-09-26 12:11 ` Sanjoy Mahajan
2006-10-04 22:01 ` Aditya Mahajan
2006-10-05 8:00 ` Hans Hagen
2006-10-05 12:56 ` Sanjoy Mahajan
2006-09-26 0:53 ` Sanjoy Mahajan
2006-09-26 9:57 ` Hans Hagen
2006-09-26 12:02 ` Sanjoy Mahajan
2006-09-26 12:30 ` Hans Hagen
2006-09-26 13:33 ` Sanjoy Mahajan
2006-09-26 20:11 ` Hans Hagen [this message]
2006-09-27 4:29 ` Sanjoy Mahajan
2006-09-26 16:17 ` Sanjoy Mahajan
2006-09-26 16:21 ` Hans Hagen
2006-09-27 4:06 ` Sanjoy Mahajan
2006-09-27 8:03 ` Hans Hagen
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=4519898F.4070903@wxs.nl \
--to=pragma@wxs.nl \
--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).