[Tex/LaTex] texmaker and includegraphics cannot find file

graphicspdftextexmaker

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

Best Answer

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}