[metapost] [SOLVED] Getting SVG and EPS output from Metapost

Dirk Laurie dirk.laurie at gmail.com
Fri Mar 14 15:30:55 CET 2014

2014-03-14 15:35 GMT+02:00 Daniel H. Luecking <luecking at uark.edu>:

> The manpage should at least say that you can get a list of options using.
>     mpost --help
> Maybe the full list is not there because of the rapid changes lately.
> Unix people would mostly think of --help on their own.

Well, I thought of -h, and it gave me a list of options that start
with -h. 26 of those, and all is revealed? Not quite: if the option
is unique and requires no additional field, it just accepts the
one-letter abbreviation and goes on running mpost.

No SVG or EPS info, though.

But mpman.pdf does give the required information.
Well, most of it.

For SVG output:

$ mpost -s 'outputformat="svg"' code.mp

Then rename `code.1` etc to have extension .svg.

For EPS output:

$ mpost  code.mp

Then feed `code.1` etc to eps2eps, saving the output to
files with extension .eps.

Note: you can't just rename `code.1` to `code.eps`. The drawings
are not properly encapsulated. Good enough for the graphicx
package, yes, but not for export to foreign programs that read EPS.


More information about the metapost mailing list