1. 安装

1.1 安装 TeXLive

1.1.1 从软件源安装

在终端执行以下代码,安装 TeXLive 环境:

1
2
sudo pacman -S texlive-most
sudo pacman -S texlive-lang

【注】这样安装 TeXLive 后无法在终端使用 texdoc 工具,会报错:texdoc error: No texlive.tlpdb nor shipped tlpdb data found.

1.1.2 从安装包安装

如果想要使用 texdoc 等其他工具,最好的办法还是到官网下载安装包进行在本地安装(在线安装包下载地址、离线安装包下载地址)。下面以本人安装为例:

1
2
cd install-tl-20200411
sudo ./install-tl

安装完后,会提示需要添加路径:

1
2
3
4
Add /usr/local/texlive/2020/texmf-dist/doc/man to MANPATH.
Add /usr/local/texlive/2020/texmf-dist/doc/info to INFOPATH.
Most importantly, add /usr/local/texlive/2020/bin/x86_64-linux
to your PATH for current and future sessions.

首先编辑 /etc/profile 文件:

1
sudo vim /etc/profile

然后刷新使之生效:

1
source /etc/profile

此时就安装好 TeXLive 了,并且可以在终端使用 texdoc 工具。

【注】更多 TeXLive 安装详情可参阅 ArchWiki

1.2 安装 TeXStudio

在终端直接从软件源安装即可:

1
sudo pacman -S texstudio

1.3 配置 TeXStudio

本人使用 XeTeX 作为 LaTeX 的编译引擎,故安装好 TeXStudio 后,需要将默认编译器配置成 XeLaTeX:【选项(options)】-> 【配置TeXStudio(configure TeXStudio)】

2. 管理

TeXLive 提供了 TeX 宏包管理器 tlmgr,可以用来安装、删除、更新宏包,具体使用参见:

1
tlmgr --help

3. 文档

【注】使用LaTeX写作过程中,若想查看某一宏包(XXX)的官方手册,可以在终端使用 texdoc 命令:

1
texdoc XXX