HowTo: Export Excel Charts as PDF to include in LaTeX document

[Update]

I’ve written an updated post for Mac and Excel 2011 users.

[Update2]

From Leanne in the comments:

Some useful remark I found elsewhere: “You can put the graph as a separate document tab (opposed to inside a sheet)”. If you then follow the same steps i.e. save as PDF, then you don’t have to do the things with the margins.

—-

For the evaluation part of my thesis I had to include a lot of charts. The scientific approach proably would have been to use gnuplot, but my tool of choice for any kind of charts is Microsoft Excel 2007. However, I found no simple and easy way to directly include Excel charts into my LaTeX thesis document. After a lot of experimenting and looking at other people’s solutions I came up with the following:

1. Create chart in Excel as usual

2. Select chart:

1

3. Save As : PDF

2

4. Choose to publish only selected chart:

3

5. Use Acrobat Professional (or similar) to trim white borders around chat (can also be done in LaTeX through margins, but this way it’s easier and less work to embed the chart):

4

6. Save:

6

7. Embed:

7

8. Result:

8

Scaling (in LaTeX) to 50%:

9

9: Done

[Update 13/08/2011]

I’m again writing a thesis and this time I’m using OS X and apparently with Microsoft Excel 2011 for Mac you do not need to specifically crop the resulting pdf as the screenshot above shows. Just select “Save as picture” from the diagram context menu and select pdf. Pleasant surprise as I don’t have access to Acrobat Pro anymore (I was also told that the “pdfcrop” utility works just as well, but one step less is always good).

Advertisements

19 comments

  1. How do you go about the bounding box error?

    When I try the above I just get:

    ‘Cannot determine size of graphic in image.pdf (No bounding box)

    1. Uh. I didn’t get any errors like this. I’ve used the latex Miktex and TexLive distributions and everything worked just fine.

  2. I had try a steps like above..and i got the error such
    ! Undefined control sequence.
    l.8 \includegraphics
    [width=0.90\textwidth]{charts/smxv.pdf}
    ?
    Process interrupted by user
    i had save my graph in excel in pdf format and use a command below usingTexlive

    \documentclass[a5paper]{article}
    \usepackage[english]{babel}
    \begin{document}
    \section{who is}
    \begin{figure}[htbp]
    \centering
    \includegraphics[width=0.90\textwidth]{charts/smxv.pdf}
    \caption{figure 1}
    \label{step}
    \end{figure}
    \end{document}

  3. To get my charts out of excel I copy the chart and paste it into word, then right click on it in word and I can save it as a png file.

  4. Some useful remark I found elsewhere: “You can put the graph as a seperate document tab (opposed to inside a sheet)”. If you then follow the same steps i.e. save as PDF, then you don’t have to do the things with the margins.

    1. I tried to put the graph in a separate tab, but I still get some margins in the pdf which mess up the output in Lyx. Maybe I miss something there?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s