[metapost] outputtemplate and file names

Johannes Kanig johannes.kanig at gmail.com
Sun Aug 8 21:18:23 CEST 2010


Hi,

I have encountered a very strange behaviour of metapost (version
1.208) in connection with outputtemplate. The file is attached.

The file should (and does) generate 13 figures; the bug is that one
output file is incorrectly named.

Here come the details about the file.

* It uses mp-tool and mp-spec from context.
* It sets prologues to 0.
* Before each beginfig, it changes the outputtemplate variable to the
desired output file name
* It does so using the code from the manual:

if scantokens(mpversion) < 1.200:
filenametemplate
else:
outputtemplate :=
fi
  "AAAAAAAAAAAAAA.mps";

* All 13 figures are very simple (one line), except one (the third),
which is still quite simple (only a few lines).
* All figures are created correctly.
* But the 12th figure is incorrectly named; its name is shortened.

I'm sorry that the test file is so long, but the bug disappears if I:
* remove the (useless) inputs of mp-tool and mp-spec;
* remove the prologue:=0;
* remove a figure;
* set outputtemplate directly without if-then-else;
* simplify the third figure.

Also sorry for the stupid filenames, but I found it simpler like that ...

What is the best solution here? The aim was to name output files
directly instead of the "[jobname.i]" scheme. I guess I will go back
to using the standard naming scheme and moving files around
afterwards...

Johannes

-- 
Johannes Kanig
johannes.kanig at gmail.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: zzzzzzzzzzzz.mp
Type: application/octet-stream
Size: 2464 bytes
Desc: not available
URL: <http://tug.org/pipermail/metapost/attachments/20100808/47fd72ae/attachment.obj>


More information about the metapost mailing list