"Latex Pictures"
September 7, 2010 5:06 PM   Subscribe

Help! I need (in a hurry) to put my matlab images into a latex document. I'm exporting them as eps files, but when I put them in the latex file, all the text (legends and axis labels) have vanished. I can't find a solution on google. I can't use jpg instead because it looks crap. Why is the text in my eps file not showing up??
posted by moorooka to Technology (8 answers total) 1 user marked this as a favorite
EPS files generally don't have the fonts embedded, and since your TeX installation probably doesn't know about the fonts on your system, it can't find them, so they don't show up. It looks like export_fig may be able to embed the fonts.

BTW, the general fussiness of EPS files convinced me to switch to pdfTeX and change all of my figures to PDF instead of EPS. Given that you're in a hurry, you probably shouldn't be doing that, but it probably may save you headaches in the future.
posted by zsazsa at 5:18 PM on September 7, 2010

Seconding that it's probably a font issue. Fixing it will involve details specific to your OS and type of TeX interpreter, and we're not likely to be much help without more information.
posted by chrisamiller at 6:05 PM on September 7, 2010

Seconding the PDFTeX solution. I don't use matlab, but in general, here's my workflow:

In the preamble, have

Then, in text, have


The .6\linewidth controls the width, naturally---you can go with \textwidth if you prefer. But this way your pix resize with your margins. You may, but don't have to, include the .pdf suffix in the file reference in the includegraphics command: if you don't, then it will look for .eps if you're compiling with ordinary LaTeX and a .pdf if you're compiling with PDFTeX.

I presume it's straightforward to export .PDFs from matlab, or to convert them. If you're on a Mac (which I suppose you're not if you're using matlab, come to think of it) then in a pinch you can copy your figure, and then open a new file in preview to get an ok PDF image.
posted by leahwrenn at 6:15 PM on September 7, 2010

Shoot, autocorrect messed me up. In the preamble, have

posted by leahwrenn at 6:16 PM on September 7, 2010

Known problem.

Thirding save them as PDF and use PDFTex.
posted by donpardo at 6:48 PM on September 7, 2010

Contrary to the advice above, I think I solved this same problem by switching from pdflatex to regular latex, which produces a DVI, and then converting that to a PDF (dvi2pdf). I could be wrong, but try this if the other suggestions don't work.
posted by k. at 8:24 PM on September 7, 2010

OK new question: why can't I just damn well start a new page without my pictures from the previous section going on it? Is there a /newpage command that means START A NEW FRICKING PAGE
posted by moorooka at 9:04 PM on September 7, 2010

Why yes there is, /clearpage!

Damn, shouldn't have waited until the day before due date to learn this thing
posted by moorooka at 9:07 PM on September 7, 2010

« Older Co-representatives in probate: good or bad?   |   Upload iPhone Photos while Multitasking? Newer »
This thread is closed to new comments.