I'm new to LaTeX, investigating using it for some work projects. I'm using MiKTeX on Windows. My employer's locked-down network blocks the application's automatic installation function. I can take my laptop home and successfully install from there, but if I need a package in the middle of the day I'm stuck.

I am able to access the CTAN website and download the package files (.dtx or .ins?), but I don't know what do do with them. How can I do a manual package installation?

link|improve this question
feedback

3 Answers

up vote 34 down vote accepted

Firstly, check README files, available documentation of the package, perhaps the beginning of the .dtx file to get installation information.

Installing a package available as dtx/ins bundle:

  • Download the content of the package directory. dtx is the extension of a documented source file, ins is the extension of an installation file.

  • Run LaTeX (or TeX) on the .ins file. This may be done using your editor or at the command prompt (latex packagename.ins). This would usually produce one or more files ending with .sty, perhaps some additional files. As you now have cls or sty files or the like, the remaining steps are the same like in the next alternative way:

Installing sty or cls files:

  • Create a new directory with the package name in your tex directory structure. With MiKTeX that directory might be C:\Program Files\MiKTeX 2.8\texmf\tex\latex\packagename\.

  • Copy the package files (*.sty, *.cls etc.) into this directory.

  • Make the new package known to MiKTeX: refresh the MiKTeX filename database. To do this, click Start/ Programs/ MiKTeX 2.8/ Maintenance/ Settings (or similar) to get to the MiKTeX options, click the button "Refresh FNDB". The installation is complete.

  • If you did not download the documentation already, you could get it by running pdfLaTeX or LaTeX on the .dtx file. Compile twice to get correct references.

Obtaining and installing packaged universal archives:

Perhaps you could get a file with the extension .tds.zip. Such files are archives fitting to your TeX directory structure. Open it, check the content structure. You could extract it to the right place. Also here, as after any installation, refresh the MiKTeX filename database.

Links with further information:

A different and very effective way, using a local repository:

  • Use the MiKTeX net installer to download the complete MiKTeX repository to a USB drive.

  • On a MiKTeX system, choose this directory as the local package repository in the package manager.

  • Use this local repository for installation and updates.

  • You may update that local repository later using the net installer: it loads the database from the server, compares and downloads new or updated packages.

link|improve this answer
this looks like a great answer! I'm not ready to call it "answered" as I haven't been able to successfully follow the process yet. I'd been able to get all the packages I'm immediately needing from home. Semi-randomly choosing other packages to install leads to dependencies on other missing packages that seems like a goose chase. Some packages, like "epsf", seem to come directly with .sty files instead of .ins. I'm assuming I just copy those in place? It doesn't seem to be recognized as installed... – mbmcavoy Aug 23 '10 at 18:08
Copying .sty files would be sufficient. To get them recognized click "Refresh FNDB" or run mktexlsr or texhash at the command prompt. I'm not sure if the package manager shows them afterwards as installed but TeX would know about them. – Stefan Kottwitz Aug 23 '10 at 18:14
5  
If you put packages in the main tree C:\Program Files\MiKTeX 2.8\texmf\tex\latex\packagename you must update the FNDB in admin mode if you have a multiuser setup. But my advice is to use the trees UserData, CommonData or even better a dedicated local tree for such additions. Packages in the main tree could get lost if one update to miktex 2.9. while one can easily attach a local tree to a new miktex version. The package manager will never show packages installed manually. And the update manager will ignore them too. – Ulrike Fischer Aug 29 '10 at 17:22
Stefan: If you have some time, please update your answer to MikTeX 2.9 and maybe integrate @Ulrikes comments about a local tree (this is also suggested in the first of your links). – Caramdir Jun 3 '11 at 5:04
See my answer here tex.stackexchange.com/questions/1137/… – xport Jun 6 '11 at 22:28
show 2 more comments
feedback

You can set up a local packages repository on your computer.

You need an internet access to download the MikTex packages.

My problem is that I can't succeed in setting up the internet proxy setup of MikTex in my system, so I have tried today the following solution with MikTex 2.9 and it worked with no problems; the on-the-fly package installation worked well too.

  1. Create the folder, for example c:\miktex_pkgs
  2. Copy the following file to the folder c:\miktex_pkgs (If you do not copy the files you will probably get some errors from MikTex. See http://bruceyf.wordpress.com/2008/05/07/miktexs-secret-local-package-repository/ for the details):

    http://mirrors.ctan.org/systems/win32/miktex/tm/packages/README.TXT

    http://mirrors.ctan.org/systems/win32/miktex/tm/packages/miktex-zzdb1-2.9.tar.lzma

    http://mirrors.ctan.org/systems/win32/miktex/tm/packages/miktex-zzdb2-2.9.tar.lzma

  3. You can copy any packages you may need from http://www.ctan.org/tex-archive/systems/win32/miktex/tm/packages to your local folder c:\miktex_pkgs

  4. Update your MikTex system: from the Windows Start menu -> Programs -> Miktex 2.9 -> Maintenance (Admin) -> launch the program "Settings (Admin)"

  5. Go to the tab "Package repository" and choose the folder c:\miktex_pkgs

link|improve this answer
1  
This task is simplified by the »MiKTeX Net Installer«. It lets you download a complete MiKTeX System to a folder of your choice (including the database files). You can also keep this folder up to date by the installer and use it for updates to the system. – Thorsten Donig Apr 19 '11 at 18:30
Thank you. My access to internet is via a proxy, have you ever try the "MiKTeX Net Installer" with a proxy? – uvts_cvs Apr 19 '11 at 18:36
No. So you have to try on your own. But you can determine the connection settings and insert a proxy. – Thorsten Donig Apr 20 '11 at 8:25
feedback

For MikTex Version 2.9 onwards
-Open Package Manager from Start Menu\MikTex 2.9\Mantanence
-Select a package you want to install right click and dowanload, thats it.

link|improve this answer
While this is a guideline how to install a package in general, I don't think it explains how to install one manually, the way mbmcavoy described it in the question. Will the package manager work without Internet access? Afaik, no; but if it does, please do explain how. This would be a most interesting solution. – doncherry Nov 15 '11 at 17:44
feedback

Your Answer

 
or
required, but never shown

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