[Tex/LaTex] TeX Live package collection organisation

packagestexlive

This question is closely related to Determining which TeX Live collection a package belongs to, and maybe remotely to What font packages are installed in TeX live?.

I am a bit confused about the organisation of TeX Live packages into "official" collections and about contents of some TeX Live packages. Also, the relation between "packages" that can be used with \usepackage and "packages" in the sense of CTAN is not very clear to me. Moreover, I do not know if packages in CTAN correspond bijectively with packages of TeX Live. (I know however that OS-specific distributions of TeX Live have their own packages.)

  1. I know that TeX Live packages are often organised into collections like collection-latexrecommended, collection-latexextra, collection-science. Does there exist an "official" partition of packages into collections? Can I brows it somewhere? I have found some listing here:

  2. Where can I see which \usepackage-type packages each CTAN package provides, and vice versa, which CTAN package provides a given \usepackage-type package? For example, I am confused about the relation between lmodern LaTeX package, which has an a bit obscure entry in CTAN and lm CTAN package. For example, can lmodern be available without lm being installed? If yes, would Latin Modern font be installed in this case? Conversely, can I have a situation where lm is installed, but either lmodern package or the actual Latin Modern font in unavailable?[^debugging_case]

[^debugging_case]: I am actually debugging a situation where lm TeX Live package must have been installed in NixOS user profile, but Latin Modern font was not available in XeLaTeX in \setmainfont without installing an OS-specific Latin Modern font package.

Best Answer

The confusion here arises from a complete overload of the word package, which can refer to many different things here. Let us try to distinguish most of these packages a bit more, beginning from the smallest unit.

  • Style file: \usepackage{aaa} This is used in LaTeX source code and references one particular .sty file that will be loaded.
  • CTAN package: These are sets of files developed by the same person or group, sometimes containing only one .sty file, sometimes containing many of them and other files (fonts, metrics, data, ...).
  • TeX Live package: This is what you can install in TeX Live with tlmgr that is not called collection-* or scheme-*. These are usually the same as the CTAN packages, with very few exceptions.
  • TeX Live collections: These are groups of TeX Live packages / CTAN packages. The packages are roughly ordered by use and relevance.
  • Distribution packages: Distributions (like Debian, RedHat, and SuSE) often repackage the TeX Live distribution into their own format and units. Debian creates one Debian package for each collection in TeX Live. Other distributions do it differently.

You asked what are the official places to check. That is not easy:

  • Style files: There is no easy way, since there are too many of them, and many are not used directly with \usepackage. The only way is to check the list of files available. In TeX Live you can do that with tlmgr search --file .sty, which will give you a long list of CTAN/TeX Live package names and contained style files (BTW, currently 4509 files).
  • CTAN package: CTAN itself has extensive search and browsing options.
  • TeX Live package: The authoritative source of packages in TeX Live is best found in the list of tlpsrc files in the subversion repository. However, this will not help you much, because there are no descriptions or files contained. You can again use tlmgr info which will list all packages, including whether they are installed or not, and the short description. You also mentioned http://mirror.ctan.org/systems/texlive/tlnet/tlpkg/texlive.tlpdb, which is definitely fine and readable, but tlmgr might be more comfortable to query this data.
  • TeX Live collections: see above, or use tlmgr info collections
  • Distribution packages: every distribution has its own info pages

To go through your example of lm versus lmodern.sty, you could do the following.

Use tlmgr to find which package provides lmodern.sty:

$ tlmgr search --file lmodern.sty
lm:
      texmf-dist/tex/latex/lm/lmodern.sty

Then use tlmgr info to get more details:

tlmgr info lm
package:     lm
category:    Package
shortdesc:   Latin modern fonts in outline formats
longdesc:    The Latin Modern family of fonts consists of 72 text fonts and 20 mathematics fonts, and is based on the Computer Modern fonts released into public domain by AMS (copyright (c) 1997 AMS). The lm font set contains a lot of additional characters, mainly accented ones, but not exclusively. There is one set of fonts, available both in Adobe Type 1 format (*.pfb) and in OpenType format (*.otf). There are five sets of TeX Font Metric files, corresponding to: Cork encoding (cork-*.tfm); QX encoding (qx- *.tfm); TeX'n'ANSI aka LY1 encoding (texnansi-*.tfm); T5 (Vietnamese) encoding (t5-*.tfm); and Text Companion for EC fonts aka TS1 (ts1-*.tfm).
installed:   Yes
revision:    28119
sizes:       src: 4817k, doc: 2629k, run: 42581k
relocatable: No
cat-version: 2.004
cat-date:    2015-08-03 05:43:12 +0200
cat-license: gfsl
cat-topics:  font font-proportional font-mono font-type1 font-otf font-cm
collection:  collection-fontsrecommended

If you want to see all files contained in lm, just add --list to the above invocation and it will give you all contained files.

Finally, you can also browse the lm package by going to https://ctan.org/pkg/lm, where you can confirm that the respective TeX Live package name is lm ("Con­tained in TEX Live as lm").