TeXLive — on Android
by Willie Wong
I’ve just done something that is, admittedly, rather silly. And I am somewhat surprised that it actually worked.
I managed to have TeXLive running on my new Samsung Galaxy Tab A, which runs Android.
It is painfully slow (speed is comparable to my old netbook from 2010). But in a pinch, I now know that it works. And that gives me some (minor) peace of mind.
What I did
- First, install Termux from the Play Store. (For those of you FOSS-minded, it is also available on F-Droid.) Termux is a terminal emulator with supports from some Linux Packages. (An alternative is to install GNURoot-Debian, but I’d rather not try to maintain a full Debian installation on a tablet, running on top of Android, if I can help it.)
- Next, fire up Termux. It is very helpful to run as your first command
termux-setup-storageto enable certain symlinks and give access to the external SD card if you have one. - To install the most basic of TeXLive, you just need to run
pkg install texlive.
Now, the basic TeXLive distribution is missing a lot of useful packages. You can maintain the TeXLive installation via tlmgr as usual. A few collections that could be good to install are
- collection-fontsrecommended
- collection-latexextras
- collection-mathscience
- collection-bibtexextra
coreutils: Termux by default usebusyboxto emulate most utils; proper versions of standard Unix commands are useful to have.opensshgitneovim: If you need a text editor on the terminal…
If you use additional fonts I would suggest installing them one-by-one (I installed kpfonts as that’s the one I use almost exclusively); fonts take up a lot of storage space and accounts for, on my desktop, 75% of the on-disk size of TeXLive.
My current installation of Termux uses 600MB, and about 80% or more of that is TeXLive.
Here are some additional Termux packages that can be useful to complete your TeX needs:
I installed texlive package based on your description. But it didn’t install an editor to execute .tex file. Can you please explain how to work with those installed packages?
To edit the .tex files, you can use Neovim (the final item listed in the post). https://neovim.io/ To compile the .tex files, you can just run pdflatex/xelatex/luatex or whichever flavor; they should be installed as part of TeXLive. If you are after a GUI editor, then termux is not a good idea; this post assumes you are familiar with working with TeX files on the commandline. If you are not familiar with that, try the Not-so-short guide https://ctan.org/tex-archive/info/lshort/english/?lang=en