# Installing new packages from ctan through command line or AUCTeX on Mac OS?

I've needed a few new packages for some macros to draw diagrams that I'm working with.

I've heard that some LaTeX editors can automatically download the correct packages from CTAN when they're not found when attempting to compile a `tex` file.

I.e. when I put in `\usepackage{xiften}`, for example, and then (I'm sure this is the wrong way, I've only been using auctex for a couple of days) do `M-x compile` with command `pdflatex file.tex`, and it gives the error `xifthen.sty not found`, it would go to ctan and find `xifthen.sty` and download it, then after that when `ifmtarg.sty` (a dependency) was not found, it would fetch that, etc.

Can AUCTeX do anything like this? If not, is there a simple way to install packages via the command line? The equivalent of a package manager, or something?

-

## 1 Answer

If you are using a TeX Live based distribution, such as MacTeX, I am aware of no "on-the-fly" installation of packages. This is a feature of the Windows-based MikTeX distribution.

ACUTeX may provide some functionality to remedy this- those emacs users are crafty. However I cannot speak authoritatively on the subject as I don't use emacs.

TeX Live does indeed have a package manager though- the command you want is `tlmgr --help` for general usage notes and `tlmgr install <pkgname>` to install a package. You may also want to check out the TeX Live Utility which provides a nice GUI for `tlmgr` on OS X.

-
Sharpie is right: this is something that MiKTeX can do, and is nothing to do with your editor. –  Joseph Wright Aug 17 '10 at 5:44