GeneralUse Path from Sub-document in Master Document

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
Erik_Svendsen
Posts: 5
Joined: Thu Sep 08, 2011 9:20 am

Use Path from Sub-document in Master Document

Post by Erik_Svendsen »

My problem is, that I don't know how to specify the path from the sub document.

I have a master.tex that inputs \images\test.tex

test.tex inputs an image from the same folder it is in - the images folder.
My problem is, that I have to write the path from the master document.
So in test.tex I have to write:

Code: Select all

\includegraphics{images\testImages.jpg}
Since test.tex is in the same folder as testImages, I would like to just write:

Code: Select all

\includegraphics{testImages.jpg}
Is this possible?
Last edited by Erik_Svendsen on Sun Dec 04, 2011 3:32 pm, edited 1 time in total.

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
Stefan Kottwitz
Site Admin
Posts: 10360
Joined: Mon Mar 10, 2008 9:44 pm

Re: Use Path from Sub-document in Master Document

Post by Stefan Kottwitz »

Hi Erik,

commands from \images\test.tex work like they would be in the main file. So you need to add \images\. However, you could set your TeX related environment variables to include this path, or use \graphicspath from the graphicx package to specify search paths for graphic files, or use a macro for the path name.

Stefan
LaTeX.org admin
Erik_Svendsen
Posts: 5
Joined: Thu Sep 08, 2011 9:20 am

Re: Use Path from Sub-document in Master Document

Post by Erik_Svendsen »

Thank you
Post Reply