MiKTeX and proTeXtPDF creation of Excel charts in LaTeX

Information and discussion about MikTeX distribution for Windows and the related proTeXt: Installing, updating, configuring
Post Reply
drakaups
Posts: 1
Joined: Fri Dec 14, 2007 11:56 pm

PDF creation of Excel charts in LaTeX

Post by drakaups »

hi all,
I am a newbie trying to get excel charts into LaTeX as eps/pdf files. I had mixed success doing this and wanted to learn of better ways of doing the same:
1. pdf files: I could print selected plots (charts) from Excel to pdf using pdfcreator. I used graphicx with pdftex and am able to see them using LaTeX->pdf. The problem here is that there is a lot of whitespace between the figure and its caption (~0.5-0.7") which does not look very good in a scientific publication :-(. This is the code I used
\usepackage[pdftex]{graphicx}
......
\begin{figure}[htbp]
\centering
\includegraphics{width=1.00\textwidth]{filename.pdf}
\caption{Some figure}
\label{fig:Fig1}
\end{figure}
.....
Is it possible to move the captions higher up into the whitespace region? (I dont think this is possible, otherwise LaTex would have probably done it). Are there better ways of writing excel charts to pdf files?

2. I installed Adobe Postscript printers and set them up to print to FILE to get eps figures of these charts. I can print to eps figures and can see them in gs, but when I tried to include them in a TeX file using dvips and graphicx with LaTeX->ps->pdf, all I get is a blank file even without any text. For eps files from gnuplot, I get the figure without the remaining text in the document (not even the captions).

\usepackage[dvips]{graphicx}
(or)
\usepackage[dvips]{epsfig}
....
\begin{figure}[htbp]
\includegraphics{width=1.00\textwidth]{filename.eps}
(or)
\epsfig{figure=filename,clip=,width=1.00\textwidth}
\caption{Some figure}
\label{fig:Fig1}
\end{figure}

A problem with EPS files in Windows/DOS seems to be the bounding box specifications. I came across a fix for this problem from a ftp download site (wisc.edu, do not remember the exact link) but could not download the file. Is there a better way to directly print LaTeX compatible eps files in Windows ?
Thanks,

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

Re: PDF creation of Excel charts in LaTeX

Post by Juanjo »

Concerning your first question, you may find useful the trim and clip options of the \includegraphics command. If you write something like

\includegraphics[trim=5mm 10mm 15mm 20mm, clip, width=\textwidth]{myfigure}

you are trimming (cutting of) space on the four sides of the figure: 5mm on the left, 10mm at the bottom, 15mm on the right, and 20mm at the top. The rest of the image is adjusted to have a width equal to \textwidth. In your case, if the blank space is due to the graphics, perhaps the command

\includegraphics[trim=0in 0.5in 0in 0in, clip, width=\textwidth]{myfigure}

may work.
Post Reply