Text FormattingRelative reference to image

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
artemff
Posts: 113
Joined: Sat Oct 17, 2009 11:15 pm

Relative reference to image

Post by artemff »

Why this

Code: Select all

\includegraphics{example.eps}
sample work, but if I want to refer to file in relative directory:

Code: Select all

\includegraphics{images\backslash example.eps}
this don't work, also don't work next:

Code: Select all

\includegraphics{\backslash images\backslash example.eps}
How this do?

Recommended reading 2024:

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

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

spurta
Posts: 10
Joined: Sat Oct 24, 2009 11:36 am

Relative reference to image

Post by spurta »

Just before \includegraphics write this, it works for me:

Code: Select all

\graphicspath{{./folder/}}
Look up more info if the path length is longer I think you have to write each folder in curly braces.

Then reset to the working directory directory

Code: Select all

\graphicspath{{../}}
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Relative reference to image

Post by localghost »

Slash instead of backslash.

Code: Select all

\includegraphics{images/filename}
The suggestion of spurta can cause problems. See l2tabu.


Best regards
Thorsten
artemff
Posts: 113
Joined: Sat Oct 17, 2009 11:15 pm

Relative reference to image

Post by artemff »

by localghost
Thank you
Post Reply