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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
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