[metapost] Outputtemplate influences %& format comment parsing in verbatimtex

luigi scarso luigi.scarso at gmail.com
Sun Dec 24 20:49:49 CET 2023


On Sun, 24 Dec 2023 at 19:42, Ben Frank <ben.frank at mail.de> wrote:

> Hi,
>
> On 24.12.23 19:33, luigi scarso wrote:
> > Here I have
> >
> > $> mpost test.mp <http://test.mp>
> > This is MetaPost, version 2.02 (TeX Live 2023) (kpathsea version 6.3.5)
> > (/<...>/tex-2023/texmf-dist/metapost/base/mpost.mp <http://mpost.mp>
> > (/<...>/tex-2023/texmf-dist/metapost/base/plain.mp <http://plain.mp>
> > Preloading the plain mem file, version 1.005) ) (./test.mpfatal: Command
> > failed: etex --parse-first-line --interaction=nonstopmode mpK6cPmm.tex;
> > see mpxerr.log
> >  >> test.mp <http://test.mp>
> >  >> test.mpx
> > ! ! Unable to read mpx file.
> > l.10    label.lft(btex
> >                         \textbf{J} etex,origin);
> > Transcript written on test.log.
>
> That's the error I mentioned you would get because the wrong format is
> chosen due to the wrongly output format comment.
>

ok
$> mpost -record -debug test.mp
shows what happens:

 %&latex
   \documentclass{article}
   \begin{document}

\gdef\mpxshipout{\shipout\hbox\bgroup%
  \setbox0=\hbox\bgroup}%
\gdef\stopmpxshipout{\egroup  \dimen0=\ht0 \advance\dimen0\dp0
  \dimen1=\ht0 \dimen2=\dp0
  \setbox0=\hbox\bgroup
    \box0
    \ifnum\dimen0>0 \vrule width1sp height\dimen1 depth\dimen2
    \else \vrule width1sp height1sp depth0sp\relax
    \fi\egroup
  \ht0=0pt \dp0=0pt \box0 \egroup}
\mpxshipout% line 10 ./test.mp
\textbf{J}%
\stopmpxshipout
\end{document}

i.e. there is an  initial space before %&latex that should be not there
(and indeed the next code  is ok, if there are no spaces after verbatimtex:
outputtemplate := "%j-%2c.mps";

verbatimtex
%&latex
   \documentclass{article}
   \begin{document}
etex

beginfig(1)
   label.lft(btex \textbf{J} etex,origin);
endfig;

end;
end
)

I need to check.

--
luigi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/metapost/attachments/20231224/9ee35fc6/attachment-0001.htm>


More information about the metapost mailing list.