I've spent two days trying to install manually the cite.sty package in MiKTeX when nothing worked except putting it in the same directory as my .tex file. I run windows.

I found the MiKTeX options (by searching "settings" in my computer), which display the following four root directories.

You see five different root directories, four labelled as UserInstall, UserData, CommonData or CommonInstall and one named c:\mytexmf with no label

Here it says that sty file should be placed (respecting the structure tex/latex/cite) in the local texmf directory structure but here and here it says that it should be in the home texmf directory. Part of the problem is that I don't have any directory in my computer named "texmf" (or "localtexmf" or "texmf-local").

After putting the file in the right place one must refresh FNDB, which can be done on MiKTeX options or by typing "texhash" in the command prompt. When I did the latter I noticed that only the first three directories in the list were being searched.

Now when you put the mouse over the different directories, on all of them except c:\mytexmf the following warning comes up.

This directory is maintained by MiKTeX. You should not install your own files here, because they might get lost when MiKTeX gets updated.

On the c:\mytexmf directory the message comes:

This directory can be used for local additions.

So I intended to put the file there, but, unlike with all the others, I cannot find this directory in my computer. I don't know if the fact that the "c:" in the address is lowercase means something.

So I went back to trying to identify the home and local texmf directories. Following the advice in the last link I wrote the following commands in the command prompt.



The first one yielded the error message "unrecognised option -val-value-TEXMFHOME" but the second one came back with "C:/Users/pablo/AppData/Roaming/MiKTeX/2.9".

Piecing things together I guessed that the "C:\Users\pablo\AppData\Local\MiKTeX\2.9" directory was, despite the name, the TEXMFHOME directory. I included the correspoding directory tree and file (tex/latex/cite/cite.sty) there, refreshed FNDB with the command "texhash" and it worked.

The problem though is that I'm still not sure whether this is the ideal place to put the file, and whether it might get lost when MiKTeX is updated. And the problem remains that I cannot find the c:\mytexmf directory.

Extra information:

Here it states: "UserInstall: the installation destination for packages installed by the user", where "Userinstall" corresponds (see image above) to my TEXMF-LOCAL directory. This is a bit confusing considering the warning message, and the fact that it worked when I put my package in the other directory.

I can't find the MiKTeX console and I'm not at all sure that I have it. I did find the package manager but when trying to use it to install the package it yields the following error message:

get host by name failed in tcp_connect()

The information here and here seems to contradict on whether MiKTeX includes by default a local texmf tree. In my case it seems that the answer is yes.

Other useful links:

Windows MikTeX can't find my .sty file

Integrating Local Additions

  • 2
    Create a folder structure mytexmf/tex/latex/cite.sty somewhere and then add the root mytexmf with the add button. Btw: if you still have MiKTeX option your system is quite old and quite probably you won't be able to install packages with its tools anymore. – Ulrike Fischer May 18 '19 at 22:38
  • 1
    Normally the advice is DO NOT install manually the package is a common CTAN package and should be listed on the last tab such that MiKTeX could install it for you, HOWEVER as Ulrike has mentioned your package manager is unlikely to allow you to add fresh standard CTAN packages to an older installation. If you really want to keep the existing installation the installer expects all the .sty and cite.ltx files in a TDS folder such as mytexmf/tex/latex/cite whilst the docs would be in mytexmf/doc/latex/cite – user170109 May 18 '19 at 23:37
  • @UlrikeFischer but shouldn't c:\mytexmf exist already? If I can't find it are you suggesting that I create it and then add it? – Anguepa May 19 '19 at 2:36
  • 1
    No MiKTeX doesn't create a local texmf by default since a long time but expects that you do it when you need it the first time (and so you can choose the name and the location that suits you). – Ulrike Fischer May 19 '19 at 7:49