4

I understand a number of people have asked similar questions to this but I am yet to find an answer in their questions which solves the problem I'm having.

I am trying to put an image into a pdf. I have done this plenty of times and never had any major issues.

This is some of my code:

\documentclass[a4paper]{article}
\usepackage{times}
\usepackage[margin=1in] {geometry}
\usepackage{mathptmx} 
\usepackage{amsmath, amsthm, amssymb}
\usepackage{multirow}
\usepackage[english]{babel}
\usepackage{hyperref}
\usepackage{graphicx}

\graphicspath { {D:\Work\Thesis\Images} }

\begin{document}
\title{Developing...}

\section{xx}

\subsection{xx}

\includegraphics[width=7.5cm]{vv1.jpg} 

\end{document}

I have checked the directory of the image clearly and the image name and both are correct. I have tried putting the image in a different document and its worked just fine.

user3771983
  • 65
  • 1
  • 2
  • 4
  • 3
    Have you tried \graphicspath{D:/Work/Thesis/Images}? – Przemysław Scherwentke Jun 24 '14 at 16:04
  • 1
    When you say \include graphics in the question title, with a space, that causes me to suspect that this space could be the reason behind the error. Just a wild guess. – Masroor Jun 24 '14 at 16:05
  • Welcome to TeX.SE! Which error message(s) do you get? – Mico Jun 24 '14 at 16:06
  • @Masroor: The command \includegraphics is correctly spelled in the MWE, however. –  Jun 24 '14 at 16:11
  • @ChristianHupfer Yes, I did notice that, but I was surprised why it is written that way in the subject. Again, just a wild guess. – Masroor Jun 24 '14 at 16:22
  • Even though your operating system, Windows, uses a backslash for delimiting directories in a path, \graphicspath always expects a forward slash. See Heiko's answer. – jub0bs Jun 24 '14 at 16:24
  • @Masroor: Well, I refrained from editing the 'typo'(?) In the title, but it was my first guess also –  Jun 24 '14 at 16:27
  • Hi, turns out switching from backslashes to forward slashes and including the directory separator has sorted the issue. Thanks for all your help – user3771983 Jun 27 '14 at 09:14

1 Answers1

7
\graphicspath { {D:\Work\Thesis\Images} }

TeX will look for macros \Work, \Thesis, and \Images. You can use forward slashes instead (also in Windows):

\graphicspath{{D:/Work/Thesis/Images/}}

Also you need the directory separator at the end of the path, because package graphicx only puts the path before the image name.

The additional set of curly braces is correct.

Heiko Oberdiek
  • 271,626