Suppose I have one folder (folder name: stys) where I stored the following files:
- main.sty
- other.sty
The full path for the stys folder is:
D:\a\b\c\stys
I created one document (doc1.tex) which I stored in the following directory
D:\a\b\c\daaa
doc1.tex requires main.sty, so I used the following line of code, given their relative paths, to call it:
\usepackage{../stys/main}
So far, no problems. Then, I need main.sty to call other.sty. I would think that since main.sty and other.sty are in the same folder, the command for calling other.sty would be simply:
\usepackage{other}
But I quickly found that even though both .sty files are in the same directory the command I need is:
\usepackage{../stys/other}
because doc1.tex is calling main.sty so the "current directory" is the one where doc1.tex is stored.
My problem arises when I start working on a new document, doc2.tex, which is stored in a different path:
D:\a\b\c\dbbb\e
I want to call the same main.sty file, which as I said before calls other.sty
The problem is that the line of code inside main.sty that works for calling other.sty for doc1.tex, which was:
\usepackage{../stys/other}
does not work (File `../stys/other.sty' not found.) for doc2.tex because the path of other.sty relatively to doc2.tex would be:
../../stys/other
What is the clever way to make this work without having to change the line where other.sty is called inside main.sty every time I create a new document in a different directory? (I want to have main.sty stored in a single location so that is easy to customize it to my needs over time).
Cheers,
Fabio
.styfiles in one folder and use the system enviroment variableTEXINPUTSpoint to that folder. However, you use Windows, there might be something similar. – Apr 26 '14 at 12:26