# Using relative paths for \input in TexShop - File not found

I wrote an document, that inputs another .tex file:

\input{../../../_def.tex}

\title{My Title}
....


Now, when I run compiling this document, TexShop says:

! LaTeX Error: File ../../../_def.tex' not found.


I think, the problem is, that the compiler tries to resolve the relative path from its own folder, but I defined it relatively to the source file, which I quoted above. Is this the reason?

How can I fix I - without using absolute paths.

• input paths in tex are always relative to the working directory of the program, not to the directory the document is in, so it is simplest if you arrange to cd to the document folder first. Also your document would be far more portable if it just had \input{_def} and you arranged that the folder containing that file is in your TEXINPUTS path. – David Carlisle Dec 6 at 15:44
• I don't use texshop or texstudio so i can't say how to configure them, both texlive and miktex have default input paths so if (on texlive) you put the file in ~/texmf/tex/latex/anything/_def.tex then any of your latex documents could include it as \input{_def}` – David Carlisle Dec 6 at 19:01