0

hi every one i have big problem i want to include some graphics in my PDF but there are in other folder i want to include them with out moving them i use commend

 \usepackage{graphicx}
 \graphicpath{c:/Documents/mypicture/mypicture1.jpg}
 \begin{document}
 \includegraphics[height=\baselineskip]{mypicture1.jpg}
 \end{document}

but i have problem please help me i use xe-latex compiler. and what happen if they are more than one image for example :c:/Document/my pictures/picture1.jpg c:/Document/my pictures/picture2.jpg

alish
  • 3

1 Answers1

1

The paths in \graphicspath has to be surrounded by braces and should end with the directory separator. Also they do not contain the image file names:

\graphicpath{{c:/Documents/}}

The syntax for \graphicspath is documented in section "4.5 Other commands in the graphics package" in the LaTeX guide for the graphics packages, grfguide.pdf.

If the path or image file contain spaces, then package grffile should be loaded in addition:

\usepackage{grffile}
Heiko Oberdiek
  • 271,626
  • what happen if my path be longer?? – alish Jul 16 '17 at 10:48
  • for example c:/Document/my pictures/picture1.jpg – alish Jul 16 '17 at 10:49
  • and what happen if they are more than one image for example :c:/Document/my pictures/picture1.jpg c:/Document/my pictures/picture2.jpg – alish Jul 16 '17 at 10:50
  • @alish The full path can be specified in \includegraphics, the paths in \graphicspath usually contain directories. – Heiko Oberdiek Jul 16 '17 at 10:53
  • @alish path should be \graphicpath{{c:/Documents/mypictures/}} --- notice the slashes direction and the fact that the path is the folder. Avoid using folders with spaces in their name (it can work, it could not work, simply avoid it). Now you can include all the graphics you want from that folder simply with their name – Rmano Jul 16 '17 at 12:05