Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
How to embed fonts in latex EPS images

Subject: How to embed fonts in latex EPS images

From: aidendeem@gmail.com

Date: 11 Jul, 2008 06:40:10

Message: 1 of 5

I have a 5 simple steps to embed fonts in a matlab figure for use in a
latex document.

1. Save a matlab figure from matlab to EPS format.
2. Run ps2pdf14 -dPDFSETTINGS=/prepress unembedded_fig.eps
embedded_fig.pdf.
 Note You can check the font is embedded by running
pdffonts embedded_fig.pdf
and check that the normal Helvetica font is embedd as BGISHF
+Helvetica, for example.
3. You can either build your latex document with pdflatex,
usepackage{graphicx} & \includegraphics{embedded_fig.pdf}, OR
4. run pdftops -eps embedded_fig.pdf embedded_fig.eps
5. run ps2eps embedded_fig.eps
6. rename embedded_fig.eps.eps to embedded_fig.eps
7. Build your latex document with latex, usepackage{graphicx} &
\includegraphics{embedded_fig.eps}.

Finally, check the font is embedded by running
pdffonts ~/my_article.pdf
and check that the normal Helvetica font is embedd as BGISHF+Helvetica.

Subject: How to embed fonts in latex EPS images

From: Oliver Woodford

Date: 9 Nov, 2008 13:48:02

Message: 2 of 5

aidendeem@gmail.com wrote :
> I have a 5 simple steps to embed fonts in a matlab figure for use in a
> latex document.
>
> 1. Save a matlab figure from matlab to EPS format.
> 2. Run ps2pdf14 -dPDFSETTINGS=/prepress unembedded_fig.eps
> embedded_fig.pdf.

There is now a MATLAB function on the FEX which does these first two steps for you:
http://www.mathworks.com/matlabcentral/fileexchange/22018

Subject: How to embed fonts in latex EPS images

From: Oliver Woodford

Date: 1 Dec, 2008 21:14:02

Message: 3 of 5

I've added a function to generate eps files with embedded fonts to the file exchange:
http://www.mathworks.com/matlabcentral/fileexchange/22267

It builds on print_pdf, using pdftops as suggested to convert from pdf to eps, all in one handy MATLAB function.

Subject: How to embed fonts in latex EPS images

From: stinkinrich88

Date: 31 Mar, 2009 13:45:05

Message: 4 of 5

"Oliver Woodford" <o.j.woodford.98@cantab.net> wrote in message <gh1k2q$25v$1@fred.mathworks.com>...
> I've added a function to generate eps files with embedded fonts to the file exchange:
> http://www.mathworks.com/matlabcentral/fileexchange/22267
>
> It builds on print_pdf, using pdftops as suggested to convert from pdf to eps, all in one handy MATLAB function.

excuse me, I have used your matlab function to get my image and pdffonts says SEXRHD+Helvetica is embedded. Is this correct?

Also, do I just insert my image into my latex document as normal or do I have to do something special in latex? What should happen, should it replace all the matlab fonts with latex fonts?

p.s. your matlab function gave me an error because pdftops doesn't take the -pagecrop argument so I had to remove it.

THanks!

Subject: How to embed fonts in latex EPS images

From: Oliver Woodford

Date: 31 Mar, 2009 22:35:03

Message: 5 of 5

"stinkinrich88" wrote:
> excuse me, I have used your matlab function to get my image and pdffonts says SEXRHD+Helvetica is embedded. Is this correct?
>
> Also, do I just insert my image into my latex document as normal or do I have to do something special in latex? What should happen, should it replace all the matlab fonts with latex fonts?
>
> p.s. your matlab function gave me an error because pdftops doesn't take the -pagecrop argument so I had to remove it.
>
> THanks!

The fonts should be embedded but I don't know how to check that they are. Just use the eps file as normal in latex - I believe the output should use the fonts embedded in the eps file for the image.

Thanks for the note about -pagecrop.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us