TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to insert a file into my document. In the preamble I have


Then in the text I have:


\includegraphics[width={\textwidth}]{C:/..[full file path inserted]/DLSdiameter.eps}

\caption{Sizes of detergent micelles calculated by DLS.}



(note each command starts a new line, but I can't get that to display here without a linespace as well.)

This inserts the figure but leaves a large blank space above the figure in which parts of the file path are displayed twice. I also get two errors: 'File'C:/filepath' not found' and 'Cannot determine size of graphic in 'C:/filepath''. I initially used the Insert>Figure options in TeXnicCentre with some modifications to the code from internet searches. I am also using the conversion LaTeX=>PS=>PDF, as this is the only option which seems to display the figure. Any suggestions would be welcome. Thanks.

share|improve this question
As far as I remember (not using Windows for a while) the usual folder separator is \ not / (as on unix/mac). – Ronny Dec 21 '12 at 12:44
Welcome to tex.sx, you can mark up code blocks using the {} button (just highlight the text first) or simply indent by 4 spaces. For inline code you can use bacticks like this – David Carlisle Dec 21 '12 at 12:47
@Ronny windows tex implementations (like most windows programs) can use / as the separator (and this is easier as it avoids other uses of \ ) – David Carlisle Dec 21 '12 at 12:48
If you are using latex/dvips then you don't want the eps2pdf package, just graphicx. Hard to tell why you would get a repeated ath displayed, please try to make a complete small document so theproblem may be reproduced – David Carlisle Dec 21 '12 at 12:51

TeX and related programs can be fooled when the path to a file to be read in (such as your graphic file) contains spaces.

There is a simple remedy:


The grffile package I added should solve the problem.

share|improve this answer

For a hassle free solution, just copy the file to the same folder as your document, then call the command.


If you are getting too much space above, try this:

\vspace{-Xem} %change X to an number of your liking.
share|improve this answer
Thanks - is there something about the windows Filepath that latex can't read? – 218 Dec 21 '12 at 13:06
Running Windows 7, I can never work out how to deal with spaces in applications such as Latex. If your filename is void of spaces, the following format works if you want to go direct to the folder. C:/folderA/folderB/folderC/file.png – Nicholas Hamilton Dec 21 '12 at 13:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.