Reinstalling and updating MiKTeX 2.9 (avoiding the update of hyph-utf8, which seems to be having some problems since the new version came out on June 23) solved the problem. The above code (using either of the command lines mentioned) now correctly exports the figure to a separate pdf file.
As I said in a previous comment, your example compiled without problem in my OSX box, so I was guessing the problem was in your Windows setup.
Looking carefully at your _COMMAND_LINE_.txt
file, I noticed the following, in line 72:
Preloading the plain mem file, version 1.004))epstopdf: -o: unknown option
Note the error at the end of the line. Your epstopdf
program is refusing -o
option, and thus it is not producing the pdf output. mpgraphics
package issues a Warning, which somehow, instead of appearing in the standard output or in the .log file, appears in the final pdf. This is why your documment contains the strange text mpgrahphics********
etc. (this could be considered a bug in mpgraphics implementation.)
Nevertheless, the problem is with your epstopdf
program. mpgraphics
package recommends a "recent" version of epstopdf
. I don't know if the problem is that your epstopdf
version is not recent enough or whether epstopdf
is broken in Windows.
You can try to execute epstopdf --help
in command line and learn which switch it uses instead of -o
(which is for setting the name of the resulting pdf
). Once you know this, you can hack the file mpgraphics.sty
(search for the string -o
in that file, in my version is at line 77), and change it appropiately.
Best Answer
With TeXworks, go to the main menu: Edit / Preferences, choose the Typesetting tab, choose your engine, click the Edit button, add
--enable-write18
such as here:This screenshot was originally posted by Thorsten in the LaTeX-Community forum. In the picture it's for pdfLaTeX, just edit the engine of your choice, i.e. LuaLaTeX.
Use the very same place if you would like to add
--shell-escape
instead. However,--shell-escape
is used in TeX Live,--enable-write18
in MiKTeX.