To include MetaPost pictures in a latex file compiled by pdflatex I usually do something like
\usepackage[pdftex]{graphicx}
...
\includegraphics{filename-without-mps}
but this requires all metapost output to have extension .mps
(which is usually fine — one can just add the line filenametemplate "%j-%c.mps";
into .mp
source). Is there a way to include mps
pictures with their usual filenames (smth.1
, smth.2
, etc.)?
Update: I usually need it to recompile some old files with PDFLaTeX — so I need some recipe that adds couple of lines in the preamble but not requires to changes everything.
I tried to invent some hack (for Windows, to be compiled with pdflatex -enable-write18
):
\usepackage[pdftex]{graphics}
\DeclareGraphicsRule{.1}{pdf}{.1.pdf}{`copy #1 #1.eps && epstopdf #1.eps}
...
\includegraphics{smth.1}
which indeed generates smth.1.pdf
but fails with the error
! Package pdftex.def Error: File `smth-1-converted-to.1.pdf' not found.
Update 2: The question was answered but maybe someone knows how to make this hack work?
metapost
tag?