ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
Subject: Re: \textext can fail in definitions in \startMPinclusions
Date: Mon, 25 Sep 2006 15:46:33 +0200	[thread overview]
Message-ID: <4517DDB9.9010802@wxs.nl> (raw)
In-Reply-To: <E1GRh6m-0006CQ-1T@approximate.corpus.cam.ac.uk>

Sanjoy Mahajan wrote:
> Another test file for metafun.  I know that textext doesn't work in
> loops.  I don't understand how it's implemented enough to know why, but
> is the reason for its not working in loops the same as the reason it
> doesn't work in included definitions (related to static analysis of the
> code)?
>
> The following file gives an example of what I mean.  It gives a page
> saying "unknown", but if one uses draw \textext{directly} directly (the
> commented-out line) then it works as expected.  I see the same behavior
> with \sometxt{}.  [All with context 2006.08.08]
>
> ====================  cut here ====================
> \starttext
> \startMPinclusions
> def yy = 
>   draw \textext{via yy def}
> enddef;
> \stopMPinclusions
>
> \startMPcode
>   % draw \textext{directly};  % would give "via yy def" as the text
>   yy;                         % gives "unknown" as the text on the page
> \stopMPcode
> \stoptext
> ====================  cut here ====================
>
> Oh maybe here's the problem.  The log file says (1.tex is the test
> file):
>
>   system(mpost  -progname=metafun -mem=metafun 1-mpgraph)...executed.
>
> Doing that by hand to get PDF gives a figure containing "unknown":
>
> $ mpost  -progname=metafun -mem=metafun 1-mpgraph
> $ mptopdf 1-mpgraph.1
>
> But "texexec --mpgraphic 1.mp" produces the right figure.  So why does
> \startMPcode run the wrong command?  The following works fine:
>
> ==================== cut here ====================
> \starttext
> \startMPinclusions
> def yy = 
>   draw \textext{via yy def};
> enddef;
> \stopMPinclusions
>   
\forceMPTEXgraphictrue

inclusions are not parsed for MPTEX content
> \startstaticMPfigure{a}
>   yy;
> \stopstaticMPfigure
>
> \usestaticMPfigure[a]
> \stoptext
> ==================== cut here ====================
>   
-----------------------------------------------------------------
                                          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
-----------------------------------------------------------------

      reply	other threads:[~2006-09-25 13:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-25  3:26 Sanjoy Mahajan
2006-09-25 13:46 ` Hans Hagen [this message]

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=4517DDB9.9010802@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).