With special emphasis on installing only the needful things.
MacTeX or MikTex or TexLive or whatever waste your hard disk space if you install the whole gigantic thing. 5Gb for a 1980s typesetting system is cheeky, especially from people who delight in claiming that Microsoft Word is over-engineered, and that they are keeping it serious with their svelte, elegant, professional alternative. But LaTeX is not “serious typesetting”, except in the sense that driving a panzer to work is “serious commuting”. (In this communiting metaphor, Microsoft Word is some kind of polka-dotted clown car, as far as mathematics is concerned.)
Alternatively I could still use most of the LaTeX markup to typset my mathematics but not for everything else; this is the LaTeX-free mathematics option.
For all the options, I will need to think additionally too hard about fonts.
However! You can install only what you need using a so-called “minimalist” distribution. (Which is still hundreds of megabytes, but we are going to have to take what breaks we can here.)
A gotcha for this method is that it only works for one year, then you must start over. Then I get cut off from updates, and have to do a tedious procedure to get another year’s life out of TeX. You can avoid this with the monumental maximalist TeXes not because they do not suffer from this problem, but because they install so much stuff all at once that you never notice it is broken when you have to install something missing, so you can labour on for years without caring.
A generic way of doing this on macOS is to install basictex, the minimalist version of TeXLive.
On macOS at least, this command installed minimal TeX.
brew cask install basictex
On linux, the default TeXLive installation via homebrew is minimalist.
brew cask install texlive
You install things via
tlmgr as usual
It includes build helpers, e.g.
MikTeX is inimalist per default.
Distro package maanger
One can install the
tex-full or similarly-named distribution package,
which is maximalist but fairly well tested.
All this TeX wrangling seems depressing and time-wasting. You can side-step some details by running containerized TeX, and just ignore a lot of the nonsense. (Not the hard disk space wastage and bloat; that is kind of built-in.) blang/latex-docker is one set of such dockerfiles with a good reputation. There are some newer ones, e.g. schickling/latex, about which I know yet less.
Installing TeX packages
Ok, so if I have installed a possibly minimal TeX, I install things as needed,
using the TeX package management system
For example, to render jupyter notebooks, I found I needed:
tlmgr install \ adjustbox \ collectbox \ collection-fontsrecommended \ enumitem \ logreq \ ucs \ xstring
There are more examples of dependency sets below.
In addition to the basic system install, on Debian/Ubuntu distro install I needed set it up via:
and possibly also:
sudo apt install xzdec
When I am not sure precisely which TwX package I need but I do know the name of a file
which is missing, e.g.
times.sty, the following command will find me candidates.
tlmgr search --global --file "/times.sty"
Weird errors can arise in this manual method. When I got
sudo fmtutil --all
sudo fmtutil-sys --all
I keep the installation up to date using the following incantation:
tlmgr update --self --all tlmgr path add fmtutil-sys --all
Alone amongst all the packages I have tried,
biber, the biblatex executable,
seems to want special care, and its symlink is not correctly created by
tlmgr install biber ln -s ~/.TinyTeX/bin/x86_64-linux/biber ~/bin/ # linux ln -s ~/Library/TinyTeX/bin/x86_64-darwin/biber /usr/local/bin/ # macos
Example minimalist TeX dependencies
To handle fancier jupyter notebook via
ipypublish, we also need
tlmgr install \ latexmk \ translations
To handle biblatex:
tlmgr install biblatex
To handle modern referencing:
tlmgr install placeins \ todonotes \ chngcntr \ doi \ mdframed \ needspace \ cleveref
tlmgr install amsfonts \ amsmath \ lm \ unicode-math \ ifxetex \ ifluatex \ listings \ # (if the --listings option is used) fancyvrb \ longtable \ booktabs \ graphicx \ grffile \ xstring \ logreq \ biblatex \ # if biblatex is used biber \ # if biber is used fontspec \ # if xelatex or luatex polyglossia \ # if xelatex xecjk \ # if xelatex bidi # if xelatex
To handle Anki flashcard rendering:
tlmgr install bbm-macros \ dvipng
To handle latex_fragment:
tlmgr install standalone \ preview
tlmgr install epstopdf
To handle Tom Pollard’s markdown thesis:
tlmgr install truncate \ tocloft \ wallpaper \ morefloats \ sectsty \ siunitx \ threeparttable \ l3packages \ l3kernel \ l3experimental
To format orcid references:
tlmgr install academicons
For my thesis
tlmgr install \ setspace \ jknapltx \ realscripts \ xltxtra \ fancyhdr \ fancyvrb \ pdfpages \ algorithms \ biblatex \ biber \ appendices \ glossaries \ textcase \ mfirstuc \ xfor \ datatool \ rsfs
See LaTeX fonts.
The default option of
tlmgr option repository http://mirror.ctan.org/systems/texlive/tlnet
does not work in Australia because it will try to download from some hapless server in Indonesia.
Here we must
tlmgr option repository http://mirror.aarnet.edu.au/pub/CTAN/systems/texlive/tlnet