Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I can't seem to get a graphic included without including the path. Can somebody help me with this?

\begin{figure}[h]
    \includegraphics[width=0.35\textwidth]{C:/Users/zach/Documents/My Dropbox/AMATH 383/fig1.pdf}
    \label{fig:fig1}
\end{figure}

\usepackage{wrapfig}
I've also tried:
\begin{wrapfig}[t]{0.5\textwidth}
 \begin{center}
    \includegraphics[width=0.35\textwidth]{fig1.pdf}
    \label{fig:fig1}
 \end{center}
\end{wrapfig}
share|improve this question
    
If you get an error message, you could edit your question and add it. –  Stefan Kottwitz Aug 13 '11 at 17:29

2 Answers 2

Don't use spaces in file names or paths. If you really need spaces there, load the grffile package:

\usepackage{grffile}

Usually it's good to use relative paths instead of absolute. This makes moving or copying your project easier, to another path, disk or computer: you don't need to change all paths.

share|improve this answer

Instead of including the fully expanded path of the image, you could use the relative path to your main document. For example, if your main .tex document is in the folder <root>, and your image fig1.pdf is in the folder <root>/image, then you can include the image with

\includegraphics[...]{image/fig1.pdf}% include <root>/image/fig1.pdf

Alternatively, you could specify a folder where LaTeX should search for images (graphics in general) by using

\graphicspath{{image/}}% Graphics are in folder '<root>\image'
\includegraphics[...]{fig1.pdf}% include <root>/fig1.pdf or <root>/image/fig1.pdf

Note the trailing / in the \graphicspath command, as well as the double nested braces {{}}. Also, since \ has a different meaning in LaTeX, folders can be specified using /, even on Windows; there is not alternative for this when using \graphicspath.

More on the latter use of graphics inclusion via path specification can be found on the UK TeX FAQ.

share|improve this answer

Your Answer

 
discard

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.