Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

For exporting eps figures from Matlab i use matlabfrag and laprint functions so that i split the psfrag commands (.tex) and figure(.eps) streams. During the compilation using pstool or auto-pst-pdf packages, figures with latex text font are automatically added.

But my question is :

How to add figure labels,legends for .png figures similar to psfrag? As the .png is from third-party software.

Can i convert .png to tagged .eps and then add text using psfrag commands?

I prefer to save figures in tagged eps (.eps and .tex) instead of .pdf so that i can add latex font based on the beamer or article class used. I don't like to freeze the font of text in figures by using PDF.

share|improve this question
1  
I think Inkscape allows to import bitmap graphics and export them as eps+latex. But I have never used it so far. –  matth Jun 19 '12 at 16:32
3  
Inkscape can do latex+pdf. just import a bitmap, trace it or leave it as is, add text and then export as pdf. A window will pop-up and lets you chose +latex. Also consider packages like overpic or of course tikz that let you overlay a picture with text. –  Martin H Jun 19 '12 at 16:45
    
related: tex.stackexchange.com/questions/9559/… –  matth Jun 28 '12 at 9:48

1 Answer 1

up vote 2 down vote accepted

You can't get TeX to find text in a png the way it does for psfrag as essentially the information just isn't there (even if TeX could read the binary file). However if the png image has no text at all you can overlay latex text over it. there are packages to help that but you don't really need a package.

\includegraphics{file.png}%
\begin{picture}(0,0)
\put(-100,2){label 1}
\put(-100,-22){label 2}
\end{picture}

overlays the two labels over the image. Of course you have to judge the coordinates by eye or some external measurement.

share|improve this answer
    
Does Inkscape generate the picture environment as shown in your example when i add text on the png in Inkscape as suggested by Others. –  texenthusiast Jun 19 '12 at 21:37
1  
No idea, i have never used inkscape:-) –  David Carlisle Jun 19 '12 at 22:12

Your Answer

 
discard

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.