2

I am having trouble including a graph in my TeX document. I am using the graphicx packages and set a \graphicspath in the preamble. However,

\includegraphics{smt.pdf}

gives me a file not found error. I've read something about a working directory of pdflatex but have no idea how to alter that in texmaker. The only setting I could find relating to pdflatex is

pdflatex -synctex=1 -interaction=nonstopmode %.tex

Does anyone have the solution?

EDIT: MWE (hopefully this is correct):

\documentclass{article}
\usepackage{graphicx}
\graphicspath{ {c:/Users/../Graphs/} } 
\begin{document}

\includegraphics[scale=0.25]{leeftijd distributie.pdf} 

\end{document}

Thanks, Dirk

3
  • Welcome to TeX.SX! Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass{...} and ending with \end{document}.
    – ebosi
    Commented Apr 5, 2016 at 14:49
  • Would it be possible for you to just copy your PDF in the same folder than your tex-file? Try also to rename your .pdf file without black space.
    – ebosi
    Commented Apr 5, 2016 at 15:17
  • It's best practise to avoid spaces and reserved characters in file names, so these errors don't come up.
    – naphaneal
    Commented Apr 5, 2016 at 15:37

1 Answer 1

1

Your issue is caused by the space in the file name of the file you are calling.

As explained in Spaces in files names in \input or \includegraphics, you should use the double quote symbol " around the path.

\documentclass{article}
\usepackage{graphicx}
\graphicspath{ {c:/Users/../Graphs/} } 
\begin{document}

\includegraphics[scale=0.25]{"leeftijd distributie.pdf"} 

\end{document}
3
  • thanks this works (without the .pdf within the quotes). I also had spaces within my graphics folder so also needed quotes in \graphicspath.
    – DirkSa
    Commented Apr 5, 2016 at 15:29
  • 1
    Glad I helped you! Consider accepting the answer if you're satisfied with it. (-:
    – ebosi
    Commented Apr 5, 2016 at 15:32
  • I will. Probably still have to wait for the 15 minutes to pass.
    – DirkSa
    Commented Apr 5, 2016 at 15:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .