I'm on Windows behind a firewall (you're offering your sympathies; I know; thanks). I need to add the package xcolor to MiKTeX.

I download xcolor.zip and unpack it in c:/Users/<username>/AppData/Local/Programs/MiKTeX 2.9/tex/latex alongside the packages that came with MiKTeX.

Does there exist an "add to the index" MiKTeX command that does not need network access?

Does miktexsetup make it possible to set up a local repository other than through --local-package-repository and --package-set=complete download? Using this pair requires network access.

  • 1
    Yes. First, use the MikTeX console to Settings->Direcdtories and add the directory containing your sty file. Then use Tasks->Refresh file name database. – John Kormylo Aug 16 '19 at 14:41
  • 3
    The word "manually" can take on different meanings. The MikTeX console allows for a single package to be added or removed. To update a package, I will go and uninstall it, then reinstall it, all from the console. – Steven B. Segletes Aug 16 '19 at 14:52
  • @JohnKormylo Thanks. I expanded on your comment. I'm unsure whether it's clean to install the dependency mptopdf also in <dir>/tex/latex or some other location is more appropriate, but it works. – Calaf Aug 16 '19 at 17:56

Answer is an expansion of a comment made by John Kormylo.

  1. To avoid getting the message "this does not look like a TDS; are you sure...", extract xcolor.zip into <dir>/tex/latex rather than just to <dir>/.
  2. cd to <dir>/tex/latex and pdflatex xcolor.ins to generate xcolor.sty.
  3. Using the MikTeX console to Settings->Directories, add the directory <dir> containing your sty file.
  4. Use Tasks->Refresh file name database.

One problem with manual installation of packages (where "manual" is defined as downloading a .zip file from CTAN and inserting it by hand into a TeX installation) is that it's also necessary to handle recursive dependencies.

For example, xcolor depends on the package mptopdf.

To find out the dependencies, after the steps above, run pdflatex usexcolor on a usexcolor.tex file containing


which will give you:

The required file "tex/context/base/mkii/supp-pdf.mkii" is missing.
It is part of the following package: mptopdf.

and that will mean that you need to repeat the steps above for mptopdf.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.