summaryrefslogtreecommitdiff
path: root/info/install-latex-guide-zh-cn/chapter
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-07-17 03:02:31 +0000
committerNorbert Preining <norbert@preining.info>2020-07-17 03:02:31 +0000
commit4ea983e3d411ade406c09b30ece9139457516b6f (patch)
tree02acddfa7ad11d5bf9449468eb9d9b3cd1f33bc3 /info/install-latex-guide-zh-cn/chapter
parent545097774851316dfcb923ebf87501026949a9b4 (diff)
CTAN sync 202007170302
Diffstat (limited to 'info/install-latex-guide-zh-cn/chapter')
-rw-r--r--info/install-latex-guide-zh-cn/chapter/editor.tex514
-rw-r--r--info/install-latex-guide-zh-cn/chapter/macos.tex130
-rw-r--r--info/install-latex-guide-zh-cn/chapter/overleaf.tex97
-rw-r--r--info/install-latex-guide-zh-cn/chapter/preface.tex48
-rw-r--r--info/install-latex-guide-zh-cn/chapter/ubuntu.tex368
-rw-r--r--info/install-latex-guide-zh-cn/chapter/windows.tex470
-rw-r--r--info/install-latex-guide-zh-cn/chapter/wsl.tex350
7 files changed, 1977 insertions, 0 deletions
diff --git a/info/install-latex-guide-zh-cn/chapter/editor.tex b/info/install-latex-guide-zh-cn/chapter/editor.tex
new file mode 100644
index 0000000000..a44e862056
--- /dev/null
+++ b/info/install-latex-guide-zh-cn/chapter/editor.tex
@@ -0,0 +1,514 @@
+% !TeX root = ../install-latex-guide-zh-cn.tex
+
+\chapter{使用编辑器}
+
+\section{Windows 10 系统}
+
+在实际操作中, 用户会发觉使用记事本编写 \texttt{tex} 文件十分不便,
+因此很多用户都将其他编辑器作为自己的首选.
+这里向大家介绍随 \TeX{} Live 一同发行的轻量级编辑器 \TeX works
+和功能更加丰富的
+\href{http://texstudio.sourceforge.net/}{\TeX studio}
+(github 上有%
+\href{https://github.com/texstudio-org/texstudio}{源码}%
+和%
+\href{https://github.com/texstudio-org/texstudio/releases}{可执行文件}).
+其他编辑器无法一一介绍, 还请自己在网上寻求更多帮助.
+
+\subsection{\TeX works}
+
+\TeX works 是一款轻量级的 \LaTeX 编辑器, 个人认为非常适合入门级用户使用%
+\footnote{很多用户在编写 \texttt{tex} 文件时喜欢借助其他工具,
+这不是个好习惯, 这里鼓励用户多手动敲代码}.
+
+和大多数国产软件不同, \TeX works 不会自动在桌面生成快捷方式,
+新人往往不知道如何打开它.
+实际上 \TeX works 在 \TeX{} Live 安装路径的
+\texttt{\textbackslash bin\textbackslash win32} 中,
+可在 \textsf{cmd} 中执行 \texttt{texworks} 打开,
+也可直接在 Windows 搜索栏里搜 \TeX works 打开.
+
+刚开始使用 \TeX works 的用户不必过多配置,
+在默认状态下打开软件、编写代码、保存文件后,
+用户可使用 \TeX works 的“排版”按钮进行文档编译而不必回到命令行%
+\footnote{实际上编辑器的按钮也是调用命令行来编译文档,
+\TeX works 默认排版快捷键是 \texttt{ctrl + T}}.
+按钮旁边是编译命令菜单, 用户可根据需要自行选择.
+
+下面介绍几个常用的功能.
+
+\subsubsection{显示行号}
+
+打开 \menu{编辑 > 首选项 > 编辑器}, 选择 \menu{行号} 即可.
+
+\subsubsection{调整字体}
+
+\TeX works 有时会擅自更改编辑器所使用的字体,
+很多字体``长相''诡异,
+让用户误以为是乱码.
+用户可在 \menu{编辑 > 首选项 > 编辑器默认配置}
+和 \menu{格式 > 字体} 处进行更改.
+Windows 10 中字体列表见%
+\href{https://docs.microsoft.com/en-us/typography/fonts/windows_10_font_list}{这里}.
+
+\subsubsection{自动补全}
+
+自动补全主要是 \keys{tab} 键的功能,
+使用前需确定 \menu{首选项 > 编辑器} 中是否勾选了 \menu{启动自动补全}.
+有关自动补全的更多内容用户可参考
+\href{https://github.com/EthanDeng/texworks-autocomplete}{\TeX works 的自动补全功能}.
+
+\subsubsection{使用模板}
+
+\TeX works支持从模板新建文档, 在 \menu{文件} 菜单中可见.
+
+\subsubsection{拼写检查}
+
+默认情况, \TeX works没有搭载拼写检查字典, 需要用户自己配置.
+首先, 访问
+\href{https://extensions.openoffice.org/dictionary}{openoffice}
+下载 \texttt{.oxt} 文件.
+将 \texttt{.oxt} 文件重命名为 \texttt{.zip} 文件,
+解压缩得到里面的 \texttt{.dic} 和 \texttt{.aff} 文件.
+接下来将它们安装到
+\texttt{<resources>\textbackslash dictionaries}%
+\footnote{\texttt{<resources>} 的具体位置可以在
+\menu{帮助 > TeXworks 配置与资源} 中找到}.
+安装完成后, 在 \menu{编辑 > 拼写} 中选择即可.
+
+\subsubsection{魔法注释}
+
+魔法注释可以直接规定主文档、文件编码和编译命令等.
+例如用户写学位论文时, 往往有一个主文档和若干子文档.
+在子文档的开头写上魔法注释
+\begin{lstlisting}
+ % !TeX root = ../main.tex
+\end{lstlisting}
+即可告诉系统上一级目录中的 \texttt{main.tex} 是主文档%
+\footnote{主文档和子文档的更多内容请参考 \texttt{\textbackslash include}
+和 \texttt{\textbackslash input} 的用法}.
+\begin{lstlisting}
+ % !TeX encoding = UTF8
+\end{lstlisting}
+表示该文档使用 ``UTF-8'' 编码%
+\footnote{目前建议用户多用 ``UTF-8'' 编码, 尤其是中文文档}.
+\begin{lstlisting}
+ % !TeX program = xelatex
+\end{lstlisting}
+表示该文档使用 \texttt{xelatex} 编译命令进行编译.
+\begin{lstlisting}
+ % !TeX spellcheck = <language_code>
+\end{lstlisting}
+表示该文档使用 \texttt{<language\_code>} 进行拼写检查,
+它的具体名称请用户到 \menu{编辑 > 拼写} 中查看.
+
+\subsubsection{转编码}
+
+实际上转编码是很多编辑器都具备的功能.
+在\TeX works右下角有三个按钮,
+左边按钮控制换行符类型, 中间按钮控制文档编码, 右边按钮控制行跳转.
+目前大部分中文用户主要面临的是``UTF-8''和``GBK''之间的转换.
+如果文档是``GBK''编码, 使用\TeX works打开文件后, 文档会出现乱码.
+这时, 点中间按钮, 选择编码类型``GBK'', 再点击按钮,
+选择 \menu{使用所选编码重载文档}, 若文档中乱码消失, 则再次点击按钮,
+选择``UTF-8'', 最后保存文档, 完成转码工作.
+
+除以上内容外, \TeX works 还支持正则表达式、自定义快捷键等.
+这些内容都写在 \TeX works 自带的手册中.
+手册不长, 用户可以通读一遍以了解更多内容.
+很多功能可以通过\textbf{菜单栏}找到,
+因此建议用户稍微了解一下它的菜单栏.
+
+\subsection{\TeX studio}
+
+相较于 \TeX works, \TeX studio 功能更丰富, 用法更多.
+在使用 \TeX studio 前,
+用户一定要查询 \texttt{system32} 是否在\textbf{环境变量}中.
+具体方法在前面已有说明, 此处不再赘述.
+以下有关 \TeX studio 的用法介绍,
+还请用户提前在 \menu{Options > configure TeXstudio} 中勾选
+\menu{Show Advanced Options}.
+由于网络原因,
+\TeX studio 下载有些困难.
+大家可以借助于
+\url{https://d.serctl.com}
+加速下载,
+网站提供了下载教程,
+这里不再展开.
+
+\subsubsection{更改默认编译命令}
+
+在 \menu{Options > configure TeXstudio > build > default compiler}
+中选择默认编译命令.
+
+另外用 \texttt{latexmk} 和 \texttt{biblatex} 做编译时,
+需要在 \menu{Options > Configure TeXstudio > build > Build Options}
+中取消 \menu{Check and update bibliography before compiling}.
+
+\subsubsection{显示行号}
+
+在 \menu{Editor > Show Line Numbers} 选择行号如何显示.
+
+\subsubsection{数学符号表}
+
+在 \TeX studio 左下角有两个按钮:
+\menu{Side Panel} 和 \menu{Messages / Log file}.
+打开 \menu{Side Panel},
+点击软件左侧边栏第 3 个图标 \menu{Symbols}.
+
+
+\subsubsection{插入、改写调整}
+
+与很多其他编辑器一样,
+\TeX studio 也可以通过键盘 \keys{insert}
+改变插入、改写状态.
+分别处于插入、改写状态时,
+编辑器光标会呈现不同的样子.
+
+\subsubsection{调整缩进}
+
+在 \menu{Options > Configure TeXstudio > Editor > Indentation Mode}
+处可以选择是否保持缩进.
+如果需要让缩进完全变为空格,
+勾选 \menu{Replace Indentation Tab by Spaces}.
+
+在 \menu{Adv. Editor > Appearance} 中可以更改 \menu{Tab Widths}.
+
+\subsubsection{块选择模式}
+
+同时按 \keys{Ctrl + Alt} 便可通过鼠标左键进行块选择.
+
+\subsubsection{调整图标大小}
+
+有些用户屏幕分辨率高,
+因此软件上图标会显得很小.
+在 \menu{Options > Configure TeXstudio > Gui Scaling} 处可以调整三处的显示比例.
+
+\subsubsection{自动补全和未识别代码}
+
+\TeX studio 自动补全功能会先通过用户引用的宏包来判断代码是否需要自动补全,
+同时它也可以以此判定用户输入的命令是否正确.
+若系统判断命令无法识别,
+则该命令会出现红色背景.
+
+\TeX studio 能够识别的命令全部被写入了
+\href{https://github.com/texstudio-org/texstudio/tree/master/completion}{cwl 文件}
+中.
+用户可以根据自己的需要更改 cwl 文件,
+然后将其放入
+\texttt{<settings directory>\textbackslash completion\textbackslash user}
+文件夹%
+\footnote{点击 \menu{Help > Check LaTeX Installation},
+在生成的 \texttt{System Report.txt} 中找到 \texttt{texstudio.ini} 文件,
+其所在文件夹即为 \texttt{<settings directory>}}.
+
+自动补全后有可能生成文本框,
+使用 \keys{\ctrl + \arrowkey{>}} 可以跳转至下一个文本框,
+\keys{\ctrl + \arrowkey{<}} 则可以跳转至上一个.
+
+\subsubsection{拼写检查}
+
+在
+\menu{Options > Configure TeXstudio > Language Checking > Default Language}
+处选择 \texttt{en\_US} 即可默认进行英文拼写检查.
+
+\subsubsection{魔法注释}
+
+除了像 \TeX works 中使用魔法注释外, \TeX studio 还有很多其他的魔法注释, 例如
+\begin{lstlisting}
+ % !TeX TXS-program:compile = txs:///latexmk/{}[-xelatex -synctex=1 -interaction=nonstopmode ?me"]
+\end{lstlisting}
+表示使用 \texttt{latexmk} 编译命令,
+\texttt{\{\}} 表示无视编辑器赋予该命令的一切参数,
+而 \texttt{[]} 表示添加其中的参数进行编译,
+本例中添加 \texttt{-xelatex -synctex=1 -interaction=nonstopmode} 作为参数.
+如果用户不清楚魔法注释都可以写哪些类型,
+可以点击 \menu{LaTeX > Add magic comments} 查看五种魔法注释类型.
+更多内容需要阅读软件手册.
+
+\subsubsection{渲染方式}
+
+默认的渲染方式对中文括号的支持不够好.
+用户可以在 \menu{Options > Configure TeXstudio > Adv. Editor > Hacks/Workarounds} 中取消
+\menu{Try to automatically choose best display options},
+选择 \menu{Disable cache of character width} 和 \menu{Disable fixed pitch mdoe}.
+这样能够比较好地渲染中文括号.
+
+\subsubsection{转编码}
+
+\TeX studio 右下角有一处显示文档编码 (Encoding).
+依旧以``UTF-8''和``GBK''之间的转换为例.
+如果文档是``GBK''编码, 使用 \TeX studio 打开文件后,
+点击 \menu{Encoding} 处, 选择 \menu{More Encodings}.
+打开窗口后, 选择``GBK / ...'', 点击 \menu{Reload With}.
+若这时文档没有乱码, 再点击 \menu{Encoding > More Encodings},
+选择``UTF-8'', 点击 \menu{Change To}, 保存文件, 完成转码.
+在 \menu{Edit > Setup Encoding ...} 处同样可以打开编码窗口.
+
+\subsubsection{自定义命令并生成按钮}
+
+\TeX studio 允许用户自定义命令, 并将命令做成按钮放置于面板上.
+如在 \menu{Options > Configure TeXstudio > Build > User commands} 中,
+填写名称 \texttt{User1:Build-xe-view}
+和对应的功能
+\begin{lstlisting}
+ latexmk -pdfxe -silent -synctex=1 -interaction=nonstopmode ?me" | txs:///view-pdf-internal --embedded
+\end{lstlisting}
+点击 \menu{OK}.
+接下来我们在 \menu{Tools > User} 中即可看到自定义的命令和相应快捷键.
+
+接下来设置按钮.
+打开 \menu{Options > Configure TeXstudio > Toolbars},
+在两个下拉菜单中分别选择 \menu{Tools} 和 \menu{All menus},
+在右边找到 \menu{Tools > User > Build-xe-view} 并将其添加至左端,
+点击 \menu{OK}.
+这时, 在面板中将添加新的按钮.
+
+\subsubsection{生成宏指令}
+
+\TeX studio 允许用户生成宏指令.
+在 \menu{Macros > Edit Macros} 中, 用户可以根据自己的需要,
+给出宏指令的名称、快捷键、内容等等.
+例如我们将 \texttt{latexmk-pdf} 填写在 \menu{name} 中,
+将
+\begin{lstlisting}
+ % !TeX TXS-program:compile = txs:///latexmk/{}[-pdf -synctex=1 -interaction=nonstopmode ?me"]
+\end{lstlisting}
+填写在 \menu{LaTeX Content} 中,
+再将 \texttt{Shift+F1} 填写在 \menu{Shortcut}.
+设置完毕后, 点击 \menu{OK}.
+这时, 我们可以看到 \menu{Macros > latexmk-pdf} 出现.
+在文档特定位置点击它或者直接使用 \keys{\shift + F1}, 即可看到魔法注释出现.
+
+\subsubsection{更改颜色方案}
+
+有一些用户喜欢深色的颜色方案.
+手动修改颜色不方便的话, 我们可以从网上找到一些现成的颜色方案,
+例如
+\href{https://tex.stackexchange.com/questions/108315/how-can-i-set-a-dark-theme-in-texstudio}{stackexchange 网站}%
+和%
+\href{https://robjhyndman.com/hyndsight/dark-themes-for-writing/}{某些用户的博客}.
+更改方案只需要打开 \texttt{ini} 文件,
+将这些颜色方案复制到 \texttt{[formats]} 部分.
+在 \menu{Help > Check LaTeX Installation}
+中有 \texttt{ini} 文件的具体位置.
+
+\subsubsection{调用外部 PDF 阅读器}
+
+\TeX studio 已经内嵌了 PDF 阅读器供用户预览编译结果,
+但一些用户喜欢使用外部 PDF 阅读器.
+这里以 \href{https://www.sumatrapdfreader.org/free-pdf-reader.html}{SumatraPDF} 为例,
+用户直接安装或下载便携版均可,
+假定它在本地的位置为 \texttt{<SumatraPDFROOT>},
+而 \TeX studio 在本地的位置是 \texttt{<TeXstudioROOT>}.
+打开 \menu{Options > Configure TeXstudio} 窗口,
+在 \menu{Build > User commands} 中添加
+\begin{lstlisting}
+ "<SumatraPDFROOT>\SumatraPDF.exe" -reuse-instance -forward-search ?c:rme" @ -inverse-search "<TeXstudioROOT>\texstudio.exe %%f -line %%l" "?m.pdf"
+\end{lstlisting}
+将其命名为 \texttt{user0:sumatrapdf}.
+接下来, 在 \menu{Build > Build \& View} 中将
+\texttt{txs:///compile | txs:///view} 改为
+\texttt{txs:///compile | txs:///user0}.
+最后, 在 \menu{Menus} 中将 \texttt{\&View} 的命令由
+\texttt{txs:///view} 改为 \texttt{txs:///user0}.
+完成以上设置后,
+关闭窗口.
+这时,
+用户使用快捷键 \keys{F5} 和 \keys{F7} 均可打开 SumatraPDF 并且实现了正向搜索.
+如果有人喜欢在编译时添加参数 \texttt{--outdir=temp},
+那么可以将 \texttt{user0:sumatrapdf} 改为
+\begin{lstlisting}
+ "<SumatraPDFROOT>\SumatraPDF.exe" -reuse-instance -forward-search ?c:rme" @ -inverse-search "<TeXstudioROOT>\texstudio.exe %%f -line %%l" "?r)temp\?m.pdf"
+\end{lstlisting}
+
+如果以上设置没能正确实现正反向搜索,
+那么可以将 \texttt{user0:sumatrapdf} 改为
+\begin{lstlisting}
+ dde:///"<SumatraPDFROOT>\SumatraPDF.exe":SUMATRA/control/[ForwardSearch("?m.pdf",?c:rme",@,0,0,1)]
+\end{lstlisting}
+其他不变.
+而后用 SumatraPDF 打开生成的 PDF 文件,
+在 \menu{Settings > Options > Set inverse search command line} 中输入
+\begin{lstlisting}
+ "<TeXstudioROOT>\texstudio.exe" "%f" -line %l
+\end{lstlisting}
+至此完成了逆向搜索,
+双击 PDF 文件便可回到 \TeX studio 中对应代码的行首.
+
+\section{Ubuntu 20.04 系统}
+
+简化起见, 这里只介绍如何使用 \TeX studio.
+根据官网推荐, 我们安装源内的 \TeX studio.
+安装前可参照 \ref{subsec:ubuntu:xelatexfail}~节的介绍换源以增速.
+
+在 \textsf{Terminal} 中执行
+\begin{lstlisting}[language = bash]
+ sudo apt install texstudio
+\end{lstlisting}
+即可安装 \TeX studio.
+注意安装过程中会产生一些依赖, 它们包括了源内的 \TeX{} live 包, 如 \texttt{tex-common}, \texttt{texlive-base}, \texttt{texlive-binaries}, \texttt{texlive-latex-base} 和 \texttt{texlive-latex-recommended}.
+用户需要卸载它们.
+
+当然用户也可以使用
+\href{https://code.launchpad.net/~sunderme/+archive/ubuntu/texstudio}{PPA}
+来安装 \TeX studio.
+以此在 \textsf{Terminal} 中执行
+\begin{lstlisting}[language = bash]
+ sudo add-apt-repository ppa:sunderme/texstudio
+ sudo apt-get update
+ sudo apt-get install texstudio
+\end{lstlisting}
+
+安装完毕后,
+用户可以在 \textsf{Terminal} 中执行
+\begin{lstlisting}[language = bash]
+ texstudio main.tex
+\end{lstlisting}
+使用 \TeX studio 编辑文档.
+也可直接双击 \texttt{main.tex} 文件.
+
+注意, 在双击打开时, 用户需要在
+\menu{Options > Configure TeXstudio} 中点击
+\menu{Show Advanced Options},
+接下来在 \menu{Build > Build Options > Commands (\${}PATH)}
+中添加路径,
+默认安装时为
+\begin{lstlisting}
+ /usr/local/texlive/2020/bin/x86_64-linux
+\end{lstlisting}
+
+其他设置可参考前文, 这里不再赘述.
+
+\section{macOS}
+
+这里介绍两款 macOS 下的编辑器:
+\TeX Shop 和 \TeX studio.
+
+\subsection{\TeX Shop}
+
+Mac\TeX{} 自带 \TeX Shop 编辑器 (注意不要与其他自带的程序混淆),
+通常在安装完毕后便可立即使用.
+通过编辑器打开 \texttt{main.tex},
+将排版程序 (工具栏上面左数第二个下拉菜单) 由默认的 \menu{LaTeX} 切换到
+\menu{pdflatexmk},
+再点击旁边的排版 \menu{排版} (\menu{Typeset}),
+待编译完成后会弹出 PDF 预览界面.
+
+编译中文文档, 通常需要将排版程序切换到 \menu{XeLaTeX}.
+注意可能需要多次编译以生成正确的交叉引用等内容.
+
+\subsection{\TeX studio}
+
+如果希望使用 \TeX studio, 也可以通过 Homebrew 安装:
+\begin{lstlisting}[language=bash]
+ brew cask install texstudio
+\end{lstlisting}
+注意因为网络问题可能会下载失败.
+这时可能需要从其他途径获得安装包并手工安装, 此处不再赘述.
+其他设置与 Windows 系统中大致相仿.
+
+\subsubsection{无法显示文字}
+
+\TeX studio 在 macOS 下有可能无法显示文字,
+这是其他系统下目前没有发现的问题.
+具体解决方法见%
+\href{https://zhuanlan.zhihu.com/p/80728204}{李阿玲在知乎的文章}.
+
+\section{Windows Subsystem for Linux}
+
+若使用 \TeX studio,
+则需要将 \texttt{bash.exe} 及其绝对路径写入编译命令中.
+使用
+\href{https://www.voidtools.com/zh-cn/}{everything}
+搜索时会发现多个 \texttt{bash.exe},
+这里我们选择在路径
+\texttt{C:\textbackslash Windows\textbackslash WinSxS...}
+下的 \texttt{bash.exe}.
+若该路径下仍有多个 \texttt{bash.exe},
+则挑选与
+\texttt{C:\textbackslash Windows\textbackslash System32}
+同等大小的.
+
+下面给出一个例子.
+仿照前述建立用户自定义命令的方法,
+在
+\menu{Options > Configure TeXstudio > Build > User commands}
+中,
+填写名称
+\texttt{User4:bash}
+和功能\footnote{这里省略了中间路径, 用户根据自己的情形进行补充即可}
+\begin{lstlisting}
+ "C:\Windows\WinSxS\...\bash.exe" -i -c "latexmk -xelatex -synctex=1 -interaction=nonstopmode -halt-on-error -file-line-error ?me)"
+\end{lstlisting}
+点击 \menu{OK}.
+接下来打开 \menu{Options > Configure TeXstudio > Toolbars},
+在两个下拉菜单中分别选择 \menu{Tools} 和 \menu{All menus},
+在右边找到 \menu{Tools > User > bash} 并将其添加至左端, 点击 \menu{OK}.
+这时, 在面板中将添加新的按钮.
+
+遗憾的是, 由于路径表达方式不同, \TeX studio 无法正常使用正反搜索.
+这个问题的一个可选择解决方案是在 WSL 中安装图形界面并使用 X Server,
+这样可直接将 \TeX studio 安装至 WSL,
+这里不讨论此方案的优劣.
+
+\section{其他编辑器}
+
+\href{https://code.visualstudio.com/}{VS Code} 目前已有插件
+\href{https://marketplace.visualstudio.com/items?itemName=James-Yu.latex-workshop}{LaTeX Workshop}
+供用户使用.
+具体设置方式建议阅读插件手册,
+一些网友的教程可以参考,
+如
+\href{https://github.com/EthanDeng/vscode-latex}{EthanDeng 的教程}.
+另外,
+VS Code 的
+\href{https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl}{Remote-WSL}
+插件可以帮助用户更方便地使用 WSL.
+参考配置文件见附录~\ref{chp:appendix:wsl}.
+
+\href{https://www.vim.org/}{Vim} 是一款优秀的编辑器,
+它的用法较目前常见的编辑器有很大不同,
+因此用户上手时容易感觉无所适从,
+但熟练掌握用法后,
+用户将很容易对其进行定制.
+\href{http://vim-latex.sourceforge.net/}{Vim-LaTeX}
+尝试提供一套全面的工具来查看、编辑和编译LaTeX文档,
+用户可以考虑使用.
+
+\section{多款编辑器对比参考}
+
+显然, 能够支持 \LaTeX{} 的编辑器并不局限于本手册所介绍的几款.
+表~\ref{tab:editor} 是 \href{https://ddswhu.me/}{ddswhu} 在 \LaTeX{}
+小圈子内部对 \LaTeX{} 编辑器所进行的用户体验调查的结果, 比较主观, 仅供参考.
+其中 Sublime Text 和 Visual Studio Code 为文本编辑器,
+它们需要借助插件才能支持 \LaTeX{} 编译.
+对自己网络非常自信的用户也可以参考
+\href{https://en.wikipedia.org/wiki/Comparison_of_TeX_editors}{wikipedia}
+上的对比结果.
+
+\begin{table}[htbp]
+ \centering
+ \caption{\LaTeX{} 编辑器对比}
+ \begin{tabular}{cccccc}
+ \toprule
+ & WinEdt & \TeX studio & \TeX works & Sublime Text & VS Code \\
+ \cline{5-6}
+ 插件依赖 & & & & \href{https://latextools.readthedocs.io/en/latest/}{\LaTeX{}Tools} & \href{https://marketplace.visualstudio.com/items?itemName=James-Yu.latex-workshop}{\LaTeX{} Workshop} \\
+ \midrule
+ 主流系统 & Win & 全平台 & Linux/Win & 全平台 & 全平台 \\
+ 软件类型 & 商业软件 & 开源软件 & 开源软件 & 商业软件 & 开源软件 \\
+ 软件价格 & \href{https://item.taobao.com/item.htm?id=551105790596}{219 元} & 0 & 0 & \href{https://www.sublimehq.com/store/text}{80 美元} & 0 \\
+ 授权方式 & 终身/教育 & & & 终身/个人 & \\
+ % 附加信息 & 教育版本 & & & 三年更新 & \\
+ 代码高亮 & \stars{2.7} & \stars{3.2} & \stars{1.5} & \stars{4.3} & \stars{4.5} \\
+ 颜色主题 & \stars{2.3} & \stars{2.2} & \stars{1.0} & \stars{4.0} & \stars{4.0} \\
+ 自动补全 & \stars{2.7} & \stars{3.4} & \stars{2.0} & \stars{3.5} & \stars{4.0} \\
+ 代码片段 & \stars{2.7} & \stars{2.4} & \stars{0.5} & \stars{3.8} & \stars{4.0} \\
+ 辅助输入 & \stars{4.0} & \stars{3.4} & \stars{0.5} & \stars{2.3} & \stars{3.3} \\
+ 开发完成 & \stars{4.0} & \stars{3.8} & \stars{4.5} & \stars{3.5} & \stars{4.0} \\
+ 推荐指数 & \stars{2.7} & \stars{4.0} & \stars{1.5} & \stars{3.0} & \stars{4.3} \\
+ \bottomrule
+ \end{tabular}%
+ \label{tab:editor}%
+\end{table}%
diff --git a/info/install-latex-guide-zh-cn/chapter/macos.tex b/info/install-latex-guide-zh-cn/chapter/macos.tex
new file mode 100644
index 0000000000..5cf3089b57
--- /dev/null
+++ b/info/install-latex-guide-zh-cn/chapter/macos.tex
@@ -0,0 +1,130 @@
+% !TeX root = ../install-latex-guide-zh-cn.tex
+
+\chapter{macOS}\label{chap:macOS}
+
+\section{安装 Homebrew}
+
+强烈建议用户使用 \href{https://brew.sh}{Homebrew}.
+Homebrew 是一个包管理, 类似 Ubuntu 上面的 \texttt{apt-get}.
+安装教程可以在其网站找到, 这里简单列出来:
+\begin{lstlisting}[language=bash]
+ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
+\end{lstlisting}
+将以上命令在\textsf{终端}\footnote{%
+ 打开方法为: \keys{\cmdmac + \SPACE}, 输入 terminal 并打开 \menu{终端} 应用}%
+执行.
+脚本会在执行前暂停, 并说明它将做什么. 依据屏幕指令执行即可.
+
+中国大陆用户可以更改镜像以提高访问速度. 以中国科学技术大学镜像源为例:
+\begin{lstlisting}[language=bash]
+ cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
+ git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
+ cd "$(brew --repo)"/Library/Taps/homebrew/homebrew-cask
+ git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git
+ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile
+ source ~/.bash_profile
+\end{lstlisting}
+如果是 zsh 用户, 最后两行请替换为
+\begin{lstlisting}[language=bash]
+ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.zshrc
+ source ~/.zshrc
+\end{lstlisting}
+
+\subsection{Xcode}
+
+根据 \href{https://docs.brew.sh/Xcode\#supported-xcode-versions}{Homebrew 网站}的提示\footnote{原文是 Homebrew supports and recommends the latest Xcode and/or Command Line Tools available for your platform},
+推荐用户在安装 Homebrew 前先安装 Xcode.
+在\textsf{终端} 执行以下命令即可:
+\begin{lstlisting}[language=bash]
+ xcode-select --install
+\end{lstlisting}
+
+\section{安装 Mac\TeX}
+
+Mac\TeX{} 是 \TeX{} Live 在 macOS 下的再打包版本, 额外加入了一些辅助程序. 如果已经安装了 Homebrew,
+只需在\textsf{终端}执行以下命令即可完成安装:
+\begin{lstlisting}[language=bash]
+ brew cask install mactex
+\end{lstlisting}
+如有输入密码等提示, 请根据屏幕指示操作.至于环境变量等繁琐细节, Homebrew 会自动进行处理,
+无须用户干预.
+
+完整的 Mac\TeX{} 会比较大. 如果磁盘空间实在紧张, 也可以考虑安装 Basic\TeX:
+\begin{lstlisting}[language=bash]
+ brew cask install basictex
+\end{lstlisting}
+安装完成后 Basic\TeX{} 依然会缺很多包, 手动安装会比较麻烦, 所以不推荐没有经验的用户尝试.
+
+\section{卸载 Mac\TeX}
+
+如果用户借助 Homebrew cask 安装了 Mac\TeX,
+那么卸载工作可能会稍显麻烦.
+这里引用 \href{https://github.com/Homebrew/homebrew-cask/issues/32073}{Github} 上的讨论.
+用户可以根据这里的内容卸载 Mac\TeX.
+
+\section{跨版本升级 Mac\TeX}
+
+跨版本升级 (Mac\TeX{} 的版本与 \TeX{} Live 保持一致), 可在\textsf{终端}借助 Homebrew 完成:
+\begin{lstlisting}[language=bash]
+ brew update
+ brew cask upgrade mactex
+\end{lstlisting}
+
+\section{升级宏包}
+
+升级宏包依旧可以使用 \texttt{tlmgr}.
+使用方法与 \ref{sec:ubuntu:update}~节类似, 这里不再重复.
+一般来说, 也需要使用 \texttt{sudo} 获取管理员权限后才能完成安装.
+
+\section{安装宏包}
+
+安装 CTAN 中的宏包方法与 \ref{sec:ubuntu:installpackage}~节一致.
+
+\section{调出宏包手册}
+
+调出宏包手册方法与 \ref{sec:ubuntu:texdoc}~节一致.
+
+\section{编译文件}
+
+假设已经用 TextEdit.app 或其他文本编辑器编写以下示例 \texttt{main.tex}%
+\footnote{注意建立最小示例前先确定工作路径},
+内容为
+\begin{lstlisting}[language = {[LaTeX]TeX}]
+ \documentclass{article}
+ \begin{document}
+ Hello \LaTeX{} World!
+ \end{document}
+\end{lstlisting}
+接下来在\textsf{终端}中执行
+\begin{lstlisting}[language=bash]
+ pdflatex main
+\end{lstlisting}
+等待系统完成编译过程.
+待编译完成后, 可看到在工作路径中生成了 \texttt{main.pdf}
+文件和其他同名的辅助文件 \texttt{main.aux} 与 \texttt{main.log}.
+可以打开 \texttt{main.pdf} 查看内容.
+
+对于中文文档, 可以编写以下最小示例%
+\footnote{注意使用 UTF-8 编码}%
+\begin{lstlisting}[language={[LaTeX]TeX}]
+ \documentclass[UTF8]{ctexart}
+ \begin{document}
+ 你好 \LaTeX{} 世界!
+ \end{document}
+\end{lstlisting}
+保存并退出.
+接下来在\textsf{终端}中进入工作路径,
+执行
+\begin{lstlisting}[language=bash]
+ xelatex main
+\end{lstlisting}
+等待系统完成编译过程.
+\texttt{xelatex} 可调用系统字体,
+为系统安装字体的方法请参考
+\href{https://support.apple.com/en-us/HT201749}{How to install and remove fonts on your Mac}.
+安装完成后, 刷新字体缓存.
+注意到此时 \texttt{xelatex} 只能通过文件名来调用发行版预装的字体,
+解决此问题的方法请参考%
+\href{https://zhuanlan.zhihu.com/p/59774395}{慕子的文章}.
+
+编译命令的相关参数, 这里不再赘述.
diff --git a/info/install-latex-guide-zh-cn/chapter/overleaf.tex b/info/install-latex-guide-zh-cn/chapter/overleaf.tex
new file mode 100644
index 0000000000..f574470cc6
--- /dev/null
+++ b/info/install-latex-guide-zh-cn/chapter/overleaf.tex
@@ -0,0 +1,97 @@
+% !TeX root = ../install-latex-guide-zh-cn.tex
+
+\chapter{Overleaf}
+
+在特定场合,
+有些用户并不需要也没条件在本地安装发行版,
+因此这里额外补充 \href{www.overleaf.com}{Overleaf} 的相关内容.
+
+\section{注册 Overleaf}
+
+Overleaf 是全球范围内首屈一指的在线 \LaTeX{} 编辑平台.
+它为每位用户提供了 Ubuntu 系统下的 \TeX{} Live.
+它优秀的协作功能、丰富的模板仓库已吸引全球科研工作者成为它的用户.
+Overleaf 提供了包括%
+\href{https://cn.overleaf.com}{中文}%
+在内的多种语言供用户使用.
+2020年1月23日,
+\href{https://www.overleaf.com/blog/tex-live-2019-upgrade-january-2020}{它将后台的 \TeX{} Live 升级为 2019 版本},
+同时,
+\href{https://www.overleaf.com/blog/new-feature-select-your-tex-live-compiler-version}{Overleaf 还允许用户自主选择项目中的 \TeX{} Live 版本}.
+
+目前 Overleaf 允许用户%
+\href{https://www.overleaf.com/learn/latex/Chinese}{使用中文},
+并为用户预先准备了一些%
+\href{https://www.overleaf.com/learn/latex/Questions/What_OTF/TTF_fonts_are_supported_via_fontspec%3F#Fonts_for_CJK}{中文字体}.
+这些中文字体可通过%
+\href{https://www.overleaf.com/latex/templates/using-the-ctex-package-on-overleaf-zai-overleafping-tai-shang-shi-yong-ctex/gndvpvsmjcqx}{C\TeX{} 宏集}%
+调用.
+特别推荐用户使用%
+\href{https://www.overleaf.com/latex/examples/demonstration-of-noto-serif-cjk-and-noto-sans-cjk-fonts/sgrwgcddtqsq}{思源宋体和思源黑体}%
+这两种开源中文字体.
+
+
+遗憾的是,
+国内网络环境会对 Overleaf 所使用的 reCaptcha 造成影响.
+这也使得很多用户在直接注册 Overleaf 时就遇到了问题.
+
+目前,
+比较好的替代方案是借助 \href{https://orcid.org}{ORCID} 来进行注册.
+目前使用国内网络访问 ORCID 还比较流畅.
+用户, 尤其是科研工作者, 可以先注册一个 ORCID 账号.
+未来投稿时,
+可将 ORCID 账号与自己的期刊网站账号进行绑定.
+同时,
+用户也可逐步将自己所发表论文列在 ORCID 网站以便管理.
+
+\section{使用 Overleaf}
+
+用户通过 ORCID 注册 Overleaf 后便可进入自己的项目列表页面进行使用.
+
+新建项目是用户首先使用的功能.
+Overleaf 提供了多种渠道为用户新建项目:
+可以通过 Overleaf 中的模板,
+也可以通过上传本地的 \textsf{zip} 压缩文件包.
+
+新建项目后,
+用户便可进入编辑界面.
+在编辑界面用户需要先在左上角 \menu{Menu} 中选择合适的编译命令.
+由于默认字体和文件编码等原因,
+强烈建议用户在处理中文文档时使用 \texttt{XeLaTeX}.
+编写文档后,
+用户可通过鼠标点击按钮进行编译,
+也可使用快捷键 \keys{ctrl + enter}.
+
+用户编写的文件会保存在网站.
+编写完成后,
+用户只需点击 \menu{Menu} 旁的箭头回到项目列表.
+这时可以看到新增项目右侧有四个图标,
+它们分别是 \menu{Copy}、\menu{Download}、\menu{Archive} 和 \menu{Trash}.
+用户可根据自己的需求点击合适的图标.
+
+\section{升级项目}
+
+Overleaf 将后台 \TeX{} Live 升级为 2019 版本后,
+用户新建项目默认使用 \TeX{} Live 2019,
+而老项目还是使用 \TeX{} Live 的老版本.
+如果用户打算使用 \TeX{} Live 2019,
+只需将项目复制一个新的副本,
+即点击 \menu{Copy}.
+这样创建的副本便可以使用 \TeX{} Live 2019.
+如果用户是从 Github 上面导入的项目,
+建议再次导入.
+
+\section{学习与帮助}
+
+Overleaf 的%
+\href{https://www.overleaf.com/latex/templates}{模板}和%
+\href{https://www.overleaf.com/learn}{文档}%
+对全网公开,
+用户可以自行学习.
+另外 Overleaf 有着专业的技术支援团队,
+用户可发送邮件至 \href{mailto:support@overleaf.com}%
+{\ttfamily support@overleaf.com}
+咨询使用过程中遇到的问题,
+在邮件中请注意文明用语.
+部分问题会超出免费服务的范畴,
+用户需谨记这点. \ No newline at end of file
diff --git a/info/install-latex-guide-zh-cn/chapter/preface.tex b/info/install-latex-guide-zh-cn/chapter/preface.tex
new file mode 100644
index 0000000000..f425be3213
--- /dev/null
+++ b/info/install-latex-guide-zh-cn/chapter/preface.tex
@@ -0,0 +1,48 @@
+% !TeX root = ../install-latex-guide-zh-cn.tex
+
+\chapter*{前言}
+
+在 QQ 群 91940767、478023327 和 640633524 中,
+经常有群友咨询如何安装 \LaTeX.
+实际上,
+用户安装的是 \LaTeX{} 的\textbf{发行版}和相关的\textbf{编辑器}.
+本文将介绍在\textbf{不存在其他 \LaTeX{} 发行版 (如 C\TeX{} 套装) 的前提下},
+在 Windows 10、Ubuntu 20.04 和 macOS 系统中安装
+\TeX{}~Live (macOS 中介绍 Mac\TeX)、升级宏包、编译简易文档等相关操作,
+并多以介绍命令行操作为主.
+有关 MiK\TeX{} 的安装,
+可以参考 \href{https://camusecao.top/1970-01-01-/MiKTeX/}{MiK\TeX{} 的基本使用}.
+
+本文还将简要介绍几款常见编辑器的使用方法,
+其他编辑器如 \href{https://code.visualstudio.com/}{VS Code},
+\href{https://www.vim.org/}{Vim},
+用户可自行了解它们的使用方法.
+
+除在本地安装 \LaTeX{} 发行版和编辑器之外,
+本文还将额外补充使用 \href{http://www.overleaf.com}{Overleaf} 的相关内容.
+
+本文所涉及到的代码需结合上下文说明, 不能简单地复制粘贴. 红色文字都是可点的超链接, 可直接跳转.
+\menu{菜单} 表示软件菜单. \keys{k} 表示键盘按键.
+建议用户阅读 \href{https://www.tug.org/texlive/doc/texlive-zh-cn/texlive-zh-cn.pdf}{texlive-zh-cn}
+和 \href{http://mirrors.ctan.org/info/lshort/chinese/lshort-zh-cn.pdf}{lshort-zh-cn}
+以更全面地了解基础内容.
+
+必须声明的是,
+即便你已经通读本手册和上面提到的两本书,
+有很大概率还会碰到很多问题.
+这时我希望用户可以按照正确方式提问,
+例如提供\textbf{最小工作示例},
+并在论坛上面留下你的问题和相应解答以方便后来者.
+
+本文大部分内容是个人过去一段时间的使用总结, 其中难免有不甚合理或晦涩难懂的部分.
+若用户在阅读本文档的过程中有任何意见和建议,
+请发\href{mailto:ranwang.osbert@outlook.com}{邮件}或在
+\href{https://github.com/OsbertWang/install-latex-zh-cn/}{GitHub} 中提 issue.
+
+本手册发布后,
+\href{https://github.com/EthanDeng}{Dongsheng Deng},
+\href{https://github.com/muzimuzhi}{muzimuzhi},
+\href{https://github.com/stone-zeng}{Xiangdong Zeng}
+对本手册提出了很好的建议, 并提供了帮助,
+其中, 有关 macOS 的内容最初由 Xiangdong Zeng 草拟完成.
+在此一并感谢.
diff --git a/info/install-latex-guide-zh-cn/chapter/ubuntu.tex b/info/install-latex-guide-zh-cn/chapter/ubuntu.tex
new file mode 100644
index 0000000000..2f8d67ba6b
--- /dev/null
+++ b/info/install-latex-guide-zh-cn/chapter/ubuntu.tex
@@ -0,0 +1,368 @@
+% !TeX root = ../install-latex-guide-zh-cn.tex
+
+\chapter{Ubuntu 20.04 系统}
+
+\section{安装 \TeX{} Live}
+
+这里只阐述如何用镜像安装.
+为使用户顺利使用 \TeX{} Live 2020,
+建议用户首先卸载从源内安装的 \TeX{} Live 的相关包,
+具体方法见 \ref{sec:ubuntu:uninstall}~节.
+
+下载
+\href{https://mirrors.ctan.org/systems/texlive/Images/texlive2020.iso}{iso 镜像文件}
+的方法见 \ref{sec:windows:install}~节.
+下载完毕后, 打开 \textsf{Terminal} 窗口验证 MD5 值,
+即执行以下命令
+\begin{lstlisting}[language = bash]
+ cd ~/Downloads
+ md5sum texlive2020.iso
+\end{lstlisting}
+若显示
+\begin{lstlisting}
+ a31c500c7830d901363c5fa0e65cc18d texlive2020.iso
+\end{lstlisting}
+则镜像文件下载正确.
+同样可验证 SHA512 值,
+执行
+\begin{lstlisting}[language = bash]
+ cd ~/Downloads
+ sha512sum texlive2020.iso
+\end{lstlisting}
+正确的返回结果为
+\begin{lstlisting}[language=bash,literate={a}{a}{1} {b}{b}{1} {c}{c}{1} {d}{d}{1} {e}{e}{1} {f}{f}{1}]
+ 7c94bbcff5318e540dc0b03010896185d8985bcc2c2ac11906e831ec583fd574bf9720fce5efc29470c80bafe12f42ddaa392b96c460a27eda94f93c12e7b57d texlive2020.iso
+\end{lstlisting}
+
+将下载的光盘镜像进行挂载
+\begin{lstlisting}[language = bash]
+ sudo mkdir /mnt/texlive
+ sudo mount ./texlive2020.iso /mnt/texlive
+\end{lstlisting}
+接下来执行
+\begin{lstlisting}[language = bash]
+ sudo /mnt/texlive/install-tl
+\end{lstlisting}
+进行安装.
+在屏幕上应该能见到以下内容
+\begin{lstlisting}
+ ======================> TeX Live installation procedure <=====================
+
+ ======> Letters/digits in <angle brackets> indicate <=======
+ ======> menu items for actions or customizations <=======
+
+ Detected platform: GNU/Linux on x86_64
+
+ <B> set binary platforms: 1 out of 6
+
+ <S> set installation scheme: scheme-full
+
+ <C> set installation collections:
+ 40 collections out of 41, disk space required: 6516 MB
+
+ <D> set directories:
+ TEXDIR (the main TeX directory):
+ /usr/local/texlive/2020
+ TEXMFLOCAL (directory for site-wide local files):
+ /usr/local/texlive/texmf-local
+ TEXMFSYSVAR (directory for variable and automatically generated data):
+ /usr/local/texlive/2020/texmf-var
+ TEXMFSYSCONFIG (directory for local config):
+ /usr/local/texlive/2020/texmf-config
+ TEXMFVAR (personal directory for variable and automatically generated data):
+ ~/.texlive2020/texmf-var
+ TEXMFCONFIG (personal directory for local config):
+ ~/.texlive2020/texmf-config
+ TEXMFHOME (directory for user-specific files):
+ ~/texmf
+
+ <O> options:
+ [ ] use letter size instead of A4 by default
+ [X] allow execution of restricted list of programs via \write18
+ [X] create all format files
+ [X] install macro/font doc tree
+ [X] install macro/font source tree
+ [ ] create symlinks to standard directories
+ [X] after install, set CTAN as source for package updates
+
+ <V> set up for portable installation
+
+ Actions:
+ <I> start installation to hard disk
+ <P> save installation profile to 'texlive.profile' and exit
+ <H> help
+ <Q> quit
+
+ Enter command:
+\end{lstlisting}
+点击键盘 \keys{I} 进行默认安装.
+如果用户对于 Ubuntu 系统比较了解,
+可以根据提示,
+更改安装设置,
+如安装路径等.
+为简化起见,
+以下内容我们均认为用户采用默认安装.
+安装完毕后, 将挂载的光盘镜像弹出并删除文件夹
+\begin{lstlisting}[language = bash]
+ sudo umount /mnt/texlive
+ sudo rm /mnt/texlive
+\end{lstlisting}
+
+安装完成后, 用户需要设置环境变量.
+继续在 \textsf{Terminal} 中执行
+\begin{lstlisting}[language = bash]
+ gedit ~/.bashrc
+\end{lstlisting}
+在打开的文件末尾添加
+\begin{lstlisting}
+ # Add TeX Live to the PATH, MANPATH, INFOPATH
+ export PATH=/usr/local/texlive/2020/bin/x86_64-linux:$PATH
+ export MANPATH=/usr/local/texlive/2020/texmf-dist/doc/man:$MANPATH
+ export INFOPATH=/usr/local/texlive/2020/texmf-dist/doc/info:$INFOPATH
+\end{lstlisting}
+并保存退出.
+这时再打开 \textsf{Terminal} 执行
+\begin{lstlisting}[language=bash]
+ tex -v
+\end{lstlisting}
+若显示
+\begin{lstlisting}
+ TeX 3.14159265 (TeX Live 2020)
+ kpathsea version 6.3.2
+ Copyright 2020 D.E. Knuth.
+ There is NO warranty. Redistribution of this software is
+ covered by the terms of both the TeX copyright and
+ the Lesser GNU General Public License.
+ For more information about these matters, see the file
+ named COPYING and the TeX source.
+ Primary author of TeX: D.E. Knuth.
+\end{lstlisting}
+即为安装成功.
+
+接下来处理字体.
+在 \textsf{Terminal} 中执行
+\begin{lstlisting}[language=bash]
+ sudo cp /usr/local/texlive/2020/texmf-var/fonts/conf/texlive-fontconfig.conf /etc/fonts/conf.d/09-texlive.conf
+\end{lstlisting}
+将配置文件复制到系统,
+然后继续执行
+\begin{lstlisting}[language=bash]
+ sudo fc-cache -fsv
+\end{lstlisting}
+刷新字体缓存.
+这样一来, \TeX{} Live 中的字体才能够被正确调用.
+更多内容请参考 \href{https://www.tug.org/texlive/doc/texlive-zh-cn/texlive-zh-cn.pdf}{texlive-zh-cn}.
+
+如果用户更改了安装路径,
+要注意将
+\begin{lstlisting}
+ /usr/local/texlive/2020/
+\end{lstlisting}
+在各处替换.
+
+\section{卸载 \TeX{} Live}\label{sec:ubuntu:uninstall}
+
+如果要卸载从源内安装的 \TeX{} Live, 个人比较推荐使用 synaptic package manager.
+\textsf{terminal} 中执行
+\begin{lstlisting}[language = bash]
+ sudo apt-get install synaptic
+\end{lstlisting}
+即可安装.
+安装后打开, 搜索 \textsf{texlive} 即可看到与之相关的包, 右键标记以删除即可.
+当然, 用户也可以直接使用
+\begin{lstlisting}[language = bash]
+ dpkg -l | grep 'TeX Live'
+\end{lstlisting}
+找到相应的包名 \texttt{<package name>}, 之后使用类似
+\begin{lstlisting}[language = bash]
+ sudo apt-get remove --purge <package name>
+\end{lstlisting}
+的命令删除各个包.
+删除时系统会提示使用
+\begin{lstlisting}[language = bash]
+ sudo apt-get autoremove <package name>
+\end{lstlisting}
+来删除相应的依赖包.
+
+如果是从光盘镜像安装,
+直接删除文件夹即可.
+先在\textsf{terminal} 中执行
+\begin{lstlisting}[language = bash]
+ kpsewhich -var-value TEXMFROOT
+\end{lstlisting}
+来查询安装路径,
+进而通过 \texttt{sudo rm -rf} 命令进行删除.
+默认安装的用户直接运行
+\begin{lstlisting}[language = bash]
+ sudo rm -rf /usr/local/texlive/2020
+ rm -rf ~/.texlive2020
+\end{lstlisting}
+当然删除后还要清理掉环境变量.
+
+\section{跨版本升级 \TeX{} Live}\label{sec:ubuntu:version}
+
+在 \href{https://www.tug.org/texlive/upgrade.html}{tug.org}
+网站上提供了相应的方法.
+但网站也声明:
+默认情况下,
+请通过执行新安装来获取新版本的 \TeX{} Live%
+\footnote{原文是: By default,
+please get the new TL by doing a new installation instead of proceeding here}.
+
+\section{升级宏包}\label{sec:ubuntu:update}
+
+首次升级前,
+在 \textsf{terminal} 中执行
+\begin{lstlisting}[language = bash]
+ sudo visudo
+\end{lstlisting}
+将
+\begin{lstlisting}
+ /usr/local/texlive/2020/bin/x86_64-linux:
+\end{lstlisting}
+添加在 \texttt{secure\_path} 中%
+\footnote{这里只讨论默认安装的情况}.
+然后依次 \keys{\ctrl + X}, \keys{Y}, \keys{\enter} 保存退出.
+
+接下来在 \textsf{terminal} 中执行
+\begin{lstlisting}[language = bash]
+ sudo tlmgr option repository ctan
+\end{lstlisting}
+让系统自动选择源,
+同样可以使用大陆地区的源升级,
+详情见附录~\ref{chp:appendix:mirror}.
+执行命令
+\begin{lstlisting}[language = bash]
+ sudo tlmgr update --list
+\end{lstlisting}
+可查看目前源上可升级的宏包都有哪些.
+高级用户可以根据自己的需求选择升级特定宏包.
+建议初级用户执行
+\begin{lstlisting}[language = bash]
+ sudo tlmgr update --self --all
+\end{lstlisting}
+同时升级 \texttt{tlmgr} 本身和全部宏包.
+
+\section{安装宏包}\label{sec:ubuntu:installpackage}
+
+Ubuntu 20.04 下安装宏包的要求与 Windows 10 下没有多少区别, 只需注意权限, 例如
+\begin{lstlisting}[language = bash]
+ sudo tlmgr install mcmthesis
+\end{lstlisting}
+即安装了 mcmthesis.
+
+\section{调出宏包手册}\label{sec:ubuntu:texdoc}
+
+与 Windows 10 类似,
+当正确安装后,
+用户可以调出宏包手册以查阅相应内容.
+例如在 \textsf{terminal} 中执行
+\begin{lstlisting}[language=bash]
+ texdoc texlive-zh-cn
+\end{lstlisting}
+或
+\begin{lstlisting}[language=bash]
+ texdoc lshort-zh-cn
+\end{lstlisting}
+就可分别调出 \texttt{texlive-zh-cn.pdf} 和 \texttt{lshort-zh-cn.pdf}.
+
+\section{编译文件}
+
+首先, 用户需要在工作路径建立一个 \texttt{tex} 文件.
+在 \textsf{Terminal} 中执行
+\begin{lstlisting}[language = bash]
+ mkdir ~/Documents/work-latex
+ cd ~/Documents/work-latex/
+ gedit main.tex
+\end{lstlisting}
+在打开的文件输入一个最小示例
+\begin{lstlisting}[language = {[LaTeX]TeX}]
+ \documentclass{article}
+ \begin{document}
+ Hello \LaTeX{} World!
+ \end{document}
+\end{lstlisting}
+保存并退出.
+接下来执行
+\begin{lstlisting}
+ pdflatex main
+\end{lstlisting}
+等待系统完成编译过程.
+待编译完成后,
+我们即可看到在 \texttt{\~{}/Documents/work-latex} 中出现了
+\texttt{main.pdf} 文件和其他同名的辅助文件 \texttt{main.aux} 与
+\texttt{main.log}.
+执行
+\begin{lstlisting}[language=bash]
+ evince main.pdf
+\end{lstlisting}
+即可打开 \texttt{pdf} 文件.
+
+对于中文文档, 可以在 \texttt{gedit} 中编写以下最小示例%
+\footnote{gedit 默认使用 UTF-8 编码}%
+\begin{lstlisting}[language={[LaTeX]TeX}]
+ \documentclass[UTF8]{ctexart}
+ \begin{document}
+ 你好 \LaTeX{} 世界!
+ \end{document}
+\end{lstlisting}
+保存并退出.
+接下来执行
+\begin{lstlisting}[language=bash]
+ xelatex main
+\end{lstlisting}
+等待系统完成编译过程.
+\texttt{xelatex} 可以使用系统内安装的字体,
+安装字体的方法可参考附录~\ref{chp:appendix:wsl}.
+
+编译命令可添加参数, 这里与 \ref{sec:windows:compile}~节中的情形一致.
+
+\subsection{无法使用 \texttt{xelatex} 命令}\label{subsec:ubuntu:xelatexfail}
+
+有些用户反映安装完毕后无法使用 \texttt{xelatex} 命令.
+这或许是因为缺失 libfontconfig , 用户可在命令行中执行
+\begin{lstlisting}[language=bash]
+ sudo apt-get install libfontconfig1
+\end{lstlisting}
+进行安装.
+
+为提升安装速度, 可考虑更换 Ubuntu 源, 例如更换至清华大学.
+在 \textsf{Terminal} 中执行
+\begin{lstlisting}[language = bash]
+ sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
+\end{lstlisting}
+备份 \texttt{sources.list} 文件.
+接下来执行
+\begin{lstlisting}[language = bash]
+ sudo gedit /etc/apt/sources.list
+\end{lstlisting}
+将文件替换为以下内容%
+\footnote{本段文字可至%
+ \href{https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/}{清华大学镜像网站}%
+ 获取}
+\begin{lstlisting}
+ # 默认注释了源码镜像以提高 apt update 速度, 如有需要可自行取消注释
+ deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
+ # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
+ deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
+ # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
+ deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
+ # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
+ deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
+ # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
+
+ # 预发布软件源, 不建议启用
+ # deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
+ # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
+\end{lstlisting}
+然后执行
+\begin{lstlisting}[language = bash]
+ sudo apt-get update && sudo apt-get upgrade
+\end{lstlisting}
+换源并更新.
+若更改错误,
+可执行
+\begin{lstlisting}[language=bash]
+ sudo cp /etc/apt/sources.list.bak /etc/apt/sources.list
+\end{lstlisting}
+恢复文件.
diff --git a/info/install-latex-guide-zh-cn/chapter/windows.tex b/info/install-latex-guide-zh-cn/chapter/windows.tex
new file mode 100644
index 0000000000..7c45b7c99e
--- /dev/null
+++ b/info/install-latex-guide-zh-cn/chapter/windows.tex
@@ -0,0 +1,470 @@
+% !TeX root = ../install-latex-guide-zh-cn.tex
+
+\chapter{Windows 10 系统}
+
+\section{安装 \TeX{} Live}\label{sec:windows:install}
+
+在安装 \TeX{} Live 之前,
+在文件夹菜单栏 \menu{查看 > 显示/隐藏} 中选择 \menu{文件扩展名}.
+
+用户可以从最近的 CTAN 源\footnote{这里所谓的最近, 其实是由系统判定的, 实际上系统可能会误判}下载 \TeX{} Live 的
+\href{https://mirrors.ctan.org/systems/texlive/Images/texlive2020.iso}{iso 镜像文件},
+也可以找大陆地区的源自行下载\footnote{新版本发布时, 各镜像网站同步的进度会有不同}.
+通过大陆地区的源下载 iso 文件的方法请参考附录~\ref{chp:appendix:mirror}.
+
+假设镜像文件被下载到本地后,
+其存放路径为 \texttt{X:\textbackslash Y}%
+\footnote{这里, \texttt{X} 表示盘符,
+如 \texttt{C}、\texttt{D}、\texttt{E} 等;
+\texttt{Y} 表示文件夹;
+默认路径名称为不带空格的英文}.
+下载完毕后, 用户打开 \textsf{cmd} 窗口%
+\footnote{点击 \keys{\faWindows},
+输入 \textsf{cmd},
+点击 \keys{\enter};
+或在任意文件夹中按 \keys{\ctrl + L},
+输入 \textsf{cmd},
+点击 \keys{\enter}},
+执行
+\begin{lstlisting}[language = bash]
+ echo %path:;=&echo.%
+\end{lstlisting}
+查看环境变量.
+若 \texttt{C:\textbackslash Windows\textbackslash system32}
+不在结果中\footnote{这里默认系统盘为\textsf{C}盘},
+则关闭 \textsf{cmd} 窗口,
+将 \texttt{C:\textbackslash Windows\textbackslash system32}
+添加到环境变量中\footnote{在 \menu{桌面 > 此电脑 > 属性 > 高级系统设置 > 环境变量 > 系统变量 > Path} 中添加}.
+\textbf{根据以往经验, 安装过 C\TeX{} 套装的用户往往会有} \texttt{system32} \textbf{丢失的问题}.
+另外, 如果环境变量中有 \texttt{mingw} 或 \texttt{jdk} 相关的内容,
+也请暂时删除\footnote{具体原因参见
+\href{https://tex.stackexchange.com/questions/445086/error-installing-latest-version-of-tex-live-on-windows-10}{stackexchange}
+的解释, 待安装结束后, 再将 \texttt{mingw} 或 \texttt{jdk} 环境变量添加至 \TeX{} Live 的环境变量之后}.
+同时国内常见的 2345 好压也会对安装构成影响,
+建议删除它并在安装 \TeX{} Live 后更换其他同类软件%
+\footnote{推荐 \href{http://www.winrar.com.cn/}{WinRAR}
+或 \href{https://www.7-zip.org/}{7-Zip}}.
+
+下面我们要确保下载到的 iso 文件没有损坏, 一种常用做法是检查其 MD5 值.
+当然, 如果确信自己下载到的文件没有问题, 也可以跳过这一步.
+打开 \textsf{cmd} 窗口依次执行以下代码
+\begin{lstlisting}[language = bash]
+ cd /d X:\Y
+ certutil -hashfile texlive2020.iso md5
+\end{lstlisting}
+若系统显示
+\begin{lstlisting}
+ MD5 的 texlive2020.iso 哈希:
+ a31c500c7830d901363c5fa0e65cc18d
+ CertUtil: -hashfile 命令成功完成
+\end{lstlisting}
+则表明下载的镜像文件正常.
+除 MD5 值外,
+还可检查 SHA512 值.
+依然是在 \textsf{cmd} 执行
+\begin{lstlisting}[language = bash]
+ cd /d X:\Y
+ certutil -hashfile texlive2020.iso sha512
+\end{lstlisting}
+若系统显示
+\begin{lstlisting}[language=bash,literate={a}{a}{1} {b}{b}{1} {c}{c}{1} {d}{d}{1} {e}{e}{1} {f}{f}{1}]
+ SHA512 的 texlive2020.iso 哈希:
+ 7c94bbcff5318e540dc0b03010896185d8985bcc2c2ac11906e831ec583fd574bf9720fce5efc29470c80bafe12f42ddaa392b96c460a27eda94f93c12e7b57d
+ CertUtil: -hashfile 命令成功完成
+\end{lstlisting}
+即为验证成功.
+
+
+接下来开始安装.
+推荐用户先手动建立 \TeX{} Live 的安装路径 (文件夹) 再进行安装,
+注意路径的名称是\textbf{不带空格的英文},
+默认路径为 \texttt{C:\textbackslash texlive\textbackslash 2020}.
+将镜像文件挂载至虚拟光驱\footnote{Windows 10 默认双击镜像文件便可加载;
+受某些压缩软件影响双击失效时,
+可通过文件夹菜单栏
+\menu{主页 > 打开 > Windows 资源管理器} 加载;
+第三方虚拟光驱软件可考虑 WinCDEmu 或 UltraISO;
+不鼓励解压缩镜像文件}.
+假设加载后的路径为 \texttt{Z:\textbackslash}.
+在卸载了国内第三方安全软件的前提下,
+% 以管理员身份打开 \textsf{cmd} 窗口并执行%
+% \footnote{点击 \keys{\faWindows},
+% 输入 \textsf{cmd},
+% 点击 \keys{\ctrl + \shift + \enter}}
+打开 \textsf{cmd} 窗口并执行
+% \begin{lstlisting}[language = bash]
+% cd /d Z:
+% \end{lstlisting}
+% 切换路径.
+% 接下来执行
+\begin{lstlisting}[language = bash]
+ Z:\install-tl-windows.bat --no-gui
+\end{lstlisting}
+即可看到如下结果
+\begin{lstlisting}
+ =====================> TeX Live installation procedure <=====================
+
+ ======> Letters/digits in <angle brackets> indicate <=======
+ ======> menu items for actions or customizations <=======
+
+ Detected platform: Windows
+
+ <B> set binary platforms: 1 out of 6
+
+ <S> set installation scheme: scheme-full
+
+ <C> set installation collections:
+ 41 collections out of 41, disk space required: 6702 MB
+
+ <D> set directories:
+ TEXDIR (the main TeX directory):
+ C:/texlive/2020
+ TEXMFLOCAL (directory for site-wide local files):
+ C:/texlive/texmf-local
+ TEXMFSYSVAR (directory for variable and automatically generated data):
+ C:/texlive/2020/texmf-var
+ TEXMFSYSCONFIG (directory for local config):
+ C:/texlive/2020/texmf-config
+ TEXMFVAR (personal directory for variable and automatically generated data):
+ ~/.texlive2020/texmf-var
+ TEXMFCONFIG (personal directory for local config):
+ ~/.texlive2020/texmf-config
+ TEXMFHOME (directory for user-specific files):
+ ~/texmf
+
+ <O> options:
+ [ ] use letter size instead of A4 by default
+ [X] allow execution of restricted list of programs via \write18
+ [X] create all format files
+ [X] install macro/font doc tree
+ [X] install macro/font source tree
+ [X] adjust search path
+ [1] add menu items, shortcuts, etc.
+ [1] update file associations
+ [X] install TeXworks front end
+ [X] after install, set CTAN as source for package updates
+
+ <V> set up for portable installation
+
+ Actions:
+ <I> start installation to hard disk
+ <P> save installation profile to 'texlive.profile' and exit
+ <H> help
+ <Q> quit
+
+ Enter command:
+\end{lstlisting}
+这时, 用户可可直接按键盘 \keys{I} 在默认路径中直接安装 \TeX{} Live,
+也可按键盘 \keys{D} 来更改安装路径.
+按 \keys{D} 后, 用户可看到
+\begin{lstlisting}
+ ==============================================================================
+ Directories customization:
+
+ <1> TEXDIR: C:/texlive/2020
+ main tree: C:/texlive/2020/texmf-dist
+
+ <2> TEXMFLOCAL: C:/texlive/texmf-local
+ <3> TEXMFSYSVAR: C:/texlive/2020/texmf-var
+ <4> TEXMFSYSCONFIG: C:/texlive/2020/texmf-config
+
+ <5> TEXMFVAR: ~/.texlive2020/texmf-var
+ <6> TEXMFCONFIG: ~/.texlive2020/texmf-config
+ <7> TEXMFHOME: ~/texmf
+
+ Note: ~ will expand to %USERPROFILE%
+
+ Actions:
+ <R> return to main menu
+ <Q> quit
+
+ Enter command:
+\end{lstlisting}
+这时按键盘 \keys{1}, 将看到
+\begin{lstlisting}
+ New value for TEXDIR [C:/texlive/2020]:
+\end{lstlisting}
+这时可更改路径, 如 \texttt{D:/texlive/2020}.
+接下来, 按键盘 \keys{R} 即可回到初始的安装界面.
+用户可通过阅读英文执行其他操作, 这里不再赘述.
+至此, 用户只需耐心等待安装完成, 并且不要点击 \textsf{cmd} 窗口%
+\footnote{Windows 10 默认采取快速编辑模式, 一旦点击 \textsf{cmd} 窗口,
+将显示``选择命令提示符''而导致进程暂停}.
+安装完成后, 关闭再打开 \textsf{cmd} 窗口%
+\footnote{正常安装 \TeX{} Live 后, 环境变量会变化,
+关闭原 \textsf{cmd} 窗口再重新打开才能获取新的环境变量},
+执行
+\begin{lstlisting}[language = bash]
+ tex -v
+\end{lstlisting}
+显示
+\begin{lstlisting}
+ TeX 3.14159265 (TeX Live 2020/W32TeX)
+ kpathsea version 6.3.2
+ Copyright 2020 D.E. Knuth.
+ There is NO warranty. Redistribution of this software is
+ covered by the terms of both the TeX copyright and
+ the Lesser GNU General Public License.
+ For more information about these matters, see the file
+ named COPYING and the TeX source.
+ Primary author of TeX: D.E. Knuth.
+\end{lstlisting}
+即可认为安装顺利完成%
+\footnote{若未能正确显示结果, 则可能是因为环境变量未改变,
+用户可手动添加 \texttt{<TEXDIR>\textbackslash bin\textbackslash win32} 至环境变量,
+\texttt{<TEXDIR>} 需与你方才的安装路径一致}.
+弹出前面加载的光盘镜像,
+安装到此结束.
+
+\subsection{下载镜像一直不成功的处理办法}
+
+目前发现有些用户使用某些浏览器时无法正常下载镜像文件.
+这时,
+用户可以选择使用 \href{https://eternallybored.org/misc/wget/}{wget} 对镜像进行下载.
+具体用法是:
+将 \textsf{wget} 所在目录添加到环境变量中.
+打开 \textsf{cmd} 窗口执行以下代码
+\begin{lstlisting}[language = bash]
+ wget http://mirrors.ctan.org/systems/texlive/Images/texlive2020.iso
+\end{lstlisting}
+即可下载最近的镜像.
+类似地,
+也可以指定国内的源进行下载,
+例如选择清华大学镜像
+\begin{lstlisting}[language = bash]
+ wget https://mirrors.tuna.tsinghua.edu.cn/CTAN/systems/texlive/Images/texlive2020.iso
+\end{lstlisting}
+其他国内镜像只需要将链接替换即可,
+链接和方法请参考附录~\ref{chp:appendix:mirror}.
+
+\subsection{需要管理员权限的处理办法}
+
+有些用户反馈安装过程中需要管理员权限.
+以管理员身份打开 \textsf{cmd} 窗口的方法是点击 \keys{\faWindows},
+输入 \textsf{cmd},
+按 \keys{\ctrl + \shift + \enter} 三个键.
+一般而言,
+在系统盘内直接安装 \TeX{} Live 会碰到此类问题,
+因此鼓励用户在安装前先手动建立安装路径.
+直接使用管理员身份打开 \textsf{cmd} 窗口进行安装可能会对以后的升级造成影响.
+
+\section{卸载 \TeX{} Live}
+
+在跨版本升级 \TeX{} Live 时, 通常需要卸载旧版 \TeX{} Live.
+在命令行执行
+\begin{lstlisting}[language=bash]
+ kpsewhich -var-value TEXMFROOT
+\end{lstlisting}
+可以查看 \texttt{TEXMFROOT} 的值,
+该值即为 \TeX{} Live 的安装路径%
+\footnote{%
+ 除这里提供的 \texttt{TEXMFROOT}, 还有很多其他变量, 可在
+ \href{https://www.tug.org/texlive/doc/texlive-zh-cn/texlive-zh-cn.pdf}{texlive-zh-cn}
+ 第 2.3 节处找到
+}.
+接下来,
+用户只需执行%
+\footnote{双击或在 \texttt{cmd} 中运行}%
+安装路径中的卸载批处理文件即可实现卸载, 如默认安装时执行
+\begin{lstlisting}[language=bash]
+ C:\texlive\2020\tlpkg\installer\uninst.bat
+\end{lstlisting}
+结束以上步骤后,
+手动删除用户文件夹中的 \texttt{.texlive2020}.
+如果用户安装 \TeX{} Live 时需要管理员权限,
+那么在卸载时同样需要管理员权限.
+
+\subsection{手动卸载}
+
+如果执行批处理文件 \texttt{uninst.bat} 出错,
+用户也可手动删除安装文件夹,
+之后再清理 \TeX{} Live 的环境变量,
+并且清理注册表
+\begin{lstlisting}
+ HKEY_CURRENT_USER\Software\Classes\TL.bitmap2eps.convert.2020
+ HKEY_CURRENT_USER\Software\Classes\TL.DVIOUT.view.2020
+ HKEY_CURRENT_USER\Software\Classes\TL.TeXworks.edit.2020
+\end{lstlisting}
+
+
+\section{跨版本升级 \TeX{} Live}
+
+目前在 \href{https://www.tug.org/texlive/upgrade.html}{tug.org}
+上面提供的说法是:
+Windows 没有类似 Unix 的升级程序,
+需要进行新安装%
+\footnote{原文是: There is no comparable upgrade procedure for Windows.
+Doing a new installation is necessary.}.
+
+\section{升级宏包}\label{sec:windows:update}
+
+安装完成后, 用户可以升级宏包以获得更好的使用体验.
+下面将介绍使用命令行升级宏包的方法.
+打开 \textsf{cmd} 窗口, 首先执行下面命令指定升级使用的镜像源.
+\texttt{ctan} 表示系统在升级时将自动寻求最近的源进行下载.
+\begin{lstlisting}[language=bash]
+ tlmgr option repository ctan
+\end{lstlisting}
+用户同样可以指定其他的镜像源,
+方法见附录~\ref{chp:appendix:mirror}.
+
+接下来, 用户执行命令
+\begin{lstlisting}[language=bash]
+ tlmgr update --list
+\end{lstlisting}
+可查看目前源上可升级的宏包都有哪些.
+高级用户可以根据自己的需求选择升级特定宏包.
+建议初级用户直接升级全部宏包.
+用户只需执行
+\begin{lstlisting}[language=bash]
+ tlmgr update --self --all
+\end{lstlisting}
+同时升级 \texttt{tlmgr} 本身和全部宏包.
+
+\subsection{\texttt{tlmgr} 本身无法成功升级}
+
+遇到这种情况时, 用户需自行下载
+\href{https://mirrors.ctan.org/systems/texlive/tlnet/update-tlmgr-latest.exe}{update-tlmgr-latest.exe},
+然后再执行升级命令即可%
+\footnote{这里依旧让系统自动选择镜像源,
+用户可以自行选择国内镜像以加快下载速度}.
+
+\subsection{升级到一半停止}
+
+这种情况下, 用户需要执行另外一个命令继续升级
+\begin{lstlisting}
+ tlmgr update --reinstall-forcibly-removed --all
+\end{lstlisting}
+
+\section{安装宏包}
+
+在默认状态下, 用户将完整安装 \TeX{} Live, 因此用户极少碰到需要手动安装宏包的情形.
+同时, 在
+\href{http://mirrors.ctan.org/info/lshort/chinese/lshort-zh-cn.pdf}{lshort-zh-cn}
+中也明确提到, \textbf{如非万不得已, 尽量不要手动安装宏包}.
+因此在这里我只介绍从源处安装宏包的命令.
+假设用户想安装 \texttt{mcmthesis} 宏包, 只需在 \textsf{cmd} 执行
+\begin{lstlisting}[language=bash]
+ tlmgr install mcmthesis
+\end{lstlisting}
+需要注意的是, 用户一定要清楚所要安装的宏包名称, 并且在安装宏包前先确保镜像源设置正确.
+
+\section{调出宏包手册}
+
+当正确安装后,
+用户可以调出宏包手册以查阅相应内容.
+例如在 \textsf{cmd} 执行
+\begin{lstlisting}[language=bash]
+ texdoc texlive-zh-cn
+\end{lstlisting}
+或
+\begin{lstlisting}[language=bash]
+ texdoc lshort-zh-cn
+\end{lstlisting}
+就可分别调出 \texttt{texlive-zh-cn.pdf} 和 \texttt{lshort-zh-cn.pdf},
+这两本手册中都有讲解安装的相关内容,
+建议用户阅读.
+
+\section{编译文档}\label{sec:windows:compile}
+
+升级宏包完成后, 用户可以编译文档.
+这里依旧使用命令行来完成这一过程.
+
+首先, 用户需要在指定位置\footnote{以下称工作路径}建立一个 \texttt{tex} 文件:
+\begin{lstlisting}[language = bash]
+ mkdir D:\work-latex
+ cd /d D:\work-latex
+ notepad main.tex
+\end{lstlisting}
+第1行表示创建一个工作路径 \texttt{D:\textbackslash work-latex},
+第2行表示进入工作路径, 第3行表示用记事本打开 \texttt{main.tex} 文件,
+若文件不存在, 系统将询问用户是否创建该文件%
+\footnote{Windows 10 较新版本可能对中文名友好一些,
+但这里不建议用户使用中文命名工作路径和文件名}.
+在打开的记事本中编写一个最小示例
+\begin{lstlisting}[language={[LaTeX]TeX}]
+ \documentclass{article}
+ \begin{document}
+ Hello \LaTeX{} World!
+ \end{document}
+\end{lstlisting}
+保存并退出.
+接下来执行
+\begin{lstlisting}[language=bash]
+ pdflatex main
+\end{lstlisting}
+等待系统完成编译过程.
+待编译完成后, 我们即可看到在 \texttt{D:\textbackslash work-latex}
+中出现了 \texttt{main.pdf} 文件和其他同名的辅助文件
+\texttt{main.aux} 与 \texttt{main.log}.
+
+对于中文文档, 可以在记事本中编写以下最小示例%
+\footnote{自 Windows 10 1903 版本开始, 记事本默认使用 UTF-8 编码;
+若是之前的 Windows 10 版本, 请使用其他编辑器并规定文档编码为 UTF-8}%
+\begin{lstlisting}[language={[LaTeX]TeX}]
+ \documentclass[UTF8]{ctexart}
+ \begin{document}
+ 你好 \LaTeX{} 世界!
+ \end{document}
+\end{lstlisting}
+保存并退出.
+接下来执行
+\begin{lstlisting}[language=bash]
+ xelatex main
+\end{lstlisting}
+等待系统完成编译过程.
+\texttt{xelatex} 编译命令配合 UTF-8 编码和 \texttt{ctex}
+宏集已经是\textbf{目前主流的中文处理手段}.
+\texttt{xelatex} 可以使用系统内安装的字体,
+用户在安装字体时需右键字体文件选择\textbf{为所有用户安装}.
+
+总结一下, 在使用 \LaTeX{} 时, 用户首先要在工作路径%
+\footnote{建议不同的工程放入不同的工作路径}%
+中建立一个完整的 \texttt{tex} 文件%
+\footnote{该文件必须包含 \texttt{\textbackslash documentclass},
+\texttt{\textbackslash begin\{document\}} 和
+\texttt{\textbackslash end\{document\}},
+这里不讨论包含子文件的情况,
+文件名需为不含空格的英文}.
+当 \texttt{tex} 文件内容确定后, 再保存文件并使用编译命令%
+\footnote{目前常用的编译命令为 \texttt{pdflatex} 和 \texttt{xelatex}},
+将 \texttt{tex} 文件编译成 \texttt{pdf} 文件.
+
+编译命令有很多可选参数, 如用户能够从 \texttt{pdf} 文件跳回 \texttt{tex} 文件,
+便是因为执行编译时添加了参数
+\begin{lstlisting}[language=bash]
+ pdflatex -synctex=1 main
+\end{lstlisting}
+此外还有很多其他参数, 用户若感兴趣, 可自行阅读手册.
+
+在很多时候, 我个人更倾向于使用 \texttt{latexmk} 来编译 \texttt{tex} 文档,
+如执行
+\begin{lstlisting}[language=bash]
+ latexmk -pdf -synctex=1 -interaction=nonstopmode main
+\end{lstlisting}
+意味着使用
+\begin{lstlisting}[language=bash]
+ pdflatex -synctex=1 -interaction=nonstopmode main
+\end{lstlisting}
+来编译文档 \texttt{main.tex}, 并在有需要时完成其他步骤%
+\footnote{如使用 \texttt{bibtex} 或 \texttt{biblatex} 处理参考文献时需要多次编译,
+详情见相关文档}.
+
+\subsection{\LaTeXe 版本不匹配导致 \texttt{xelatex} 失败}
+
+使用 \texttt{xelatex} 编译文档,
+系统有时会提示目前 \LaTeXe 的版本低于某宏包的要求版本.
+这种情况是由于 \textsf{fmt} 文件未能更新所导致.
+此时可考虑在命令行运行
+\begin{lstlisting}[language=bash]
+ fmtutil-user --byfmt xelatex
+\end{lstlisting}
+待结束后再用 \texttt{xelatex} 编译文档.
+更多内容参考
+\href{https://github.com/CTeX-org/forum/issues/70}{github 上的讨论}.
+
+另外也可考虑重装 \texttt{xetex}.
+在命令行执行
+\begin{lstlisting}[language=bash]
+ sudo tlmgr install --reinstall xetex
+\end{lstlisting}
diff --git a/info/install-latex-guide-zh-cn/chapter/wsl.tex b/info/install-latex-guide-zh-cn/chapter/wsl.tex
new file mode 100644
index 0000000000..cd6f823363
--- /dev/null
+++ b/info/install-latex-guide-zh-cn/chapter/wsl.tex
@@ -0,0 +1,350 @@
+% !TeX root = ../install-latex-guide-zh-cn.tex
+
+\chapter{Windows Subsystem for Linux}
+
+目前微软推出了 Windows Subsystem for Linux (WSL) 供开发人员使用.
+在这里简要介绍如何在 WSL 中安装 \TeX{} Live.
+我选择的是微软商店中的 Ubuntu.
+此篇安装教程仅供参考.
+这里称 WSL 中使用的命令行为 \textsf{bash}.
+\textbf{不建议}对操作系统了解不多的用户阅读本章内容.
+
+\section{安装 \TeX{} Live}
+
+在主系统%
+\footnote{在 Windows 10 中直接进行的操作即为在主系统中的操作}%
+中下载
+\href{https://mirrors.ctan.org/systems/texlive/Images/texlive2020.iso}{iso 镜像文件},
+可选择国内源以加快下载速度.
+下载完毕后, 在 \textsf{cmd} 中验证文件是否正常.
+下载及文件验证方法同 \ref{sec:windows:install}~节.
+
+在正式安装前,
+用户需要在 \textsf{bash} 中执行
+\begin{lstlisting}[language=bash]
+ sudo apt-get install libfontconfig1
+ sudo apt-get install ttf-mscorefonts-installer
+ sudo apt-get install fontconfig
+\end{lstlisting}
+这些命令是为了处理日后使用中可能出现的字体问题.
+为避免安装速度过慢,
+可仿照 \ref{subsec:ubuntu:xelatexfail}~节更改文件 \texttt{sources.list}.
+注意 WSL 中无法启动 \textsf{gedit},
+因此需要将其替换为 \textsf{vim},
+即
+\begin{lstlisting}[language=bash]
+ sudo vim /etc/apt/sources.list
+\end{lstlisting}
+不熟悉 \textsf{vim} 的用户,
+可参考 \ref{sec:no-vim}~节.
+
+接下来, 在主系统中将镜像挂载,
+例如挂载到 \texttt{X:\textbackslash},
+而后进入 \textsf{bash} 并执行如下命令
+\begin{lstlisting}[language = bash]
+ sudo mkdir /mnt/x
+ sudo mount -t drvfs X: /mnt/x
+\end{lstlisting}
+如此便可在 \textsf{bash} 中找到挂载的光盘镜像.
+之后执行
+\begin{lstlisting}[language = bash]
+ sudo /mnt/x/install-tl
+\end{lstlisting}
+进行安装.
+在屏幕上应该能见到以下内容
+\begin{lstlisting}
+ ======================> TeX Live installation procedure <=====================
+
+ ======> Letters/digits in <angle brackets> indicate <=======
+ ======> menu items for actions or customizations <=======
+
+ Detected platform: GNU/Linux on x86_64
+
+ <B> set binary platforms: 1 out of 6
+
+ <S> set installation scheme: scheme-full
+
+ <C> set installation collections:
+ 40 collections out of 41, disk space required: 6516 MB
+
+ <D> set directories:
+ TEXDIR (the main TeX directory):
+ /usr/local/texlive/2020
+ TEXMFLOCAL (directory for site-wide local files):
+ /usr/local/texlive/texmf-local
+ TEXMFSYSVAR (directory for variable and automatically generated data):
+ /usr/local/texlive/2020/texmf-var
+ TEXMFSYSCONFIG (directory for local config):
+ /usr/local/texlive/2020/texmf-config
+ TEXMFVAR (personal directory for variable and automatically generated data):
+ ~/.texlive2020/texmf-var
+ TEXMFCONFIG (personal directory for local config):
+ ~/.texlive2020/texmf-config
+ TEXMFHOME (directory for user-specific files):
+ ~/texmf
+
+ <O> options:
+ [ ] use letter size instead of A4 by default
+ [X] allow execution of restricted list of programs via \write18
+ [X] create all format files
+ [X] install macro/font doc tree
+ [X] install macro/font source tree
+ [ ] create symlinks to standard directories
+ [X] after install, set CTAN as source for package updates
+
+ <V> set up for portable installation
+
+ Actions:
+ <I> start installation to hard disk
+ <P> save installation profile to 'texlive.profile' and exit
+ <H> help
+ <Q> quit
+
+ Enter command:
+\end{lstlisting}
+用户直接点击 \keys{I} 使用默认配置安装.
+如果用户对于 WSL 比较了解, 可以根据提示, 更改安装设置.
+为简化起见,
+以下内容均认为用户进行默认安装.
+安装完毕后, 需继续在 \textsf{bash} 中执行
+\begin{lstlisting}[language = bash]
+ sudo umount /mnt/x
+ sudo rmdir /mnt/x
+\end{lstlisting}
+弹出已加载的光盘镜像.
+
+默认安装完成后, 用户需要设置环境变量.
+继续在 \textsf{bash} 中执行
+\begin{lstlisting}[language = bash]
+ vim ~/.bashrc
+\end{lstlisting}
+在打开的文件末尾添加
+\begin{lstlisting}
+ # Add TeX Live to the PATH, MANPATH, INFOPATH
+ export PATH=/usr/local/texlive/2020/bin/x86_64-linux:$PATH
+ export MANPATH=/usr/local/texlive/2020/texmf-dist/doc/man:$MANPATH
+ export INFOPATH=/usr/local/texlive/2020/texmf-dist/doc/info:$INFOPATH
+\end{lstlisting}
+并保存退出.
+同样, 不熟悉 \textsf{vim} 的用户可参考 \ref{sec:no-vim}~节.
+退出 WSL 再进入, 执行
+\begin{lstlisting}[language=bash]
+ tex -v
+\end{lstlisting}
+将显示
+\begin{lstlisting}
+ TeX 3.14159265 (TeX Live 2020)
+ kpathsea version 6.3.2
+ Copyright 2020 D.E. Knuth.
+ There is NO warranty. Redistribution of this software is
+ covered by the terms of both the TeX copyright and
+ the Lesser GNU General Public License.
+ For more information about these matters, see the file
+ named COPYING and the TeX source.
+ Primary author of TeX: D.E. Knuth.
+\end{lstlisting}
+即为安装成功.
+
+接下来仿照 Ubuntu 20.04 处理字体.
+首先将配置文件复制到系统,
+在 \textsf{Terminal} 执行
+\begin{lstlisting}[language=bash]
+ sudo cp /usr/local/texlive/2020/texmf-var/fonts/conf/texlive-fontconfig.conf /etc/fonts/conf.d/09-texlive.conf
+\end{lstlisting}
+然后在 \textsf{Terminal} 执行
+\begin{lstlisting}[language=bash]
+ sudo fc-cache -fsv
+\end{lstlisting}
+刷新字体缓存.
+
+\section{卸载 \TeX{} Live}
+
+直接删除文件夹即可.
+先在 \textsf{bash} 中执行
+\begin{lstlisting}[language = bash]
+ kpsewhich -var-value TEXMFROOT
+\end{lstlisting}
+来查询安装路径,
+进而通过 \texttt{sudo rm -rf} 进行删除.
+默认安装的用户直接运行
+\begin{lstlisting}[language = bash]
+ sudo rm -rf /usr/local/texlive/2020
+ rm -rf ~/.texlive2020
+\end{lstlisting}
+当然删除后还要清理掉环境变量.
+
+\section{跨版本升级 \TeX{} Live}
+
+WSL 中的方法同 \ref{sec:ubuntu:version}~节.
+
+\section{升级宏包}
+
+WSL 中的方法同 \ref{sec:ubuntu:update}~节.
+
+\section{安装宏包}
+
+WSL 中的方法同 \ref{sec:ubuntu:installpackage}~节.
+
+\section{编译文件}
+
+编译一个最小示例 \texttt{main.tex}.
+
+在主系统的 \textsf{cmd} 中执行
+\begin{lstlisting}[language=bash]
+ mkdir D:\work-latex
+ cd /d D:\work-latex
+ notepad main.tex
+\end{lstlisting}
+建立文档,
+内容为
+\begin{lstlisting}[language = {[LaTeX]TeX}]
+ \documentclass{article}
+ \begin{document}
+ Hello \LaTeX{} World!
+ \end{document}
+\end{lstlisting}
+接下来在 \textsf{cmd} 中执行
+\begin{lstlisting}[language=bash]
+ bash -i -c "pdflatex main"
+\end{lstlisting}
+实现编译.
+
+也可以直接在 WSL 中建立文档并编译,
+在 \texttt{bash} 中依次执行
+\begin{lstlisting}[language=bash]
+ mkdir /mnt/d/work-latex
+ cd /mnt/d/work-latex
+ vim main.tex
+\end{lstlisting}
+建立文档,
+内容同上,
+然后在 \textsf{bash} 中执行
+\begin{lstlisting}[language=bash]
+ pdflatex main
+\end{lstlisting}
+实现编译.
+
+待编译完成后, 可看到在工作路径中生成了 \texttt{main.pdf}
+文件和其他同名的辅助文件 \texttt{main.aux} 与 \texttt{main.log}.
+在主系统中可以打开 \texttt{main.pdf} 查看内容.
+
+对于中文文档,
+可以编写以下最小示例%
+\footnote{注意使用 UTF-8 编码}%
+\begin{lstlisting}[language={[LaTeX]TeX}]
+ \documentclass[UTF8]{ctexart}
+ \begin{document}
+ 你好 \LaTeX{} 世界!
+ \end{document}
+\end{lstlisting}
+在 \textsf{cmd} 中执行
+\begin{lstlisting}[language=bash]
+ bash -i -c "xelatex main"
+\end{lstlisting}
+或在 \textsf{bash} 中执行
+\begin{lstlisting}[language=bash]
+ xelatex main
+\end{lstlisting}
+等待系统完成编译过程.
+\texttt{xelatex} 同样可以使用 WSL 内安装的字体%
+\footnote{注意主系统中的字体默认不能直接被调用,
+如果打算使用主系统中的字体,
+见
+\href{https://github.com/OsbertWang/install-latex/issues/14}{github 上的讨论}},
+在 WSL 中安装字体的方法见附录~\ref{chp:appendix:wsl}.
+
+编译命令可添加参数, 这里与 \ref{sec:windows:compile}~节中的情形一致, 不再赘述.
+
+\section{尚未圆满解决的问题}
+
+将 \TeX{} Live 安装至 WSL 仍有悬而未决的问题.
+由于 \textsf{bash} 默认是无窗口化的纯命令行,
+因此用户无法直接通过命令 \texttt{texdoc} 打开相应的手册.
+这里给出几种方法.
+
+\subsubsection{explorer 浏览}
+
+先找到手册所在路径,
+例如寻找 \texttt{lshort-zh-cn}
+\begin{lstlisting}[language=bash]
+ texdoc -l lshort-zh-cn
+\end{lstlisting}
+系统会显示
+\begin{lstlisting}
+ 1 /usr/local/texlive/2020/texmf-dist/doc/latex/lshort-chinese/lshort-zh-cn.pdf
+ = [zh] The document itself
+ Enter number of file to view, RET to view 1, anything else to skip:
+\end{lstlisting}
+这时按其他键 (如 \keys{x}) 退出.
+然后分别执行
+\begin{lstlisting}[language=bash]
+ cd /usr/local/texlive/2020/texmf-dist/doc/latex/lshort-chinese/
+ explorer.exe .
+\end{lstlisting}
+主系统的资源管理器便会打开.
+这时用户便可以在主系统中使用 pdf 阅读器打开手册进行阅读.
+
+\subsubsection{everything 搜索}
+
+使用 \href{https://www.voidtools.com/zh-cn/}{everything}.
+通过 \texttt{texdoc -l} 找到相应文件名,
+而后直接搜索.
+具体方法这里不再赘述.
+
+\subsubsection{借助其他工具}
+
+目前有很多开源的 WSL 辅助程序,
+相关讨论见本手册的 \href{https://github.com/OsbertWang/install-latex/issues/13}{issue}.
+
+\section{不懂 \textsf{vim} 的处理方法}\label{sec:no-vim}
+
+\textsf{vim} 的使用方法与目前很多流行的编辑器不同,
+因此这里给出不用 \textsf{vim} 的处理方法.
+该方法借助 \href{https://code.visualstudio.com/}{VS Code} 的 \href{https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl}{Remote-WSL} 插件实现.
+
+先来更改 \texttt{.bashrc}.
+将 \texttt{.bashrc} 备份为 \texttt{.bashrc.bak}
+\begin{lstlisting}[language=bash]
+ cp ~/.bashrc ~/.bashrc.bak
+\end{lstlisting}
+用 VS Code 打开文档
+\begin{lstlisting}[language=bash]
+ code ~/.bashrc
+\end{lstlisting}
+并对其中内容进行更改并保存.
+若更改错误,
+可以执行
+\begin{lstlisting}[language=bash]
+ cp ~/.bashrc.bak ~/.bashrc
+\end{lstlisting}
+恢复文档.
+
+接下来更改 \texttt{sources.list}.
+将 \texttt{sources.list} 备份为 \texttt{sources.list.bak}
+\begin{lstlisting}[language=bash]
+ sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
+\end{lstlisting}
+用 VS Code 打开文档
+\begin{lstlisting}[language=bash]
+ code /etc/apt/sources.list
+\end{lstlisting}
+并对其中内容进行更改,
+并且另存为
+\begin{lstlisting}
+ ~/sources.list.sav
+\end{lstlisting}
+在 \textsf{bash} 中执行
+\begin{lstlisting}[language=bash]
+ sudo cp ~/sources.list.sav /etc/apt/sources.list
+\end{lstlisting}
+替换文档.
+若发现文档有错误,
+执行
+\begin{lstlisting}[language=bash]
+ sudo cp /etc/apt/sources.list.bak /etc/apt/sources.list
+\end{lstlisting}
+恢复文档.
+
+使用 VS Code 同样可以编写 \texttt{tex} 文件,
+这涉及到如何使用 \LaTeX{} 的编辑器,
+这里不做展开. \ No newline at end of file