Possible Duplicate:
Where do I place my own .sty files, to make them available to all my .tex files?
Our organization produced a document class for internal use. The document class uses some images for headers and footers. We put these images in the same directory as the document class, and the document class includes them using the \includegraphics command, e.g.:
\includegraphics{header.pdf}
Now assume that, in my computer, the document class (and the images) reside in /home/A, but in my friends computer they reside in /home/B. So, my LaTeX documents start with:
\documentclass{/home/A/report}
but in my friend's computer, it reads:
\documentclass{/home/B/report}
The problem is the following:
When pdfLaTeX reads the line \includegraphics{header.pdf} in the document class, it searches the directory where the .tex file resides, rather than the directory of the document class. Although I can use the command
\includegraphics{/home/A/header.pdf}
in the document class, but then my friend has to change it to the following:
\includegraphics{/home/B/header.pdf}
which breaks the uniformity of the document class in the organization. Even using the \graphicspath command does not seem to be a solution.
Is there a way to obtain the location of the document class within it, so that I can change it to something like
\newcommand{\dcpath}{_COMAND_TO_GET_THE_PATH}
\includegraphics{\dcpath/header.pdf}
once and forever?
\def\dcpath{/home/A/}\documentclass{\dcpath report}and then of course\includegraphics{\dcpath header}. I know, I know, but hey, so you don't have to do the TeX tree setup nightmare on every box. – Christian Apr 20 '12 at 17:07