I use some .sty-files that are not part of texlive and want to have them in a subdirectory of the folder with my main.tex. I used the following line to load the package:
You can do it in your TeX file without changing your system's environment (do not forget the trailing slash /
with each directory):
\makeatletter
\def\input@path{{../one-directory/}{../another-directory/}}
\makeatother
\documentclass{myclass}
\usepackage{mypackage}
This way, though, may be not recommended for portability. As other answers mention, the "correct" way is to set the TEXINPUTS
variable in your system environment before you call latex; in Windows it is (you can place it in a batch file):
set TEXINPUTS=../one-directory/;../another-directory/;%TEXINPUTS%
pdflatex myfile.tex