Metapost header

The following header allows me to choose easily between svg and postscript output and set the output filename. It is convenient, but I always forget it, so I leave it here for quick reference.

g_use_svg = 1; %0 for postscript, 1 for svg
prologues:=3;
u=1cm;
outputtemplate := "%j-%c.eps";
if g_use_svg > 0:
        outputtemplate := "%j-%c.svg";
        outputformat := "svg";
fi
Written on March 9, 2024