DormanResearch : InstallLaTexPackage?

Referers: LatexHints :: (Remote :: Orphans :: Tree )

Dorman Wiki
Dorman Lab Wiki

0Installing LaTeX Packages by Hand external link

The reason this process has not been automated widely is that there are still thousands of installations which do not conform to the TDS, such as old shared Unix systems and some Microsoft Windows systems, so there is no way for an installation program to guess where to put the files: you have to know this. There are also systems where the owner, user, or installer has chosen not to follow the recommended TDS directory structure, or is unable to do so for political or security reasons (such as a shared system where she cannot write to a protected directory).  The reason for having the texmf-local directory (called texmf.local on some systems) is to provide a place for local modifications or personal updates, especially if you are a user on a shared or managed system (Unix, Linux, VMS, Windows NT/2000/XP, etc.) where you may not have write-access to the main TEX installation directory tree. You can also have a personal texmf subdirectory in your own login directory. Your installation must be configured to look in these directories first, however, so that any updates to standard packages will be found there before the superseded copies in the main texmf tree. All modern TEX installations should do this anyway, but if not, you can edit texmf/web2c/texmf.cnf yourself.

0Downloading and installing packages

Once you have identified a package you need and haven't already got (or you have got it and need to update it), use the indexes on any CTAN server to find the package you need and the directory where it can be downloaded from.

0Downloading packages

What you need to look for is always two files, one ending in .dtx and the other in .ins. The first is a DOCTEX file, which combines the package program and its documentation in a single file. The second is the installation routine (much smaller). You must always download both files.

If the two files are not there, it means one of two things:

Download both files to a temporary directory. If you use Windows, keep a folder like C:\\tmp or C:\\temp for this; Mac and Linux systems already have a /tmp directory.

0Installing a package

There are four steps to installing a LATEX package:

File Type Directory (under texmf-local/) Description
.cls tex/latex/base Document class file
.sty tex/latex/packagename Style file: the normal package content
.bst bibtex/bst/packagename BIBTEX style
.mf fonts/source/public/typeface METAFONT outline
.fd tex/latex/mfnfss Font Definition files for METAFONT fonts
.fd tex/latex/psnfss Font Definition files for PostScript? Type 1 fonts
.pfb /fonts/type1/foundry/typeface PostScript? Type 1 outline
.afm /fonts/afm/foundry/typeface Adobe Font Metrics for Type 1 fonts
.tfm /fonts/tfm/foundry/typeface TEX Font Metrics for METAFONT and Type 1 fonts
.vf /fonts/vf/foundry/typeface TEX virtual fonts
.dvi /doc package documentation
.pdf /doc package documentation
others tex/latex/packagename other types of file unless instructed otherwise

0Replicating the TDS

The TEX Directory Structure (TDS) is documented at external link. I find it useful to make the directory structure of texmf-local the same as that of texmf. Examine the subdirectories of texmf/tex/latex/ for examples. For updates of packages which came with your LATEX distribution (as distinct from new ones you are adding yourself), you can then use the same subdirectory name and position in texmf-local/ as the original used in texmf/

If you want to create the entire subdirectory structure ready for use, you can do it under Unix with the following commands:

cd /usr/TeX/texmf
find . -type d -exec mkdir -p /usr/TeX/texmf-local/{} \;
If you are using Microsoft Windows, you can download Cygwin, which provides you with the standard Unix tools in a shell window. The above command should also work on a Mac running OS X. In all cases, if your installation directory is not /usr/TeX, you need to substitute the actual paths to your texmf and texmf-local directories.
There is no comment on this page. [Display comments/form]