[Tex/LaTex] authblk.sty not found on TexShop

authblkmactexpackagestexshop

I have the MacTex basic 2015 installed, and when I open a latex file using the command \usepackage{authblk}, TexShop says authblk.sty not found. I've also tried to change that command to \usepackage{preprint}, but it then says preprint.sty not found. But even when I install the preprint package from CTAN, the folder has no .sty files. Only .ins and .dtx files.

How to solve this problem?

Best Answer

The problem

The Basic TeX distribution installs a limited set of packages, and it is up to you to install other packages manually. The normal way to do this is to use TeX Live Utility, which is not installed with Basic TeX, but can be downloaded here: http://amaxwell.github.io/tlutility/.

However, TeXLive Utility is set up by default to manage only the current year's distribution. This is because of TeX Live's yearly distribution system:

It is possible to use TeX Live Utility to add packages to an older distribution, but it requires changing the repository, and I would not recommend it unless you are sure of what you are doing. The method for doing so is outlined here (although this solution doesn't use TeX Live utility explicitly.)

Possible solutions

There are a few ways you could go to solve this problem.

  1. Perhaps the simplest solution is to abandon Basic TeX altogether, and install the full TeX Live 2016. This will install everything and you will almost never encounter missing package errors again.

  2. If you are really short on space, you could install Basic TeX 2016. Then you can use TeX Live utility to install missing packages. This is the best route if you feel you must use Basic TeX.

    Notice, however, that another drawback of Basic TeX is that there is no simple way to keep track of packages you have installed, so that when you update to the following year, you will have to reinstall those extra packages. See:

  3. A really quick and dirty solution (which I don't recommend) is to install the package manually from CTAN and place it in your local texmf folder. I don't recommend this for various reasons. First, some packages are distributed as .ins + .dtx documents, which require running TeX on the .ins file to generate the .sty file. So installing is not as simple as just copying the file to your local texmf. But a more serious reason for not doing this for any package that is part of TeX Live, is that the local version you install will always take precedence over a newer version if you update your distribution. This can (and likely will) lead to problems in the future. For more information on installing local packages, see:

I really don't recommend Option 3. So personally I would go for Option 1 which will save you lots of hassle in the future.

Related Question