I use the "gmp" package which allows to insert MetaPost coding (placed inside an mpost or mpost* environment) in a LaTeX source file. In few words, it does approximately the same job as other packages like "emp" or "mpgraphics", with additional features that are not relevant here.
In particular, "gmp" defines as an (xkeyval-type) option key named everymp which is supposed to contain some code to be inserted at the beginning of each MetaPost files produced. Here is a minimal example:
\documentclass{minimal}
\usepackage[everymp= {input boxes;}]{gmp}
\begin{document}
\begin{mpost*}
% here the MetaPost code
\end{mpost*}
\end{document}
Here the everymp key contains the metapost instruction input boxes ; which is thus supposed to be inserted at the beginning of the MetaPost file produced by the compilation. But what I obtain is different:
%% Do not edit, this file has been generated
%% automatically by bug-everymp.tex via gmp.sty
inputboxes;
outputtemplate:= "%j.mps";
beginfig(1);
endfig;
end.
As you can see, the line input boxes; has become inputboxes; which means nothing to MetaPost…
I have found what triggers this bug, but this makes it weirder still: it comes from the space inserted between = and {input boxes;} in the option declaration:
everymp= {input boxes;}
If I suppress this space, i.e. if I write
everymp={input boxes;}
I obtain
input boxes ;
in the MetaPost, i.e. what is expected.
Of course this problem is not very important, but it puzzles me. How come that a space character inserted between = and its argument can produce that behaviour? Is it a problem with the gmp package, or with the (x)keyval package? In the latter case it should have been noticed elsewhere, but until now I haven't found something similar.
I am using the MacTeX 2012 distribution (i.e. TeX Live 2012) on Mac OS X Snow Leopard (10.6.8), and the gmp package in its first and so far only version (1.0).
xkeyval. – egreg Feb 10 at 22:34gmppackage just delegates the absorption of the value toxkeyvaland missing braces or a space before the opening brace results in gettinginputboxes;as#1. :( – egreg Feb 10 at 22:40mpsettingsoption of the 'mpost(*)' environment, i.e if I write[mpsettings= {input boxes;}]I getinput boxes;in the mp file, as expected. Really, I don't understand… – fpast Feb 10 at 22:48\usepackage; if I use\gmpoptions{...}after\usepackage{gmp}the problem does not show. Actually\usepackageuses\zap@spacesthat is quite drastic in the way it works. – egreg Feb 10 at 22:54