[metapost] Difference between "mpost file.mp" and "mpost ./file.mp"

Rasmus Villemoes burner+usenet at imf.au.dk
Thu Sep 9 14:07:53 CEST 2010


Dear list

When using the TEX module to typeset labels in a for loop, I
accidentally discovered that there is a difference between calling
mpost as "mpost -tex=latex file.mp" and "mpost -tex=latex
./file.mp". In the former case, the labels come out as expected,
whereas in the latter, I only get 0's. Is this documented or expected?
I can see that the latter produces more output to the terminal as
well, although I can't figure out what it means.

====
verbatimtex
\documentclass{article}
  
\begin{document}
etex

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

prologues := 3;

outputtemplate := "%j-%c.eps";

beginfig(1)
  draw (0,0) -- (2cm, 0cm) -- (2cm, 2cm) -- (0, 2cm) -- cycle;
  
  for i = 0 upto 15 :
    label(TEX("{\small $" & decimal(i) & "$}"), (i mod 4 + .5, i div 4 + .5)*5mm);
  endfor;
endfig;

end;
====

-- 
Rasmus Villemoes
<http://rasmusvillemoes.dk/>



More information about the metapost mailing list