ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: nicola <vitacolo@dimi.uniud.it>
To: ntg-context@ntg.nl
Subject: Relationship among mptopdf, mpost and latex
Date: Sun, 25 Mar 2007 17:36:00 +0200	[thread overview]
Message-ID: <vitacolo-2FEAF0.17355925032007@sea.gmane.org> (raw)

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

             reply	other threads:[~2007-03-25 15:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-25 15:36 nicola [this message]
2007-03-27  8:48 ` luigi scarso
2007-03-29  0:59   ` Mojca Miklavec
2007-03-29  8:32     ` Taco Hoekwater
2007-03-29 14:47       ` Hans Hagen
2007-03-31 17:33         ` nicola
2007-03-29 18:19 ` luigi scarso

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=vitacolo-2FEAF0.17355925032007@sea.gmane.org \
    --to=vitacolo@dimi.uniud.it \
    --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).