ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* emp.sty and metapost
@ 2006-06-28  4:00 David Arnold
  2006-06-28  4:23 ` Aditya Mahajan
  0 siblings, 1 reply; 14+ messages in thread
From: David Arnold @ 2006-06-28  4:00 UTC (permalink / raw)


All,

Not strictly a context question, but it has to do with Metapost, so  
maybe someone can help.

I have a file of macros called qdftools.mp:

numeric s; s=0.2;
color gridlines; gridlines:=(s,s,s);

def openbluedot(expr pos)=
fill fullcircle scaled 4pt withcolor white;
draw fullcircle scaed 4pt withcolor blue;
enddef;

def openreddot(expr pos)=
fill fullcircle scaled 4pt withcolor white;
draw fullcircle scaed 4pt withcolor red;
enddef;

def filledreddot(expr pos)=
fill fullcircle scaled 4pt withcolor red;
draw fullcircle scaed 4pt withcolor red;
enddef;

def filledbluedot(expr pos)=
fill fullcircle scaled 4pt withcolor blue;
draw fullcircle scaed 4pt withcolor blue;
enddef;

def vtick(expr pos)=
draw ((0,-3)--(0,3)) shifted pos;
enddef;

def htick(expr pos)=
draw ((-3,0)--(3,0)) shifted pos;
enddef;

def gridfivefive =
for k=-5u step 1u until 5u:
   draw (-5u,k)--(5u,k) withcolor gridlines;
   draw (k,-5u)--(k,5u) withcolor gridlines;
endfor;
enddef;

def xyaxesfivefive=
drawdblarrow (-5u,0)--(5u,0);
label.rt(btex $x$ etex, (5u,0));
label.bot(btex $5$ etex, (5u,0));
drawdblarrow (0,-5u)--(0,5u);
label.top(btex $y$ etex, (0,5u));
label.lft(btex $5$ etex, (0,5u));
enddef;

endinput;

In the same directory as qdftools.mp, I have a file useemp.tex. Note  
that I am using the emp package.

\documentclass{article}
\usepackage{amsmath}
\usepackage{emp,ifpdf}

\ifpdf
\DeclareGraphicsRule{*}{mps}{*}{}
\fi

\setlength{\unitlength}{1cm}

\begin{document}

Now is the time for all good men to come to the aid of their country.

\empprelude{input qdftools}

\begin{empfile}
\begin{empdef}[david](4,4)
numeric u; 10u=3in;
gridfivefive;
xyaxesfivefive;
\end{empdef}
\end{empfile}

\immediate\write18{mpost  \jobname}

\empuse{david}

Now is the time for all good men to come to the aid of their country.

\end{document}

Now, here is what I fail to understand. If I compile useemp.tex with:

pdflatex --shell-escape useemp

Then all is well. I get a nice pdf file.

However, if I change one line in the file useemp.tex, namely

\immediate\write18{mpost  \jobname}

to:

\immediate\write18{mpost  -tex=latex \jobname}

Then if I remove the file qdftools.mpx and compile useemp.tex with:

pdflatex --shell-escape useemp

Then I get:

loading : Context Support Macros / PDF (2004.03.26)
)This is MetaPost, Version 0.901 (Web2C 7.5.5)
(useemp.mp (qdftools.mpnewer: target file `qdftools.mpx' doesn't exist.
/usr/local/teTeX/bin/powerpc-apple-darwin-current/makempx: Command  
failed: latex mpxerr.tex; see mpxerr.log

 >> qdftools.mp
 >> qdftools.mpx
! Unable to make mpx file.
l.41  label.rt(btex
                     $x$ etex, (5u,0));
Transcript written on useemp.log.

Can anyone tell how to work around this problem? I know Context has  
much better support for labels, but I need to write this in Latex for  
our online testing system. http://scinux.redwoods.edu/cgi-bin/ 
online_s06/testing.cgi/

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2006-06-28 18:37 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-28  4:00 emp.sty and metapost David Arnold
2006-06-28  4:23 ` Aditya Mahajan
2006-06-28  6:06   ` David Arnold
2006-06-28  7:07     ` Taco Hoekwater
2006-06-28  7:17       ` Hans Hagen
2006-06-28 15:27         ` David Arnold
2006-06-28 15:24       ` David Arnold
2006-06-28 16:04         ` Taco Hoekwater
2006-06-28 16:11           ` David Arnold
2006-06-28 17:40             ` Taco Hoekwater
2006-06-28 14:08     ` Aditya Mahajan
2006-06-28 15:37       ` David Arnold
2006-06-28 15:47         ` Taco Hoekwater
2006-06-28 18:37         ` Aditya Mahajan

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