TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

At the moment I have some modified and some of my own packages placed in the same folder as my tex file. I would like to move all of them in a subfolder called packages so that I have a better overview over my files. Is there any way to achieve this?

share|improve this question
you can always reference packages in a different directory by \usepackage{/path/to/package/x.sty}. Alternatively you can add them to your local texmf tree and use them that way. – Roelof Spijker Oct 18 '11 at 14:00
that is something I already tried and didn't seem to work correctly, since it gives me the warning You have requested package 'package/name' but the package provides 'name' – maetra Oct 18 '11 at 14:35
@maetra: That is just a warning, the package is indeed loaded. (But see the other answers, which are "more proper" [with no offense to wh1t3 intended].) – Ulrich Schwarz Oct 18 '11 at 18:06
up vote 3 down vote accepted

For all my larger LaTeX projects, I maintain a project-local texmf subfolder for exactly this purpose: own and modified packages, new versions of packages that are not yet part of major TeX distributions, and so on. I include this folder by setting TEXINPUTS in the project's Makefile or manually in bash: export TEXINPUTS=./texmf//:${TEXINPUTS}.

(Note: The double slash // makes LaTeX to search subfolders as well. If the project-local texmf folder contains also bibliography-related packages, such as a new version of biblatex, one also has to set BSTINPUTS accordingly.)

One often hears that additional/own packages or updates to existing packages better go into the machine-wide or user-wide texmf tree. This might work well if you work alone on a project on a single machine only, but it certainly does not work so well in a collaborative setting.

By maintaining all "non-standard" packages in a project-related texmf subfolder, I can put everything together into a version control system (such as git or subversion). Collaborating colleagues (even those that are still stuck to TexLive 2010) can check-out and built the project without having to manually install or update a dozen of LaTeX packages.

share|improve this answer
that was pretty much idea too, since I am already using subversion in a collaborative setting. But I am using windows and miktex-portable, so I have to adapt your solution. I tried to do set UserRoots=\packages and set texmf=\packages but had not success with that. – maetra Oct 19 '11 at 8:23
That seems like overkill, really. – einpoklum Jan 16 at 17:11
@einpoklum: That seems like overkill, really. – yes, it does. Until the day you have to rework a ten years old project, work on the same project on three or more different computers using different environments, work with 10+ people on the same project, or just have to pass the thing in a "way that works" to your colleague or boss. – Daniel Jan 16 at 18:23
Fair enough :-( – einpoklum Jan 16 at 18:27

befor you run pdflatex do a export TEXMFHOME=packages/

share|improve this answer

For MikTeX-Portable there doesn't exist such a simple solution as described by Daniel and Herbert, but adding the packages' path via MikTEX->Options->Add Root seems okay. One just has to take care to remove the additional path before compiling other projects that don't use the the modified but the original packages.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.