Monday, February 3, 2014

LaTex Series: How to EPS

I spent a lot of time to figure out this eps stuff.

Cut the story short.

Save Powerpoint/Excel images as EPS

Method 1 (Recommended):

[Source via link here]

  1. Download and install LibreOffice
  2. Open a Powerpoint slide or Excel with LibreOffice
  3. Export it as a EPS file:
    • Powerpoint : File->Export->Choose EPS file type
    • Excel          : Right click an image->Export as Image->Choose EPS file type
  4. Open the generated EPS file with GhostView, and turn on menu "Option->EPS Clip and EPS Warn". Choose the menu "File->PS to EPS", allow the bounding box to be automatically calculated, and save with a different filename, say, figure_final.eps.

Method 2:

[Copy Paste via link here]

In case anyone needs to (e.g. for LaTeX compatibility)

These instructions are for windows 7.  See bottom of this page for older instructions I found somewhere on the Web.

Start button -> type in window "add printer"

in "add printer" dialog, go to:
 "add a local printer"
 in "choose a printer port", do "use an existing port" and select 'print to file'.
In "install the printer driver", select any PS printer, I chose HP ->  HP Color LaserJet 2800 Series PS

For printer name, chose e.g. "My Awesome .eps Printer Driver".
Do not share this printer.

When the wizard finishes and it is installed, type "print" (ctrl-P" from an Office program.  These instructions are for Office 2010.
I selected "My Awesome .eps Printer Driver", and just below that selector there is "printer properties" link.
Select that, choose "advanced tab", expand "PostScript Options", and for "PostScript Output Option", select "Encapsulated PostScript (EPS)" from the drop-down menu.

You can print with this driver to create .eps files.
Note that, at least from PowerPoint, the bounding-boxes may not be quite right (e.g. may correspond to the notional page rather than to your actual content).
I fixed this inside LaTeX with e.g.:

 \includegraphics[width=1.0\columnwidth,bb=60 215 705 755]{sgmm_fig}

These co-ordinates are upper-left (x,y), lower-right (x,y), I believe.  You can look at the .eps file in Ghostview and hover over the corners of your image to get the bounding-box co-ordinates (thanks to Mike Seltzer for this tip).

---
Comment from Rich Webb on how to automatically get these bounding box co-ordinates if you are using miktex:

Stop after the add-printer wizard completes. Do not go into the printer properties to change anything (I think that is what broke my earlier setup). Instead, just "print" through that virtual printer to .plt. This file is the plain-text PostScript job.

Run that file through ps2epsi (included in the MikTex distribution) from a command line as "ps2epsi .plt .eps". The resulting .eps file slides right into LaTeX with a bounding box that works perfectly for figures. Now if I can just convince it not to substitute Arial for Helvetica ...

Things to consider:
1) Place the figure on top left most of the slide. Otherwise, annoying white spaces will be haunting you forever as I had experienced. #grrrrrr
2) Rewrite the boundry box using notepad or similar editor. Save you the hassle of writing codes in latex.

Extra reading [graphics manual and another one here]

Other methods related to EPS can be found here

Convert PDF to EPS


  1. Open pdf file with inkscape
  2. Save as EPS
  3. In case you need to crop image area in inkscape, follow tutorial here




No comments: