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?

  • 4
    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
  • 1
    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... – user40791 Nov 22 '13 at 14:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy