[metapost] verbatimtex bug?

Dan Luecking luecking at uark.edu
Fri Oct 30 17:59:03 CET 2009

At 02:52 AM 10/30/2009, you wrote:

>Dan Luecking wrote:
> >
> > The error seems to come from the following output of mpto -tex. Note the
> > "%" right after cmr8, which causes TeX to continue reading the tfm name
> > until line 3, and thinks the font name is "cmr8{}":
>Adding an extra space+percent fixes the problem:
>   \font\viiipt=cmr8 %

Or \space or \relax or even an extra line with % in it:
I like the last, since it preserves the EOL (in case that is
ever significant).

The problem arose from verbatimtex written automatically by
mfpic that ended up fllowing a user's \font command. I can
easily rewrite mfpic to work around it, but it seems to me
a general solution is better.

>even though that could be seen as just a workaround for a bug.
>OTOH, there have been explicit requests to make sure spaces before
>and after tex blocks are ignored, and it is not feasible to
>actually parse the TeX code to discover whether or not tex is
>still in the middle of tokenization at the end of the input.

I can understand this for btex...etex blocks, but

  1. verbatimtex is not for producing text labels.
  2. It is common practice to use an EOL to terminate an assignment.
  3. The name "verbatimtex" suggests a more verbatim process.
  4. Users do not expect an EOL to be ignored, and don't
     expect widely separated verbatimtex blocks to interact
     directly. (Certainly I didn't, and I can't find it documented.)

In fact, mpman contains this explicit example:
   verbatimtex \input mymac etex
   label(btex .TEX material using mymac.tex. etex, .some coordinates.);

With no warning that a verbatimtex block inside "..." could cause
TeX to continue reading for more characters in the filename mymac!

>There is a --debug switch, which leaves all temporary files in place,

That --debug switch is good to know, but "mpost --help" doesn't
display it. The only debugging tool mentioned is: --kpathsea-debug,
which doesn't seem applicable.

>but I can add an 'mpto' personality to the next release as well (there
>is a --dvitomp switch already)

Are there any cases where dvitomp is useful without mpto?

On an entirely different subject: I was surprised to notice that
"mpost --help" doesn't display a banner line (i.e., "This is
MetaPost, version 1.208"). Also --version and --help can't be combined.


Daniel H. Luecking
Department of Mathematical Sciences
1 University of Arkansas
Fayetteville, Arkansas 72701

More information about the metapost mailing list