Friday, January 12, 2007

Latex note: convert Excel charts to eps files

This tip applies to any chart from MS Office.

In short, in order to insert charts from Excel to your Latex document, you need to (1) print your chart from MS Office into an eps file; (2) modify the bounding box in the output.

You need to install Generic Postscript Printer from Adobe first. Link the printer to the port FILE: . After installation, set its output option from Property -> Printing preferences... -> Advanced -> Postscript options -> Postscript output opion to encapsulated postscript format (eps).

This printer can be used to print the chart to an eps file.

The EPS file contains borders which defines where the chart is. Use postscript to open this EPS file, then use a text editor to open it simultaneously. Tick options -> eps clip from postscript. Then edit the line %%BoundingBox: ... from the text editor. Adjust the size of the chart in eps so that the clip fits well to the chart. Then save EPS.

Now you are done. Insert the chart into latex!