<div dir="ltr">Dear sir/madam,<br><br>I have found the following bug with the&nbsp; MetaPost &quot;library&quot;.<br><br>The TEX.mp &quot;package&quot; is problematic if you&#39;re working with an output directory different from the cwd, because it incorrectly looks up the <a href="http://mptextmp.mp">mptextmp.mp</a> file.<br>
<br>To reproduce the problem, perform the following:<br>1. Create two directories: ~/1 and ~/2.<br>2. In ~/1, place the file `<a href="http://1.mp">1.mp</a>&#39;, containing:<br>&nbsp; &gt; input TEX;<br>&nbsp; &gt; draw TEX(&quot;1&quot;);<br>
&nbsp; &gt; end<br><br>With CWD=~/1, invoke the following:<br>&nbsp; ~/1$ mpost -output-directory=../2 1<br><br>On my machine, this generates the error:<br>-----------------<br>! I can&#39;t find file `mptextmp&#39;.<br>&lt;scantokens&gt; input mptextmp<br>
<br>&lt;to be read again&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; endgroup<br>&lt;to be read again&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;<br>l.2 draw TEX(&quot;1&quot;);<br><br>Please type another input file name: <br>-------------------<br><br>I am not too familiar with MetaPost&#39;s file lookup mechanism, but I found that this can be fixed if, in the file TEX.mp, you change the line:<br>
25 &gt; scantokens &quot;input mptextmp&quot;<br>To:<br>25 &gt; scantokens &quot;input <a href="http://mptextmp.mp">mptextmp.mp</a>&quot;<br><br>Here&#39;s the info from &#39;mpost --version&#39;:<br><br>MetaPost 1.005 (Web2C 7.5.7)<br>
kpathsea version 3.5.7<br>Copyright 2008 AT&amp;T Bell Laboratories.<br>Kpathsea is copyright 2008 Karl Berry and Olaf Weber.<br>There is NO warranty.&nbsp; Redistribution of this software is<br>covered by the terms of both the MetaPost copyright and<br>
the Lesser GNU General Public License.<br>For more information about these matters, see the file<br>named COPYING and the MetaPost source.<br>Primary author of MetaPost: John Hobby.<br>Current maintainer of MetaPost: Taco Hoekwater.<br>
Kpathsea written by Karl Berry, Olaf Weber, and others.<br><br>Thank you,<br>Ohad.<br></div>