2

I generated with MetaPost the example in "LaTeX Graphics Companion", 2nd ed., p. 174, above. The eps is generated. The header:

%!PS %%BoundingBox: -123 -92 64 43 
%%HiResBoundingBox: -122.84787 -91.07129 63.67152 42.51074 
%%Creator: MetaPost 1.504 
%%CreationDate: 2015.11.25:1112 
%%Pages: 1 
%*Font: cmr10 9.96265 9.96265 20:8400f080008c080065df394 
%%BeginProlog 
%%EndProlog 
%%Page: 1 1

However, when I want to view it with Inkscape, I get some error:

ps2pdf failed:

Error: /undefined in cmr10 
Operand stack: (Lions) 
Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1910 1 3 %oparray_pop 1909 1 3 %oparray_pop 1893 1 3 %oparray_pop 1787 1 3 %oparray_pop --nostringval-- %errorexec_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- 
Dictionary stack: --dict:1165/1684(ro)(G)-- --dict:0/20(G)-- --dict:77/200(L)-- 
Current allocation mode is local 
Current file position is 2508 
GPL Ghostscript 9.05: Unrecoverable error, exit code 1

Why is this? Are additional steps required, next to "mpost example.mp"?

Regards,

Francky

3

You should insert the following lines at the beginning of your MetaPost file:

prologues := 3;
outputtemplate := "%j-%c.eps";

The second line will change the name example.1 into example-1.eps and make the EPS file more easily handled as such by external programs. The first one allows complete font inclusion in your resulting EPS file, which is better in most cases.

If you only mean to include your file in a LaTeX document, it is enough to insert the single line

outputtemplate := "%j-%c.mps";

instead.

Another solution is to use the mptopdf utility which should be part of your TeX installation. The command line

 mptopdf example.1

will convert your EPS file into a PDF file, example-1.pdf.

See the MetaPost documentation for more information.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.