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 -----------------------------------------------------------------