4

I am trying to use \graphicspath properly, and am having some issues. I am using MikTex 2.9 64-bit on a Lenovo X230.

Here is my code:

\documentclass[12pt,letterpaper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\author{Jeffrey Wubbenhorst}
\title{math Sandbox}
\begin{document}
\begin{figure}[ht!]
\begin{center}
\includegraphics[scale=0.75]{Disposables/idiot.jpg}
\graphicspath{{C:/Users/chire001/Documents/Jeffrey Files/School/Software/LaTeX/Disposables/idiot.jpg/}}
   \caption{A simple caption}
\end{center}
\label{overflow}
\end{figure}
\end{document}

One of the most crytpic errors I am getting is below:

! Package pdftex.def Error: File `Disposables/idiot.jpg' not found.

Another error:

! Package pdftex.def Error: File `Disposables/idiot.jpg' not found.See the pdftex.def package documentation for explanation.Type H <return> for immediate help.... ...raphics[scale=0.75]{Disposables/idiot.jpg}

I hope this is not a duplicate- at the risk of writing an excelssively long post, here is another piece of code that didn't work. I had some conflicting documentation on the usage of \graphicspath, and wanted to try and sort everything out.

\documentclass[12pt,letterpaper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\author{Jeffrey Wubbenhorst}
\title{math Sandbox}
\begin{document}
\begin{equation}
\delta+y \\
Cowbell
\end{equation}
\begin{figure}[ht!]
\begin{center}
\includegraphics[scale=0.75]{Disposables/idiot.jpg}

\graphicspath{{C:/}{Users/}{chire001/}{Documents/}{Jeffrey Files/School/}{Software/}{LaTeX/}{Disposables/}{idiot.jpg/}}
\caption{A simple caption}
\end{center}
\label{overflow}
\end{figure}
\end{document}

This yielded ! Package pdftex.def Error: FileDisposables/idiot.jpg' not found.See the pdftex.def package documentation for explanation.Type H for immediate help.... ...raphics[scale=0.75]{Disposables/idiot.jpg}'

My apologies for my ignorance.

Best regards,

~Q0rk

  • Try to use quotes around the path "...". – Sigur Feb 22 '14 at 1:49
  • Don't use the center environment in figure; change \begin{center} into \centering and remove \end{center} – egreg Feb 22 '14 at 11:07
4

There are spaces in the path. Package grffile adds support for spaces for pdfTeX in PDF mode:

\usepackage{graphicx}
\usepackage{grffile}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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