In honor of the release of Debian 13 Trixie I've treated myself to a fresh install of Debian. In the spirit of minimalism I've started with a completely bare base-system, opting to skip all graphical desktops for my initial install. I enjoy the process of starting with essentially a Linux server and only installing packages as I actually need them. Doing this highlights the applications I rely on, and in turn the software those apps rely on. In other words dependencies.
Now I'll admit this is mostly a fun exercise that appeals to my brain in particular. For the most part extra software is not a big issue, and it is better to have a working computer than a few less bytes on a hard drive. I just find a minimal setup satisfying. At one point I was an Arch Linux user, it is what it is.
The tradeoffs of software minimalism were highlighted for me when I
installed mpd
(Music Player Daemon). mpd
has a lot of
dependencies and a few that I found unnecessary. I will likely never
need to play Commodore 64 music files (libsidplayfp6
), but that is
also what makes mpd
great. It is a flexible tool you can throw
anything at. Still I was a little more annoyed to see JavaScript
libraries installed just to show the documentation pages (Sphinx).
If I was a python programmer I likely would have never noticed because
Sphinx is a dependency for nearly every *python-doc
package. For me
though mpd
is the only package that requires these dependencies.
It's just a few extra bytes, I can live with it. Perhaps someday I'll
be in the woods completely offline and need to consult a local copy of
the mpd
docs. In that moment I'll be so thankful. I might not even
consider that Sphinx definitely has export options that does not
require JavaScript libraries.
Of course this is not a real deal breaker. I could build mpd
myself, or build a custom deb package. I could switch back to Arch
Linux. Better yet I could switch to Gentoo and spend all my days
compiling packages. No, I use Debian because I like Debian. I like
the philosophy, stability, and cooperative spirit of the project.
Debian maintainers are making sane choices that makes stuff work with
reasonable defaults that supports a huge range of use cases.
With all that in mind, lets talk about LaTeX.
Installing LaTeX on Debian
To build LaTeX documents we need to install the TeX Live distribution.
A full install of the texlive
packages is huge and includes
thousands of TeX packages. Majority of which I will never use and
don't want to install. The problem is to compile Org-mode documents
we need several packages that are only included in the extensive
texlive-latex-extra
and texlive-pictures
packages.
Installing LaTeX the Normal Way
sudo apt install texlive texlive-latex-extra texlive-pictures texlive-science
You can see the list of TeX packages each of these installs in the
package descriptions. Run apt info
to see the full list. The
texlive-latex-extra
lists around 1,500 packages. I need ~3.
apt info texlive-latex-extra
Manual TeX Live Install
If you really want a minimal install the best option would be to
just manually install texlive and the packages you want. You can do
that by following the instructions on tug.org/texlive/, That is
probably the right way to circumvent installing every Debian texlive
package. Once installed you'll be able to manage your whole texlive
install with the included package manager tlmgr
(TeX Live Manager).
Mixed Install with apt
and tlmgr
The method I used was a little more chaotic. I installed the base
texlive system via apt
. This gives us all the critical stuff for
building basic documents (pdflatex, tlmgr) with minimal effort.
apt install texlive
After that I go to my documents and start trying to build them. Even
for a basic Org to LaTeX document there are several TeX packages that
will be missing. The compile warning will call out the missing
package *.sty
and then I can install it with tlmgr
.
ERROR: LaTeX Error: File `wrapfig.sty' not found. --- TeX said --- ./test.tex:9: ==> Fatal error occurred, no output PDF file produced!
On Debian the texlive package manager tlmgr
is included with the
base texlive
install. The Debian maintainers have explicitly
recommend not to use this tool1, because it may install TeX
packages are incompatible with the deb package versions. So please
do this at your own risk and do NOT pester Debian volunteers if
your TeX install breaks!
One benefit of this mixed setup is the tlmgr
tool is forced into
--user
mode. This means all packages are installed locally in your
home directory. For my use case that is perfect. If something breaks
I can always delete the directory and fall back to an apt
install.
By default packages are stored in ~/texmf/
, and can be changed by
setting the TEXMFHOME
environment variable. In my ~/.bashrc
I
have this set:
export TEXMFHOME=$HOME/.config/texlive/
Then initialize our tlmgr
folder with:
source ~/.bashrc # Ensure your $TEXMFHOME is set echo $TEXMFHOME tlmgr init-usertree
Now we can install the couple missing dependences needed for Org LaTeX
export via tlmgr
. Once you've installed all the packages reported
in your LaTeX compile errors you should be all set going forward.
tlmgr install warpfig rotating ulem capt-of
Again this is a hack-y solution, but currently I only have ~10 packages manually installed. That is in comparison to the hundreds of packages included in all of texlive. This solution may become more fragile over time as Debian stable drifts further out of date with current TeX Live releases. Although I suspect most popular TeX packages are pretty stable and slow moving.
Footnotes:
See /usr/share/doc/texlive-base/README.tlmgr-on-Debian.md
Comments
Email comment@taingram.org.