I used VerbTeX app in my Android phone. But this app does not support XeLaTeX and requires an internet connection to be used.
Is there any distribution of TeX for Android?
How I can install TeX on my Android phone?
androidinstallingxetex
I used VerbTeX app in my Android phone. But this app does not support XeLaTeX and requires an internet connection to be used.
Is there any distribution of TeX for Android?
How I can install TeX on my Android phone?
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).
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.
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.)
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.
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.
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
.
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.
After some studies as suggested in the comments of this question, I was able to compile .tex file using Termux on Android. So I think I can answer my own question so that future visitors won't feel any trouble.
I can't find file 'dehypht-x-2019-04-04.tex'
This problem is due to the missing of a texlive package langgerman. So run the command,
apt install texlive-langgerman
to install this package. But what I personally suggest you is to install ’texlive-full' so that there will be no issue related to packages. You can do this by running the following command in termux.
pkg install texlive-full
Now let's look at compiling part. First, run ’pdflatex’ . This give the following output.
This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Termux) (preloaded format=pdflatex) restricted \write18 enabled.**
After ** you have to specify the file location and file name. Suppose your file.tex is saved at Internal Storage>Download then you run following command in Termux
/storage/emulated/0/download/file.tex
Then your compiling is successful. To open the compiled document you may read this: Opening compiled document in Android
Based on my understandings I have created two videos to illustrate using LaTex on Android. You can check them here.
Best Answer
Just have a look here: TexPortal. This is an App for Android which runs fine on my Nexus 7 without the need for rooting my device (this was important for me). If you download all the packages you don't need an internet connection to compile the documents. Most of the time I use it just for short letters, but for testing I compiled my diploma and my master thesis with this App without any trouble.