It’s mostly a death by a thousand cuts thing.
MikTeX, which is available for Mac and Linux as well as Windows will do on-demand downloading of packages and is probably my recommendation for a new installation.
A lot of the drawbacks to TeX stem from to trying to meet the combined requirements of computing platforms of the 1970s–1990s. All input files effectively live in a single namespace so you cannot have two input files with the same name (the same applies to coding where you have a single namespace for all your commands as well).
I recall I managed to cut MiKTeX down to about 12MB. Never heard a single complaint about it.
Sounds like someone should just create a wrapper that catches file opens of uninstalled dependencies and automatically downloads them on the fly.
[EDIT: And in fact, if a cousin comment is to be believed, TeX Live also allows this kind of installation! https://news.ycombinator.com/item?id=32535521]
A full install means installing ~4000 packages, including their source files (tens of thousands of tex files) and built documentation (thousands of PDF files) and hundreds of free fonts (otfs, ttfs, texs own format).
This is huge (>7GB, not just the 5 GB claimed here).
However, you don't need 99 % of this for any given document.
Not installing the source files and documentation PDFs will alone reduce the size by roughly half.
Only installing the packages you really need from a minimal installation gives you a few hundred megabytes at most for even complex documents.
It's a bit annoying to get the list of packages needed though, since there is not really any working dependency management.
I wrote a python wrapper around the tex live installer [1] to make this easy for CI jobs, see e.g. [2].
On a side note: I'd recommend luatex over xetex.
- [1] https://github.com/maxnoe/texlive-batch-installation/
- [2] https://github.com/pep-dortmund/toolbox-workshop/blob/8b00f0...