I have a dedicated directory for my project; within that are nested directories source/
, output/
and styles/
that contain the .tex
, .pdf
and .sty
files.
I was surprised to find that while \usepackage{../styles/mystyle}
from source/main.tex
did work as expected, I have to use the same path in the incantation from within styles/mystyle.sty
, not \usepackage{./substyle}
.
In other words, relative paths in a file included with \usepackage
would appear to be resolved with respect to the including file, not the included one.
This seems problematic since it couples sources and styles—and indeed, moving the source to, say, /tmp/main.tex
breaks the document! this is, to say the least, surprising.
Am I doing something wrong? is there a package that allows me to do the equivalent of a \usepackage
with a path that is resolved relative to the including file?
I know I could probably set up environment variables and/or edit some TeX configuration file, but I'd prefer not to in order to keep everything working with a standard TeXlive/MacTex installation.
..
is prohibited for security reasons. – Martin Scharrer♦ Jul 14 '13 at 19:47cd
ing out of the current directory? it's not that my TeX install goes online or what. and i do currently use..
without (La)TeX complaining. – flow Jul 14 '13 at 20:39