Graphics, Figures & TablesGraphics Inclusion with absolute Path

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
tylerh
Posts: 1
Joined: Wed Nov 27, 2013 4:49 am

Graphics Inclusion with absolute Path

Post by tylerh »

Hi there,

I'm a beginner in LaTeX, and am having problems I was hoping someone could help me with. I'm trying to learn how to place images in figures using graphicx. This is my simple test code, which isn't working.

Code: Select all

\documentclass{article}
\usepackage{graphicx}

\begin{document}
  \begin{figure}[!h]
    \centering
    \includegraphics{C:\Users\Tyler\Dropbox\hatchdownmesh.png}
  \end{figure}
\end{document}
When I use this, the program gets hung up on the line with \includegraphics. It outputs the following LaTeX error.

Code: Select all

! Undefined control sequence.
<argument> C:\Users 
                    \Tyler \Dropbox \hatchdownmesh 
l.19 ...{C:\Users\Tyler\Dropbox\hatchdownmesh.png}
Does anyone have any ideas that could help me? I've tried uninstalling and reinstalling MiKTeX. I'm stumped.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Graphics Inclusion with absolute Path

Post by localghost »

Even on Wind0ws you need to insert slashes (/) instead of backslashes (\) in the path of the image file.

Code: Select all

C:/Users/Tyler/Dropbox/hatchdownmesh
The file suffix can be dropped.


Best regards and welcome to the board
Thorsten
Post Reply