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

Some accompanying question to where to put .sty and .cls file for project

What if there are, say two, the same name sty-files located in one texmf-tree but belonging to different packages

  • \texmf(local)...\packageOld\XXX.sty

  • \texmf(local)...\packageNew\XXX.sty

  • \texmf(global)...\InstalledPackage\XXX.sty

and then do

\usepackage{XXX} % ???????? what gets here?

When scanning the tree which one will be chosen by TeX-system, say MiKTeX? According to the order of the folders above? But this would be non-satisfactory. I may want to use XXX.sty form global but other time from local\packageOld... then from ...New etc. Should I change the structure of the paths above each time or to have a headache about possible coinciding my package name with some one from a huge TeX-system tree?

share|improve this question
Within each tree you really want to keep names unique: search order for trees is well-defined, but within trees probably is OS-dependent. – Joseph Wright Nov 21 '13 at 12:57
The search path doesn't depend only on the texmf root but also on the first two folder layers inside a texmf tree: tex.stackexchange.com/a/79983/2388. If you really want to switch between package versions: Put them in a texmf-tree on its own. You can register and unregister such a tree in miktex settings or with initexmf --register-root=.... – Ulrike Fischer Nov 21 '13 at 13:32
Whoever downvoted this question please add a comment why! So the OP has a chance to improv the question. – Tobi Nov 21 '13 at 14:59
I was experimenting the location of packages and concluded that MiKTeX-system takes the package according the order of the paths above afterwhat it takes from the package list the nearest by the alphabet order. So, if you've assigned unlucky (coinciding with some other name) name for your package you will never get it. Strange TDS-rules however... – maximav Nov 22 '13 at 14:41

Your Answer


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

Browse other questions tagged or ask your own question.