Besides xy.sty
, you also need xy.tex
. The error message belongs to line 32 of xy.sty
, there's the command \input xy
. This means xy.sty
has been found but not the xy.tex
file.
Just install the complete xypic
package. On my system, with TeX Live 2011 pretest, the xypic
directory contains 63 files.
Yes, it is default behaviour of MiKTeX to install missing packages “on-the-fly”, but this can be changed in the Options dialogue. All in this way installed packages go into %APPDATA%\MiKTeX\<version>\
(<version>
is 2.9 at time of writing), the MiKTeX variable is UserInstall
. Since Windows Vista %APPDATA%
resolves to C:\Users\<username>\AppData\Roaming
, therefore your observation.
But this needs an active connection and a responding download mirror. At least one of these two things did not work in your case. If it was the mirror you can take a look on the CTAN mirror monitor Status of CTAN Mirrors, and if necessary in MiKTeX settings change the active mirror (MiKTeX Options, in tab “Packages” the first line shows the active MiKTeX repository and on the right you can change it).
I prefer to install all packages with the Package Manager, but this needs to be done on a regular basis, about once a week, and of course one needs enough disk space. In the rare cases, when I was asked for installation, I stopped this and ran the installation with the package manager. (Note, that this is different from, what is usually meant with “manual installation”! You already linked to the according question.)
All with the package manager installed packages go into the main MiKTeX tree (see Root 3
in your question), if you made the update in admin mode or in single user installation with writing rights in this folder. If you did a user mode installation packages will always be installed in UserInstall
.
One would expect, that installation in admin mode goes into CommonInstall
, what is the same folder in your case. But on my system this is not used, the folder, to whome CommonInstall
points, does not exist!
Other related questions, at least partially:
Best Answer
You could create a folder below your TeX home directory and put your
.sty
file therein. Use this command at the command prompt to find out where:On my computer it shows
but it might also be
~/texmf/
on a Linux or Unix computer.Following the TeX directory structure, you should place your file in a subdirectory like
~/texmf/tex/latex/commonstuff/
, according to Arthur's comment below. This has the advantage that it is not necessary to update the package database as TeX searches your personaltexmf
tree directly. If there is anls-R
file in your hometexmf
tree you can safely delete it as TeX will not use it anyway. (Note: this assumes your personal tree is on a local file system: users with remotely-mounted home folders may still need to hash.)Regarding MiKTeX, have a look at the section "Installing sty or cls files" in the answer to the question How can I manually install a package on MikTex (Windows).
You can then verify what file will be used with:
This will show the path to the file picked up by the TeX implementation.