[Tex/LaTex] Adding a CTAN package to a MacPorts-maintained TeX installation

ctaninstallingmacportspackages

I have installed TeXlive through MacPorts and now discover that I am missing some package. For clarity let's use a trivial example and say I am missing lipsum.sty.

I now have two options:

Option 1

I go to a CTAN site, look for lipsum.sty, download it, and install it in ~/Library/texmf/tex.

This is not bad, but it leaves it possible that I will end up with a second lipsum at some point. That's why the second option is desirable.

Option 2

2.1– I find out which MacPorts package includes lipsum.sty

and

2.2– I sudo port install the necessary package.

How do I do 2.1?

Best Answer

Your question is a good one, but reveals one of the fundamental flaws in the way Linux-like (and I include here MacPorts) package management systems work when it comes to TeX distributions. The problem is that packages (in the TeX sense) are qualitatively different from packages in the Linux sense, but the Linux packagers don't seem to recognize the distinction, and so you are left with a situation in which if you use a Linux-based distribution of TeX, you are usually left with no simple way to update the TeX packages.

The qualitative difference between a TeX package and a regular software package is that TeX packages are simple text files which are not compiled and in fact not executable. A regular software package, on the other hand is usually a compiled piece of software or a bunch of scripts. Now of course in a TeX distribution as a whole, there are definitely compiled binaries and scripts, but these are not the pieces that are updated so frequently as TeX packages since, generally they are updated only once a year anyway. But new TeX packages and updates to existing ones happen all the time, and TeXLive (and MikTeX) users have constant access to these updates.

So an ideal Linux-based package would install only the TeX binaries and support software, including tlmgr and then allow tlmgr to deal with the installation of the TeX packages, rather than have the Linux package manager do this. However, for reasons that are not entirely clear to me, this is not the route that Linux based systems have taken (thus leading to many outdated TeX distributions; Ubuntu is a known culprit in this respect.) Since this is not the case, most experienced TeX users install their own version of TeXLive and bypass the package manager; (see How to install "vanilla" TeXLive on Debian or Ubuntu?) similarly Mac users use the MacTeX distribution.

MacPorts does seem to be keeping up-to-date, but unless it recognizes the "TeX-package" vs. "Linux-package" distinction and actually installs tlmgr I don't think there is a way to answer your question 2.2.

There is one possibility, I suppose: install both the MacPorts version and MacTeX and then make sure the TeX packages in /usr/local/texlive are found even if the MacPorts binaries are used.

Related Question