# 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?

-