[Tex/LaTex] How to compile tex file using Termux Android

androidtexlive

(This question is followed by Installing Latex on Android)

I installed texlive package using Termux Android. Using VerbTex I created test.tex file locally. But when I called it using.

pdflatex ./test.tex

I didn't get the result. Is there any way to compile LaTex using Termux?

Terminal Transcript:

Welcome to Termux!

Wiki:            https://wiki.termux.com
Community forum: https://termux.com/community
Gitter chat:     https://gitter.im/termux/termux
IRC channel:     #termux on freenode

Working with packages:

 * Search packages:   pkg search <query>
 * Install a package: pkg install <package>
 * Upgrade packages:  pkg upgrade

Subscribing to additional repositories:

 * Root:     pkg install root-repo
 * Unstable: pkg install unstable-repo
 * X11:      pkg install x11-repo

Report issues at https://termux.com/issues

$ pdflatex \storage\Download\test.tex
This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX L
ive 2019/Termux) (preloaded format=pdflatex)
 restricted \write18 enabled.

kpathsea: Running mktexfmt pdflatex.fmt
mktexfmt: mktexfmt is using the following fmtutil.cnf
 files (in precedence order):
mktexfmt:   /data/data/com.termux/files/usr/share/tex
live/texmf-dist/web2c/fmtutil.cnf
mktexfmt: mktexfmt is using the following fmtutil.cnf
 file for writing changes:
mktexfmt:   /data/data/com.termux/files/home/.texlive
2019/texmf-config/web2c/fmtutil.cnf
mktexfmt [INFO]: writing formats under /data/data/com
.termux/files/home/.texlive2019/texmf-var/web2c
mktexfmt [INFO]: --- remaking pdflatex with pdftex
mktexfmt: running `pdftex -ini   -jobname=pdflatex -p
rogname=pdflatex -translate-file=cp227.tcx *pdflatex.
ini' ...
This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX L
ive 2019/Termux) (INITEX)
 restricted \write18 enabled.
 (/data/data/com.termux/files/usr/share/texlive/texmf
-dist/web2c/cp227.tcx)
entering extended mode

(/data/data/com.termux/files/usr/share/texlive/texmf-
dist/tex/latex/latexconfig/pdflatex.ini
(/data/data/com.termux/files/usr/share/texlive/texmf-
dist/tex/generic/tex-ini-files/pdftexconfig.tex)

(/data/data/com.termux/files/usr/share/texlive/texmf-
dist/tex/latex/base/latex.ltx
(/data/data/com.termux/files/usr/share/texlive/texmf-
dist/tex/latex/base/texsys.cfg)
./texsys.aux found


\@currdir set to: ./.


Assuming \openin and \input
have the same search path.


Defining UNIX/DOS style filename parser.

catcodes, registers, parameters, LaTeX2e <2018-12-01>
hacks, control, par, spacing, files, font encodings, 
lengths,
====================================

Local config file fonttext.cfg used

====================================

(/data/data/com.termux/files/usr/share/texlive/texmf-
dist/tex/latex/base/fonttext.cfg
(/data/data/com.termux/files/usr/share/texlive/texmf-
dist/tex/latex/base/fonttext.ltx
=== Don't modify this file, use a .cfg file instead =
==


(/data/data/com.termux/files/usr/share/texlive/texmf-
dist/tex/latex/base/omlenc.def)
(/data/data/com.termux/files/usr/share/texlive/texmf-
dist/tex/latex/base/t1enc.def)
(/data/data/com.termux/files/usr/share/texlive/texmf-
dist/tex/latex/base/ot1enc.def)
(/data/data/com.termux/files/usr/share/texlive/texmf-
dist/tex/latex/base/omsenc.def)
(/data/data/com.termux/files/usr/share/texlive/texmf-
dist/tex/latex/base/t1cmr.fd)
(/data/data/com.termux/files/usr/share/texlive/texmf-
dist/tex/latex/base/ot1cmr.fd)
(/data/data/com.termux/files/usr/share/texlive/texmf-
dist/tex/latex/base/ot1cmss.fd)
(/data/data/com.termux/files/usr/share/texlive/texmf-
dist/tex/latex/base/ot1cmtt.fd)))
====================================

Local config file fontmath.cfg used

====================================

(/data/data/com.termux/files/usr/share/texlive/texmf-
dist/tex/latex/base/fontmath.cfg
(/data/data/com.termux/files/usr/share/texlive/texmf-
dist/tex/latex/base/fontmath.ltx
=== Don't modify this file, use a .cfg file instead =
==


(/data/data/com.termux/files/usr/share/texlive/texmf-
dist/tex/latex/base/omlcmm.fd)
(/data/data/com.termux/files/usr/share/texlive/texmf-
dist/tex/latex/base/omscmsy.fd)
(/data/data/com.termux/files/usr/share/texlive/texmf-
dist/tex/latex/base/omxcmex.fd)
(/data/data/com.termux/files/usr/share/texlive/texmf-
dist/tex/latex/base/ucmr.fd)))
====================================

Local config file preload.cfg used

=====================================

(/data/data/com.termux/files/usr/share/texlive/texmf-
dist/tex/latex/base/preload.cfg
(/data/data/com.termux/files/usr/share/texlive/texmf-
dist/tex/latex/base/preload.ltx)) page nos., x-ref, environments, center, verbatim, math definitions,
boxes, title, sectioning, contents, floats, footnotes
, index, bibliography, output,
===========================================
Local configuration file hyphen.cfg used
===========================================

(/data/data/com.termux/files/usr/share/texlive/texmf-
dist/tex/generic/babel/hyphen.cfg
(/data/data/com.termux/files/usr/share/texlive/texmf-
dist/tex/generic/babel/switch.def)
(/data/data/com.termux/files/usr/share/texlive/texmf-
dist/tex/generic/hyphen/hyphen.tex)
(/data/data/com.termux/files/usr/share/texlive/texmf-
dist/tex/generic/hyphen/dumyhyph.tex)
(/data/data/com.termux/files/usr/share/texlive/texmf-
dist/tex/generic/hyphen/zerohyph.tex)
! I can't find file `dehypht-x-2019-04-04.tex'.
<to be read again>
                   \relax
l.172   \repeat

(Press Enter to retry, or Control-D to exit)
Please type another input file name:
! Emergency stop.
<to be read again>
                   \relax
l.172   \repeat

!  ==> Fatal error occurred, no output PDF file produ
ced!
Transcript written on pdflatex.log.
mktexfmt [ERROR]: running `pdftex -ini   -jobname=pdf
latex -progname=pdflatex -translate-file=cp227.tcx *p
dflatex.ini >&2 </dev/null' return status 1
mktexfmt [ERROR]: return error due to options --strict
mktexfmt [INFO]: Disabled formats: 17
mktexfmt [INFO]: Not selected formats: 33
mktexfmt [INFO]: Failed to build: 1 (pdftex/pdflatex)
mktexfmt [INFO]: Total formats: 51
mktexfmt [INFO]: exiting with status 1
I can't find the format file `pdflatex.fmt'!
$

Best Answer

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.

https://youtu.be/kGz1MGwwcE0

https://youtu.be/tMb_XcinN8U