[Tex/LaTex] How to install TeX Live on Android tablet 4.2.2

androidtexlive

I'm reading this
How to install TeX on Android phones?
post and I can't install TeX Live on Android 4.2.2 and I have tl4a-2013-06-10.tar.xz, TL4A.apk, tl4a-2013-06-18.tar.xz, and texmf.cnf on my tablet.

Best Answer

Now I am installing TeX Live for Android. I began installation 6 months ago; now I can make PDF and DVI of English LaTeX files, but the installation is still incomplete. I have Android 4.2.2 on an unrooted tablet with 16M internal memory. Unknown sources option is unchecked in Security options of tablet, Verify apps is checked (I changed Unknown sources option; AFAIR I disabled it before installation of TeX Live, but I am not sure).

  1. I installed TeXLive for Android from Google Play Store. The installation was not complete. The binaries were not uncompressed (I could see that by verifying the available space on internal storage). As a result of installation of TeXLive for Android, I got Terminal Emulator for Android with necessary libraries ready to installation of TeX.

  2. Installing the binaries: I used tl4a-2013-06-18.tar.xz Now it is available on https://code.google.com/p/texlive-for-android/downloads/ I unpacked the files from tl4a-2013-06-18.tar\bin directory of the archive to /data/data/texlive.androidport/bin directory on the tablet. (To see what directory install binaries to, I verified PATH variable:

    ua_a110@android:/ $ echo $PATH /vendor/bin:/system/bin:/system/xbin:/data/data/texlive.androidport/bin-base:/data/data/texlive.androidport/bin

The other story is how to extract files. I unpacked the archive on Windows PC to SD-card, plugged SD-card into tablet PC, and copied files at bin directory with cat and chmod 500. Probably there is a better way.)

  1. Installing texmf tree. I tried to install the tree onto plugged-in SD-card, but I failed. C. MA suggests installation to /sdcard/texlive , and make changes to texmf.cnf. I installed the texmf tree to ~/texmf, which is one of default directories where tex searches files. I do not remember where I got texmf.cnf file from. Probably from I got it from tetex distribution or from kpathsee distribution. Copy texmf.cnf to /sdcard/texlive The easiest way was to copy texmf tree completely if there is available space. But I copied individual packages, some from texlive, some from CTAN, some from living MikTeX.

  2. Compiling tex formats. I have installed LaTeX from sources. But the easier way is (if texlive tree installed)

    pdftex -ini latex.ltx

and then copy latex.fmt file to a directory where tex searches for format files (maybe to ~/texmf/web2c/ directory?). I copied latex.fmt to ~/formats/ directory.

I did not tried wheter latex.fmt from other tex distribution works.

  1. Creating shortcuts. Verify that you do not have latex and pdflatex files in tex binary directory. Then I created two files latex and pdflatex with in tex binaries directory with following content

    /data/data/texlive.androidport/bin/latex: pdftex -output-format=dvi -fmt=/data/data/texlive.androidport/app_HOME/formats/latex.fmt $*

    /data/data/texlive.androidport/bin/pdflatex: pdftex -output-format=pdf -fmt=/data/data/texlive.androidport/app_HOME/formats/latex.fmt $*

(Each file contains one line, starts with pdftex and ends with $*. Here /data/data/texlive.androidport/bin is tex binary directory, and /data/data/texlive.androidport/app_HOME/formats is a directory where I copied latex.fmt.)

Then I made this two files executable with chmod 500.

  1. TODO Compile formats for METAFONT. Configure dvipdfmx and dvips. I have not done that yet.

I have copied PDF fonts from the other TEX distribution (MiKTeX). Now I can make DVI and PDF files of TEX file without generating new fonts. I can read PDF files with Adobe Reader. I cannot do anything with DVI files because dvipdfm and dvips are not configured yet.

Note that TeXLive for Android package does not contain an editor. But you can use and an editor from another app package. I use Kingsoft Office. One minor disadvantage is that it cannot open files with .tex extension. So I have to rename .tex files to .txt for editing. There are some specialized LaTeX editors in Google Play Store. I hope they can work side-by-side with TeXLive for Android: Author .tex with the editor, and then "convert" it to .pdf with TeXLive for Android, and then view it with your favourite PDF viewer. But I have not tried specialized TeX editors yet.

Related Question