Why does Tex not include files from parent directory?

Why does Tex not include files from parent directory?

Perhaps your TeX configuration does not allow to include files from the parent directory, using ../ will not work then. What distribution do you use? You could avoid that if you put the image and chapter directories below the directory of the root file.

How to include TeX files in latex.org?

Another option is to use (path-like) TEXINPUTS environment variable, as Stefan suggest, and then you only need to have \\input {file} in your sources.

Is it possible to change the working directory in Tex?

The problem is that TeX will resolve file paths relative to the main input file (or rather to the current working directory). This of course will create problems if you have nested directory structure and want to use just a part of it (like chapter1 subdirectory). And you can’t change the working directory from within your source file, AFAIK.

Where do I find the root TeX file?

What I have at the moment is several folders each containing a chapter. The folder contains the tex file and an image folder containing the images that are going to go into that chapter. There is also a folder called root, that contains the root tex file, like follows:

Do you need to include files in file2.tex?

Note that file2.tex does not have its own preamble, document class, \\begin {document} etc. Think of \\input as having a similar effect to you manually copying and pasting whatever is in file2.tex into file1.tex: no need to include anything you wouldn’t want to copy in this fashion.

How to include a JPG file in Tex?

Since fig.jpg is in the same folder as file1.tex this means that we don’t have to specify any path. Saving this file/folder structure and compiling file1.tex results in a document with fig.jpg included in it. Yes, the \\include { } command inserts the file after a page break. If you don’t want the page break, use \\input { }.