In order for this to work, you need to make sure the TeX binaries are in your path, and that the version you want to run is in your path before any other binaries with the same names. If you install TeX from your OS package manager, it should set this up for you.
However, many distros package an old version of TeX Live, and you might need to install a newer one. In that case, you will need to set up your PATH
for the binaries to work, as well as your MANPATH
and INFOPATH
for the command-line documentation.
To make the TeX live installer work properly, the commands you must add to your login scripts are similar to
PATH=/usr/local/texlive/2021/bin/x86_64-linux:$PATH
export PATH
INFOPATH=/usr/local/texlive/2021/texmf-dist/doc/info:$INFOPATH
export INFOPATH
MANPATH=/usr/local/texlive/2021/texmf-dist/doc/man:$MANPATH
export MANPATH
To enable them for all users, save them to a file, name it something like /etc/profile.d/texlive.sh
, and chmod 755
. To enable them only for your own user account, you would want to save them to ~/.bash_profile
as well as ~/.bashrc
, or to a single file that you source
from both of these. (And if you changed your login shell, you don’t need these instructions.)
I personally set up one more command, a shell alias to update my TeX installation. I have TeX Live installed as the system user tex
, which in theory means that an exploit in TeX Live at least should not get root
.
alias update-tex='sudo -u tex -E $(which tlmgr) update --self --all'
man pdftex
? This is Unix, you know.kpathsea: Running mktexfmt XeLaTeX.fmt I can't find the format file
XeLaTeX.fmt'!` and trying to use man XeLaTeX I gotno manual entry for XeLaTeX
so for people are starting to learn how to use TeX & friends without a GUI, answers to this would be very useful