TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use latexmk to automatically generate my LaTeX files. I want to use vector graphics, exported from Matlab (*.eps) but I know, that this is not possible (for some reason) - just image files like *.jpg or *.png. Is there a way to tell latexmk to workaround that drawback or will there be no vector graphics for me in near future?

Sorry in case I bring up the issue again - but after quite some time with LaTeX it's still not clear to me...

share|improve this question
latexmk doesn't generate LaTeX files, but compiles them to DVI/PS or PDF. You can use PDF images instead of EPS. Simply convert them using eps2pdf or similar. See the question What are good ways to convert EPS to PDF?. – Martin Scharrer Nov 10 '11 at 8:34
According to the Mathworks MATLAB reference on Export Formats, exporting directly to EPS is possible, and so is exporting to PDF and SVG. So you don't (shouldn't!) need any work-around. – Werner Nov 10 '11 at 8:35
Welcome to TeX.sx! Please keep your questions short an precise. There is no need for openings, closings, signatures or gratitude. In the case of external tools, simply link to there websites like I did now. Thanks and Happy TeXing! – Martin Scharrer Nov 10 '11 at 8:38
up vote 6 down vote accepted

You can still export from Matlab in EPS format, if you need this for other purposes and load the epstopdf package that, in recent TeX distributions, will spawn an on-the-fly conversion:


On the other hand, directly exporting in PDF from Matlab could be the faster solution.

share|improve this answer
My last attempts to export figures directly to pdf by means of builtin matlab tools was a disaster. Eventually, I wrote a script which always took the fig -> eps -> pdf route. If I am not mistaken, matlab failed to produce bounding boxes for the pdf exports. But perhaps this has been solved in recent matlab versions (my information is two years old). – Christian Feuersänger Nov 10 '11 at 22:12
I should have said that I used print -depsc <filename> or print -dpdf <filename> in matlab. – Christian Feuersänger Nov 10 '11 at 22:14

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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