Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm using TikZ for my thesis but have run into a small problem. In order to maintain some overview of the main tex file I have split all images into separate TikZ files (This also allows me to edit them with KtikZ which is nice). All images are put into a separate directory, say /images, which contains the TikZ files as well as any data file they include for plots (these are drawn with the \draw plot file{<filename>}; command).

Now, my problem is that when I import an image (\import inside an figure environment) all the file paths inside the TikZ file become wrong.

So, is there any way of changing the evaluation directory inside the scope or to provide the TikZ file with an relative path or something? All ideas are welcome!

share|improve this question
add comment

migrated from stackoverflow.com Jan 19 '12 at 15:28

This question came from our site for professional and enthusiast programmers.

1 Answer

I follow the same process of keeping my TikZ images in a separate file, editing them in QTikZ and then including them in my main file. The way I do this is to define a new command that I can set in different locations. I have the command \tikzimgpath in my main file defined as:

\newcommand{\tikzimgpath}{images}

In the QTikZ template file (/usr/share/qtikz/templates/template_example.pgs), I define \tikzimgpath as:

\newcommand{\tikzimgpath}{/home/username/documents/teaching/latex-templates/includes/images}

Then, whenever I want to include the file, I can say:

\includegraphics{\tikzimgpath/filename}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.