Suppose I have one folder (folder name: stys) where I stored the following files:
The full path for the stys folder is:
I created one document (doc1.tex) which I stored in the following directory
doc1.tex requires main.sty, so I used the following line of code, given their relative paths, to call it:
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:
But I quickly found that even though both .sty files are in the same directory the command I need is:
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:
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:
does not work (File `../stys/other.sty' not found.) for doc2.tex because the path of other.sty relatively to doc2.tex would be:
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).