Termux Emacs 导出PDF

Termux Emacs 导出PDF

Termux TeX Live 安装流程(带注释版)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# ================================
# TeX Live 安装(Termux 版本)
# ================================

# 1. 先卸载旧版本(避免半残冲突)
pkg uninstall -y texlive-bin texlive-installer

# 2. 清理 TeX Live 全局安装目录(非常关键)
#    防止旧版本 texmf / format 干扰新安装
rm -rf $PREFIX/share/texlive

# 3. 清理用户级 TeX Live 配置缓存
rm -rf $HOME/.texlive*
rm -rf $HOME/.texlive

# 4. (可选)清理 tlmgr / texmf 缓存目录
#     防止旧数据库污染新安装
rm -rf $PREFIX/var/lib/texmf
rm -rf $PREFIX/var/cache/texlive

# 5. 重新安装基础 TeX Live 包
pkg install -y texlive-bin texlive-installer

# ================================
# 初始化 TeX Live(关键步骤)
# ================================

# 注意:Termux 正确初始化命令是 termux-install-tl
# texlive-install(不存在)
# tlmgr(未初始化时不可用)

# 推荐根据提示安装
termux-install-tl

# ================================
# 验证安装是否成功
# ================================

# 检查 XeLaTeX 是否可用
xelatex --version

# 检查 pdfLaTeX 是否可用
pdflatex --version

termux测试命令行执行emacs导出pdf文件的命令

使用配置: https://gitee.com/emacsd/emacs.d.git

使用方式: mv ~/.emacs.d; git clone https://gitee.com/emacsd/emacs.d.git ~/.emacs.d

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# 创建一个org文件
echo "1" > test.org

# 加载early-init.el、init.el,根据自己的配置文件进行指定
emacs --batch \
  --load ~/.emacs.d/early-init.el \
  --load ~/.emacs.d/init.el \
  --visit test.org \
  --eval "(progn
            (require 'ox-latex)
            (org-latex-export-to-pdf))"

# 打印内容
<<'CONTENT'
Loading /data/data/com.termux/files/home/.emacs.d/chemacs2/init.el (source)...
Emacs version: 30.2, using https protocol for package archives

Running in terminal mode

[yas] Prepared just-in-time loading of snippets (but no snippets found).
Processing LaTeX file test.tex...
PDF file produced.
Warning (amx): Not saving amx state from "emacs -Q".
CONTENT