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 am currently writing on a document where I want to include subfiles; I am creating a modular document. Now, the problem is, that I am including (read: input) files, that have been used for other modular documents, too. This is a problem, because some of the files, that I wish to include also contain images (i.e. links to images). So, when I now include file z, LaTeX-compiler produces the error: "Warning: could not find image so and so". Of course, that's logical, since the very image itself was originally intended to be used by another main.tex, to which (pardon me this reificiation) the relative link makes sense.

I know, that I could use absolute links, however, for obvious reasons, I'd like to avoid, using them. Another solution would be, to "emulate" the original relative link. For instance, if I originally used "includegraphics={../graphic.png}, then, by copying the specific image to that place of the new main.tex, that would be ../ of the new main.tex, i.e., the directory "below" the new main.tex, everything would check out fine.

Unfortunately, in some cases, this is not possible. I would, lastly, rather not copy the files to be included in my new main.tex, since I'd like changes to be dynamic for both files.

Just to clarify, what these files are intended to do: they constitute semester-summaries. However, my newest idea, was to create a meta-document, where I would simply compile all the documents, and have some sort of meta-study-years-file. Hence the problem.

Best Regards, Niklas

share|improve this question
1  
You can create symbolic links to the graphic files in your working directory, or in a subdirectory of your working directory. This is the recommended method in the italian and french translations of l2tabu. This is possible too under windows since Win 7. See for instance the end of § 3.4, p.21 of the french translation. –  Bernard Feb 2 at 15:12
1  
Perhaps setting \graphicspath in your preamble will help. See tex.stackexchange.com/questions/15960/graphicspath-and-include –  Ethan Bolker Feb 2 at 15:29
add comment

1 Answer

It's usually best to use simply

\includegraphics{file}

so long as your graphic files are reasonably uniquely named. then just arrange that whatever directory you put them in is in TeX's input path. Just as \documentclass{article} works from anywhere without having to make copies or links of article.cls the same mechanism is used for graphics inclusion.

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.