<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, 24 Dec 2023 at 20:49, luigi scarso <<a href="mailto:luigi.scarso@gmail.com">luigi.scarso@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, 24 Dec 2023 at 19:42, Ben Frank <<a href="mailto:ben.frank@mail.de" target="_blank">ben.frank@mail.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
On 24.12.23 19:33, luigi scarso wrote:<br>
> Here I have<br>
> <br>
> $> mpost <a href="http://test.mp" rel="noreferrer" target="_blank">test.mp</a> <<a href="http://test.mp" rel="noreferrer" target="_blank">http://test.mp</a>><br>
> This is MetaPost, version 2.02 (TeX Live 2023) (kpathsea version 6.3.5)<br>
> (/<...>/tex-2023/texmf-dist/metapost/base/<a href="http://mpost.mp" rel="noreferrer" target="_blank">mpost.mp</a> <<a href="http://mpost.mp" rel="noreferrer" target="_blank">http://mpost.mp</a>><br>
> (/<...>/tex-2023/texmf-dist/metapost/base/<a href="http://plain.mp" rel="noreferrer" target="_blank">plain.mp</a> <<a href="http://plain.mp" rel="noreferrer" target="_blank">http://plain.mp</a>><br>
> Preloading the plain mem file, version 1.005) ) (./test.mpfatal: Command <br>
> failed: etex --parse-first-line --interaction=nonstopmode mpK6cPmm.tex; <br>
> see mpxerr.log<br>
>  >> <a href="http://test.mp" rel="noreferrer" target="_blank">test.mp</a> <<a href="http://test.mp" rel="noreferrer" target="_blank">http://test.mp</a>><br>
>  >> test.mpx<br>
> ! ! Unable to read mpx file.<br>
> l.10    label.lft(btex<br>
>                         \textbf{J} etex,origin);<br>
> Transcript written on test.log.<br>
<br>
That's the error I mentioned you would get because the wrong format is <br>
chosen due to the wrongly output format comment.<br></blockquote><div><br></div><div>ok</div><div>$> mpost -record -debug <a href="http://test.mp" target="_blank">test.mp</a></div><div>shows what happens: </div><div><br></div><div> %&latex<br>   \documentclass{article}<br>   \begin{document}<br><br>\gdef\mpxshipout{\shipout\hbox\bgroup%<br>  \setbox0=\hbox\bgroup}%<br>\gdef\stopmpxshipout{\egroup  \dimen0=\ht0 \advance\dimen0\dp0<br>  \dimen1=\ht0 \dimen2=\dp0<br>  \setbox0=\hbox\bgroup<br>    \box0<br>    \ifnum\dimen0>0 \vrule width1sp height\dimen1 depth\dimen2 <br>    \else \vrule width1sp height1sp depth0sp\relax<br>    \fi\egroup<br>  \ht0=0pt \dp0=0pt \box0 \egroup}<br>\mpxshipout% line 10 ./<a href="http://test.mp" target="_blank">test.mp</a><br>\textbf{J}%<br>\stopmpxshipout<br>\end{document}<br></div><div><br></div><div>i.e. there is an  initial space before %&latex that should be not there </div><div>(and indeed the next code  is ok, if there are no spaces after verbatimtex:</div><div>outputtemplate := "%j-%2c.mps";<br><br>verbatimtex<br>%&latex<br>   \documentclass{article}<br>   \begin{document}<br>etex<br><br>beginfig(1)<br>   label.lft(btex \textbf{J} etex,origin);<br>endfig;<br><br>end;<br>end<br></div><div>) </div><div><br></div><div>I need to check.</div><div><br></div></div></div></blockquote><div><br></div><div>Indeed, it seems an oversight :</div><div>in mpxout.w </div><div>verbatim_written = 1; at line 664 should be moved at line 659</div><div><br></div><div>    655       if (!verbatim_written)<br>    656          mpx_copy_mpto(mpx, outfile, FIRST_VERBATIM_TEX);<br>    657       else<br>    658          mpx_copy_mpto(mpx, outfile, VERBATIM_TEX);<br>    659       verbatim_written = 1;<br>    660       fprintf(outfile,"%s", mpx_postverb[mode]);<br>    661     } else {<br>    662       mpx_error(mpx,"unmatched etex");<br>    663     }<br>    664     /*verbatim_written = 1;*/<br></div><div><br></div><div> --</div><div>luigi</div></div></div>