参考:
- 北京理工大学社区论文模板教程
- 谢益辉的安装脚本:https://gist.github.com/yihui/7ae1144e45063c4957e5c1f6f67039f4
- https://tug.ctan.org/info/install-latex-guide-zh-cn/install-latex-guide-zh-cn.pdf
- 主要参考:https://www.cnblogs.com/eslzzyl/p/17358405.html
texlive可以将安装选项保存到一个texlive.profile文件中,安装程序直接读取这个文件进行安装,无需在进行交互。这次使用的是网络安装方式,而非下载iso文件,
./install-tl --profile texlive.profile细化步骤
curl -LO https://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz
tar -zxvf install-tl-unx.tar.gz
cd install-tl-* # 目录具体名称包含日期
# 指定镜像、安装目录、不安装src tree
./install-tl --repository=https://mirrors.shanghaitech.edu.cn/CTAN/systems/texlive/tlnet --texdir=~/.texlive --no-src-install然后进入tui界面,直接按C进入collection选择模式,取消勾选下列选项1
deghijkstuvwxyznoABCEHIKLMNS
按I进行安装。最后一步将可执行文件链接到系统目录可能要提权,安装完后可以执行
# 在系统path中创建软链接,通常是/usr/local/bin
sudo TEXLIVE_INSATLL_PATH/bin/tlmgr path add
tmlgr option showall # 查看相关信息Tips
安装完成后,安装目录~/.texlive中会包含,
- install-tl.log:安装日志,里面包含启动命令,texlive环境变量,及所有安装的宏包信息,非常有用。可以指导下次安装。
- tlpkg/textlive.profile:之前提到的安装配置,如果有这个文件,直接运行
./install-tl -profile texlive.profile即可安装(镜像链接还是要额外指定的),无需进入tui界面。
后续如果有升级,装包,卸载,备份的需求,均可以使用自带的包管理器tlmgr实现。详询
tlmgr --help | less附录
附我的profile,
# texlive.profile written on Thu Mar 19 14:05:24 2026 UTC
# It will NOT be updated and reflects only the
# installation profile at installation time.
selected_scheme scheme-custom
TEXDIR /home/yychi/.texlive
TEXMFCONFIG ~/.texlive2026/texmf-config
TEXMFHOME ~/texmf
TEXMFLOCAL /home/yychi/.texlive/texmf-local
TEXMFSYSCONFIG /home/yychi/.texlive/texmf-config
TEXMFSYSVAR /home/yychi/.texlive/texmf-var
TEXMFVAR ~/.texlive2026/texmf-var
binary_x86_64-linux 1
collection-basic 1
collection-bibtexextra 1
collection-binextra 1
collection-fontsrecommended 1
collection-langchinese 1
collection-langcjk 1
collection-langenglish 1
collection-latex 1
collection-latexrecommended 1
collection-mathscience 1
collection-pictures 1
collection-plaingeneric 1
collection-xetex 1
instopt_adjustpath 1
instopt_adjustrepo 1
instopt_letter 0
instopt_portable 0
instopt_write18_restricted 1
tlpdbopt_autobackup 1
tlpdbopt_backupdir tlpkg/backups
tlpdbopt_create_formats 1
tlpdbopt_desktop_integration 1
tlpdbopt_file_assocs 1
tlpdbopt_generate_updmap 0
tlpdbopt_install_docfiles 0
tlpdbopt_install_srcfiles 0
tlpdbopt_post_code 1
tlpdbopt_sys_bin /usr/local/bin
tlpdbopt_sys_info /usr/local/info
tlpdbopt_sys_man /usr/local/man
tlpdbopt_w32_multi_user 1