Graphics, Figures & TablesProblems with Greek alphabets when converting to pdf

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
antiatomkraft
Posts: 3
Joined: Mon Mar 28, 2011 11:54 pm

Problems with Greek alphabets when converting to pdf

Post by antiatomkraft »

I have generated some eps figures using matplotlib by savefig('test.eps'), and include the figures in latex using Kile.

Code: Select all

\usepackage{epsfig}

\begin{figure}
 \centering
 \epsfig{file = test.eps, scale = 0.5}
 \label{testing}
\end{figure}
When I convert it to dvi and ps, they both look good. But when I convert it to pdf, all text after the greek alphabets and minus sign in the figures are missing. I also try to convert it to ps and then eps but the problem still persists. How can I solve this problem? Please help!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

shadgrind
Posts: 140
Joined: Thu Jul 16, 2009 12:39 am

Problems with Greek alphabets when converting to pdf

Post by shadgrind »

I've noticed that matplotlib's export to eps for LaTeX is a bit funky, as far as the fonts go. Try doing this in matplotlib and see if it helps:

Code: Select all

from matplotlib import rc
rc('ps',usedistiller='xpdf')
rc('text',usetex=True)
That usedistiller option makes matplotlib use the Poppler library for the text rendering, and I've found that it greatly improves the fonts in the generated graphics when converting to PDF. Also make sure you're embedding fonts when you convert from PS to PDF (I'm assuming you're using ps2pdf for that).
System: TeX Live 2012, Fedora 18 x86_64, GNU Emacs 24.2
Post Reply