Hi,
some time ago I needed to include a png file into a MetaPost picture and 
I did it with the MetaFun macro externalfigure. I compiled the code with 
mptopdf and the result was fine. Since I had no previous experience with 
it, my code used LaTeX, not ConTeXt, for the labels.

I have recently updated my distributions (TeX Live 2007 and gwTeX on Mac 
OS X) and the same code does not work any longer in either distribution. 
A minimal example reproducing the problem is as follows:

verbatimtex 
%&latex 
\documentclass{article} 
\begin{document} 
etex 

beginfig(0);
 externalfigure "pic.png" scaled 15mm shifted origin;
 label.bot(btex $x$ etex, origin);
endfig;
end;

The error mptopdf gives is:

! Undefined control sequence.
l.44 \documentclass
                   {article}

as if the code were not interpreted as LaTeX code. I have tried the 
following two variants, but with no positive results:

1) I have used

input TEX;
TEXPRE("%&latex" & char(10) & 
"\documentclass{article}\begin{document}"); 
TEXPOST("\end{document}"); 

instead of the verbatimtex.. etex block, and

   label.bot(TEX("x_1"), origin);

to draw the label. In this case, mptopdf does not complain, but I see 
'0' instead of the label in the output.

2) I have added

input mp-tool;
input mp-spec;

to both the original code above and to variant 1) and I have typeset 
with mpost. The results are 

original code) the png picture is not shown in the output;
variant 1) I get the error:

! Unable to make mpx file.
l.3 btex
         x_1 etex

So, I kindly ask someone to help me tidy things up. In particular: 

a) Is it possible to include the MetaFun macros when using mpost?
b) Is it possible to use the %&latex syntax with mptopdf?

Nicola

_______________________________________________
ntg-context mailing list
[email protected]
http://www.ntg.nl/mailman/listinfo/ntg-context

Reply via email to