Although you already got some answers (some of them in the comments), let me say the following: TeXLive (and MikTeX as far as I know)
- is set up, to use properly filled TDS, which is TeX Directory Structure(s).
- is using the Karl Berry Search Path tools. Therefore you can use the command line tool
kpsewhich to determine, where a file is located. This command was inspired by the Unix
which-tool, which tries to find the location of a given executable. For the usage in TeX-systems, it was enhanced a little bit.
Especially in TeXLive (but again, I think in MikTeX too), you can use more than one TDS-tree parallel to another. Usually, TeXLive-systems are set up to have three of these TDS-trees:
- The TDS for the maintainer of the distributions,
- The TDS for the local system administrator,
- The TDS for the individual user.
The first one contains all the packages, that came with TeXLive (MikTeX, respectively). It will be installed, when you (as system administrator) install your TeXLive-System. It will be changed, whenever you update your TeXLive-System. Therefore you should not install any packages into that TDS-tree (unless you are an TeXLive maintainer, of course. But why should I explain the setup to you, than?).
The second TDS-tree is for the system administrator, who supports his users with a central repository of readily installed local packages. For example, the style files to obeye your universities corporate design will be installed here. If it is a network share, all TeX users in the whole university (whole company, if you like) can use this files without any further configuration. To be able to install packages in this tree, you usually need to have system administrator rights also, to be able to write files here.
The third and last tree, is the tree for the individual user. It will be located in a directory owned by the user himself; classically this was within the home-directory of the user on Unix systems.
You can use the TeXLive command tool
tlmgr to find out, where these three TDS are located on your individual computer. Just run
and check for the lines beginning with
They point you to the correct locations in your TeX installation.
(I don't know the tool, which gives this information on MikTeX, sorry.)
There is also a line beginning with
texmf.cnf which will list the location of the master configuration file. If you ever plan to change some of the locations and you really know, what you are doing there, thats the file to edit!
There is one other important thing to point out. Nowadays, a full grown TeX system consists of hundreds of thousands of files. It would be tedious for your computer, to search every path over and over again, just to locate say
book.cls. (Have I mentioned, that computers are stupid? Computers can't remember those locations, if you don't provide any help!) To prevent searching and searching and searching again, all the files, which are located in the distribution TDS tree and in the Local TDS tree, are stored in a simple database. Therefore it is not sufficient, to copy a file into one of those trees. TeX will not find these files, unless you update the database. Of course, you surely will need super user rights (AKA super cow power :-)) to update the database. On classical Unix systems this used to be the
texhash command or
mktexlsr which is the short form of "Make the TeX ls-minus-R database" (To be true: it is nothing else than
ls -R $TEXMFDIST or whatever TDS tree you want to add to your database.)
To sum up all that: if you plan to enrich the world by releasing a package of yours, to be installed on somebodies else computer, the best way would be to convince the TeXLive maintainers to include it in TeXLive. Than you don't have to worry anymore. If your package is not that important, that you could convince the TeXLive maintainers to have it included, it might be best, to instruct your customers, to install it in the
TEXMFHOME part of their system. Just ask them to run
tlmgr conf | grep TEXMFHOME
on Unix-like systems. On newer Windows systems having a bash installed, it might also work. In that location they don't need to have super cow powers nor have they to hassle to update the database. If you happen to give your package to system administrators, they usually know, where to store the package and how to update the database.
P.S: If you want to make sure, that the newest
book.cls fresh from CTAN, yould be used on your TeXLive system, while the maintainers didn't incorporate it into their distribution, you have to install it either in
TEXMFHOME and to configure your system by editing
temf.cnf in such manner, that
TEXMFDIST will be search at last of the three given TDS trees.