Why doesn't work this?:
Folder content:
Main folder/
|- main.tex
|- mylocal/
|- headers.sty
|- tikz-qtree/
|- tikz-qtree.sty/.tex
|- pgftree.sty/.tex
|- pgfsubpic.sty/.tex
Files:
% Main.tex
\documentclass{article}
\usepackage{./mylocal/localpackage}
% ./mylocal/headers.sty
\usepackage{./mylocal/tikz-qtree/tikz-qtree}
Context: I have a group of documents, all ones with the same header (a group of related documents with the same format, settings and packages). For this reason, I have in main.tex (an example of one of these documents) the line \usepackage{./mylocal/localpackage}. In localpackage.sty I have all my includes, custom commands, environments and settings.
Now, I need other additional packages not included in the Ubuntu's repositories (for example). I don't want formally install in my system this additional packages because my documents are free and I want other people can download my documents and compile them easily. I don't want force users install manually packages (either absent in well-known repositories or in general uncommons packages) for compiling these documents.
Thus, I put this additional packages (for example, otherlocalpackage.sty) in my local folder (./mylocal/), and then I add the line \usepackage{./mylocal/thisnewpackage} in my "universal" header localpackage.sty. The problem arises reading this "additional package", because this package is indeed a group of files calling each other (with local and not complete paths). LaTeX said me that it can't found this additional packages. For example, tikz-qtree.sty has the line \RequirePackage{pdftree} and LaTeX said me:
! LaTeX Error: `pgftree.sty' not found.
How can I force LaTeX deal with my local folder as a "standard" folder, in order to "local paths" inside other packages works?
I guess renaming each RequirePackage/input/usepackage lines inside my additional package for longer paths (path since my makefile up the file/package in question) that must work, but I try always avoid manual works in order to make code more flexible and to avoid potential risks.
\RequirePackage{pdftree}
doesn't work. You are in the folder wheremain.tex
resides and so you would need like in the usepackage commands the complete pathmylocal/tikz-qtree/pdftree
. The easiest is to put all the files in the folder ofmain.tex
.TEXINPUTS=/sone/path/to/somewhere//: pdflatex myfile
then you only need the filename in your TeX source. The directorysomewhere
and all its subdirectories will be searched before the standard path. Distributing copies of packages without their full original documentation is almost always contrary to the licence agreement on the packages (if they are LPPL or GPL licenced for example)