如何使用 Termux Android 编译 tex 文件

如何使用 Termux Android 编译 tex 文件

(这个问题接下来是在Android上安装Latex

我使用 Termux Android 安装了 texlive 包。使用 VerbTex 我在本地创建了 test.tex 文件。但是当我使用它调用它时。

pdflatex ./test.tex

我没有得到结果。有没有办法使用 Termux 编译 LaTex?

终端记录:

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'!
$

答案1

经过对这个问题评论中的建议进行一些研究后,我能够在 Android 上使用 Termux 编译 .tex 文件。所以我想我可以回答我自己的问题,这样未来的访问者就不会感到任何麻烦。

I can't find file 'dehypht-x-2019-04-04.tex'

此问题是由于缺少 texlive 包 langgerman 造成的。因此运行以下命令:

apt install texlive-langgerman

安装此软件包。但我个人建议您安装“texlive-full”,这样就不会出现与软件包相关的问题。您可以通过在 termux 中运行以下命令来执行此操作。

pkg install texlive-full

现在让我们看看编译部分。首先,运行“pdflatex”。这将给出以下输出。

This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Termux) (preloaded format=pdflatex) restricted \write18 enabled.**

** 之后,您必须指定文件位置和文件名。假设您的 file.tex 保存在内部存储>下载中,那么您可以在 Termux 中运行以下命令

/storage/emulated/0/download/file.tex

那么你的编译就成功了。要打开编译好的文档,你可以阅读以下内容:在Android中打开编译后的文档

根据我的理解,我制作了两个视频来说明如何在 Android 上使用 LaTex。你可以在这里查看。

https://youtu.be/kGz1MGwwcE0

https://youtu.be/tMb_XcinN8U

相关内容