Version (3.27 KB) by Daniel
exporte a figure to eps and pdf using laprint, latex and ghostscript (Requires laprint!!!)
Updated 23 Jul 2010

View License

This functions uses laprint to generate the eps and tex for a matlab figure. To make this great function available to pdflatex, this funciton was created. It adds a document header to the tex file, compiles it, and converts eps to pdf (including the boundingbox optimisation)
Export a figure with:
set(0,'defaulttextinterpreter','none') % wichtig für laprint
xlabel('$x$ in m')
ylabel('$y=\sin( x^2+x)$ ')

And include the images in latex without extension (latex will take the eps and pdflatex the pdf):

\caption{My MATLAB figure}

Cite As

Daniel (2024). exportEpsPdf (https://www.mathworks.com/matlabcentral/fileexchange/28275-exportepspdf), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2010a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Find more on Printing and Saving in Help Center and MATLAB Answers

Inspired by: LaPrint

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes

removed small bugs e.g. fn was set directly in the function