tags:

views:

2401

answers:

5

I've faced so many problems using images in Latex. See for example, another question at http://stackoverflow.com/questions/382590/latex-using-eps-images-builds-slowly

What tools do you use to make figures for inclusion into latex? Is there a simple solution to this? Some scenarios described below:

  • I want to add a screenshot into latex
  • I want to include a figure from visio into latex
  • I plot a graph, export into png, and the image does not seem to have a bounding box.

How to handle these scenarios?

+2  A: 

My papers are very heavy on screenshots and diagrams.

I have had great luck exporting or saving as PDF (rather than EPS) and then embedding it. PDFs (if exported as images, not as an actual print) have fairly decent sizing info, and embed in an instant.

On a Mac, you get that functionality from OmniGraffle (a Visio analogue), but perhaps Visio does it these as well.

Uri
+2  A: 

See the answers to question 645932.

Kaarel
+7  A: 

For the scenarios you're talking about you could try pdflatex, it works with PNG images included directly in LaTeX files:

\includegraphics[width=4in,height=4in,viewport=0 0 300 300]{figure.png}

latex + dvipdf might also accept PNGs, I'm not sure. The disadvantage of this is that you can't use any Postscript-specific packages, like pstricks or draftcopy. I usually prepare my figures as EPS, which prints better because it's a vector graphics format, but I just use the DVI file for previews of the document. That way, even if I have large EPS figures in the document, I won't have to wait a long time for the preview.

David Zaslavsky
+1 for using pdflatex. I often make figures in powerpoint or visio, export to pdf and include pdf's in my latex document using pdflatex. Works great!
Eyvind
You can include PDF figures (also a vector format, afterall) in pdflatex documents for high quality printing. This is the direction 've been moving in of late.
dmckee
Yep, PDFLatex works with all the common image formats (png jpg and so on). Of course, just to be difficult, it does *not* work with eps images... So it's one or the other. Everything else would be too straightforward ;)
jalf
Specifying both width and height is a bit strong. I rarely need more than just `\includegraphics[width=\linewidth]{foo}` or `...[scale=.8]...`
Damien Pollet
+2  A: 

In case of plotting, I use Gnuplot - it supports saving files in eps format and it's better than png, because it is saved as a vector not a bitmap (you can zoom it without any reasonable limits).

pdflatex supports png, jpg, tiff and pdf graphics, so you can add it without converting. If you want to include eps file to pdflatex, use the eps2pdf tool which is installed with Latex.

If you really want to convert everything to eps, try Gimp.

klew
Or ImageMagick..
John Fouhy
Gnuplot can output PDF directly, and pdftex can include some .eps files respecting a subset of the format (metapost generates that, for instance)
Damien Pollet
+4  A: 

Related answer here

Short story

  • store your raster pictures as .png (or .jpg, but lossless is better where you can).

  • don't export your plotted graph as a .png. It's a vector object, and any decent plotting package will output it as a .pdf or .eps.

  • depending on your final output, you might want to save vector figures as .pdf's and then use pdflatex to generate a pdf file. There are good reasons to avoid this sometimes, though.

  • if you do need to go the .dvi -> ps/whatever route, you'll have to generate .eps files even for your raster images. Imagemagick or a similar tool is your friend here.

  • other general tips: use graphicx package, don't include suffixes on the filename when you include the figure.

simon