diff options
Diffstat (limited to 'Master/texmf-dist/doc/latex/install-latex-guide-zh-cn/chapter/wsl.tex')
-rw-r--r-- | Master/texmf-dist/doc/latex/install-latex-guide-zh-cn/chapter/wsl.tex | 200 |
1 files changed, 114 insertions, 86 deletions
diff --git a/Master/texmf-dist/doc/latex/install-latex-guide-zh-cn/chapter/wsl.tex b/Master/texmf-dist/doc/latex/install-latex-guide-zh-cn/chapter/wsl.tex index 08181a019be..1f43e90035b 100644 --- a/Master/texmf-dist/doc/latex/install-latex-guide-zh-cn/chapter/wsl.tex +++ b/Master/texmf-dist/doc/latex/install-latex-guide-zh-cn/chapter/wsl.tex @@ -14,7 +14,7 @@ 在主系统% \footnote{在 Windows 10 中直接进行的操作即为在主系统中的操作}% 中下载 -\href{https://mirrors.ctan.org/systems/texlive/Images/texlive2020.iso}{iso 镜像文件}, +\href{https://mirrors.ctan.org/systems/texlive/Images/texlive2021.iso}{iso 镜像文件}, 可选择国内源以加快下载速度. 下载完毕后, 在 \textsf{cmd} 中验证文件是否正常. 下载及文件验证方法同 \ref{sec:windows:install}~节. @@ -53,51 +53,51 @@ 在屏幕上应该能见到以下内容 \begin{lstlisting} ======================> TeX Live installation procedure <===================== - + ======> Letters/digits in <angle brackets> indicate <======= ======> menu items for actions or customizations <======= + = help> https://tug.org/texlive/doc/install-tl.html <======= - Detected platform: GNU/Linux on x86_64 + Detected platform: GNU/Linux on x86_64 + + <B> set binary platforms: 1 out of 6 - <B> set binary platforms: 1 out of 6 + <S> set installation scheme: scheme-full - <S> set installation scheme: scheme-full + <C> set installation collections: + 40 collections out of 41, disk space required: 6963 MB - <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/2021 + TEXMFLOCAL (directory for site-wide local files): + /usr/local/texlive/texmf-local + TEXMFSYSVAR (directory for variable and automatically generated data): + /usr/local/texlive/2021/texmf-var + TEXMFSYSCONFIG (directory for local config): + /usr/local/texlive/2021/texmf-config + TEXMFVAR (personal directory for variable and automatically generated data): + ~/.texlive2021/texmf-var + TEXMFCONFIG (personal directory for local config): + ~/.texlive2021/texmf-config + TEXMFHOME (directory for user-specific files): + ~/texmf - <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 + <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 + <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 + <I> start installation to hard disk + <P> save installation profile to 'texlive.profile' and exit + <Q> quit Enter command: \end{lstlisting} @@ -120,9 +120,9 @@ 在打开的文件末尾添加 \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 + export PATH=/usr/local/texlive/2021/bin/x86_64-linux:$PATH + export MANPATH=/usr/local/texlive/2021/texmf-dist/doc/man:$MANPATH + export INFOPATH=/usr/local/texlive/2021/texmf-dist/doc/info:$INFOPATH \end{lstlisting} 并保存退出. 同样, 不熟悉 \textsf{vim} 的用户可参考 \ref{sec:no-vim}~节. @@ -132,9 +132,9 @@ \end{lstlisting} 将显示 \begin{lstlisting} - TeX 3.14159265 (TeX Live 2020) - kpathsea version 6.3.2 - Copyright 2020 D.E. Knuth. + TeX 3.141592653 (TeX Live 2021) + kpathsea version 6.3.3 + Copyright 2021 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. @@ -148,7 +148,7 @@ 首先将配置文件复制到系统, 在 \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 + sudo cp /usr/local/texlive/2021/texmf-var/fonts/conf/texlive-fontconfig.conf /etc/fonts/conf.d/09-texlive.conf \end{lstlisting} 然后在 \textsf{Terminal} 执行 \begin{lstlisting}[language=bash] @@ -172,6 +172,75 @@ WSL 中的方法同 \ref{sec:ubuntu:update}~节. WSL 中的方法同 \ref{sec:ubuntu:installpackage}~节. +\section{调出宏包手册} + +由于 WSL 的 \textsf{bash} 默认是无窗口化的纯命令行, +因此将 \TeX{} Live 安装至 WSL 后, +用户无法直接通过命令 \texttt{texdoc} 打开相应的手册. +下面几种方法均为收集而来的方案, +其中比较推荐更改 \texttt{texdoc.cnf}. + +\subsubsection{更改 \texttt{texdoc.cnf}} + +此方案源自本手册的 \href{https://github.com/OsbertWang/install-latex-guide-zh-cn/issues/13}{issue}. +首先在 \textsf{bash} 中执行 +\begin{lstlisting}[language=bash] + texdoc --files +\end{lstlisting} +系统返回类似如下内容 +\begin{lstlisting}[language=bash] + /mnt/d/texlive-wsl/2021/texmf-dist/scripts/texdoc/texdoclib.tlu 3.2.2 + Configuration file(s): + active /mnt/d/texlive-wsl/2021/texmf-dist/texdoc/texdoc.cnf + Recommended file(s) for personal settings: + /home/<username>/texmf/texdoc/texdoc.cnf +\end{lstlisting} +这里给出了 \texttt{texdoc} 的配置文件所在位置. +打开用户文件夹下的配置文件 +\begin{lstlisting}[language=bash] + vim ~/texmf/texdoc/texdoc.cnf +\end{lstlisting} +在文件内写入 +\begin{lstlisting} + viewer_pdf = (powershell.exe -Command Start-Process $(wslpath -w %s)) & +\end{lstlisting} +并且保存退出. +然后再执行 \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/2021/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/2021/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-guide-zh-cn/issues/13}{issue}. + \section{编译文件} 编译一个最小示例 \texttt{main.tex}. @@ -219,7 +288,7 @@ WSL 中的方法同 \ref{sec:ubuntu:installpackage}~节. 可以编写以下最小示例% \footnote{注意使用 UTF-8 编码}% \begin{lstlisting}[language={[LaTeX]TeX}] - \documentclass[UTF8]{ctexart} + \documentclass[UTF8,fontset=fandol]{ctexart} \begin{document} 你好 \LaTeX{} 世界! \end{document} @@ -237,52 +306,11 @@ WSL 中的方法同 \ref{sec:ubuntu:installpackage}~节. \footnote{注意主系统中的字体默认不能直接被调用, 如果打算使用主系统中的字体, 见 -\href{https://github.com/OsbertWang/install-latex/issues/14}{github 上的讨论}}, +\href{https://github.com/OsbertWang/install-latex-guide-zh-cn/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} 的使用方法与目前很多流行的编辑器不同, |