<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[写给工程技术人员的 LaTeX 安装指南]]></title><description><![CDATA[<p dir="auto">LaTeX 在学术领域中更是一枝独秀。本篇指南的立意是：指引<strong>大家在对 TeX/LaTeX 软件完全不熟悉的情况下正确地安装 LaTeX 软件，直到能够通过 LaTeX 软件编译出第一篇文档为止。</strong></p>
<h2>选择合适的 LaTeX 软件</h2>
<p dir="auto">首先要明白，<strong>世界上没有一个名字叫 LaTeX 的软件安装包或者软件公司</strong>。LaTeX 软件属于 TeX 软件大家族的一部分，所以要安装的其实是 TeX 软件。</p>
<p dir="auto">由于 TeX 是开源软件，并没有唯一的软件公司来发布指定的 TeX 软件；一般大家所用的是名叫 <strong>TeX 发行版</strong>的软件合集，目前常见的发行版包括：</p>
<ul>
<li>
<p dir="auto">TeX Live：一个官方的、主流的 TeX 发行版，在 Windows、Mac OS、Linux 下都能使用（其中在 Mac OS 上安装的版本一般叫 MacTeX）。它的特点是：每年发行一个版本，其安装文件中包含了当年打包时的<strong>所有模块的最新版本</strong>，所以理论上安装完之后不会出现缺少模块的问题。</p>
</li>
<li>
<p dir="auto">MikTeX：另一个常见的 TeX 发行版，也是跨平台的。它的特点是：安装包中<strong>只</strong>包括了最基本的一些模块（如 LaTeX 软件本身、基本文档类等），在使用过程中如果有缺少模块就会<strong>自动下载</strong>。</p>
</li>
<li>
<p dir="auto">CTeX 套装：一个曾经在国内比较流行的 TeX 发行版，由中科院吴凌云制作，目前最新版本是 2.9.2.164（<strong>2012 年 3 月 22 日</strong>发布，距这篇文章发布已有 9 年了）。它的内容已经非常陈旧，是早期 TeX / LaTeX 软件对中文支持不佳时的产物；现在在 LaTeX 中已经能通过 <code>ctex</code> 宏包（不要和 CTeX 套装搞混）很方便的载入中文，而其他各个模块也已经较 9 年前有了很大变化，所以没有任何使用它的必要了！！！现在网络上还有流传多年、几次抄袭转写的文章推荐大家去用，<strong>请一概忽略，千万不要再用 CTeX 套装了！！！</strong></p>
</li>
</ul>
<p dir="auto">通常来说，<strong>推荐大家用 TeX Live</strong> 而不是 MikTeX，原因是 MikTeX 的自动下载功能比较费时间，且有时候不能正确识别缺失的模块（导致不知道下什么，只好去手工下载）。现在大家的电脑硬盘空间都很充足，不至于为了 TeX Live 所需的几个 G 硬盘空间而发愁。下面就以 TeX Live 为例来介绍，关于 MikTeX 或其他渠道的安装方法在指南最后提及。</p>
<h2>第一步）安装 TeX Live</h2>
<ol>
<li>
<p dir="auto">点击链接： <a href="http://mirrors.ctan.org/systems/texlive/Images/texlive.iso" target="_blank" rel="noopener noreferrer nofollow ugc">http://mirrors.ctan.org/systems/texlive/Images/texlive.iso</a></p>
</li>
<li>
<p dir="auto">按照下图所示，挂载ISO文件</p>
</li>
</ol>
<p dir="auto"><img src="https://img.xjtu-blacksmith.cn/image-20210513151518346.png" alt="image-20210513151518346" class=" img-fluid img-markdown" /></p>
<ol start="2">
<li>打开挂载盘，可以看到目录里有一个叫 <code>install-tl-windows.bat</code> 的批处理文件，这个就是我们要运行的安装程序。</li>
</ol>
<p dir="auto"><img src="https://img.xjtu-blacksmith.cn/image-20210513151829699.png" alt="image-20210513151829699" class=" img-fluid img-markdown" /></p>
<ol start="3">
<li>双击运行，首先会弹出来一个小黑窗——因为在执行脚本。同时弹出来一个窗口告诉我们：正在加载安装文件。这个过程几秒之内应该就结束了。</li>
</ol>
<p dir="auto"><img src="https://img.xjtu-blacksmith.cn/image-20210513151939324.png" alt="image-20210513151939324" class=" img-fluid img-markdown" /></p>
<p dir="auto">接下来会弹一个简洁的安装界面，提示选择你软件安装的配置。让我们看一下这个界面：</p>
<p dir="auto"><img src="https://img.xjtu-blacksmith.cn/image-20210513152235059.png" alt="image-20210513152235059" class=" img-fluid img-markdown" /></p>
<ol>
<li>安装目录，可以保持默认。如果你有强迫症，或者你的 C 盘空间不足，你可以更改目录；但最好保证路径具有 <code>X:/.../texlive/2021</code> 的形式。这样，你之后可以在这个 <code>texlive</code> 目录下安装多个年份版本的 TeX Live，如果你需要的话。</li>
<li>给所有用户安装的选项：如果你是以管理员身份运行安装程序，这个选项就是可选的。对大多数 Windows 用户来说，电脑上通常只有自己一个账户，所以这个不重要；如果你的电脑有多个账户，请用管理员身份运行 <code>install-tl-windows</code>，然后在此处勾选给所有用户安装。</li>
<li>安装 TeXWorks 前端：TeXWorks 是一个比较简洁的 TeX/LaTeX IDE，<strong>对于新手来说最好安装，因为其他的 IDE 配置起来都比较麻烦</strong>（见附录）。</li>
<li>高级（Advanced）选项：你可以点开看看。对于新手来说，保持默认选项就可以了，没有必要修改这些选项！</li>
<li>确认配置无误后，点「安装」按钮，开始安装。</li>
</ol>
<p dir="auto">安装时长和电脑的性能有关，从十几分钟到几个小时不等。请耐心等待。安装过程中：</p>
<ul>
<li>请不要把挂载盘弹出来；</li>
<li>或者把安装界面、刚开始弹出来的小黑窗关掉。</li>
</ul>
<blockquote>
<p dir="auto">如果安装过程中断了，就需要先将没有安装完成的安装目录（像上图中一样，默认是 <code>C:/texlive/2021</code>）删干净，然后再从头开始。</p>
</blockquote>
<p dir="auto">安装结束时，日志窗口中会给出如下信息：</p>
<pre><code class="language-plaintext">欢迎进入 TeX Live 的世界！

See C:/texlive/2021/index.html for links to documentation.
The TeX Live web site (https://tug.org/texlive/) contains any updates and corrections. TeX Live is a joint project of the TeX user groups around the world; please consider supporting it by joining the group best for you. The list of groups is available on the web at https://tug.org/usergroups.html.
Logfile: C:/texlive/2021/install-tl.log
Installed on platform win32 at C:/texlive/2021
</code></pre>
<p dir="auto">然后点击窗口右下方的「关闭」按钮，即可完成安装过程。</p>
<p dir="auto">不要认为安装已经到此为止了——<strong>还要测试你的 LaTeX 确实能运行，才算合格</strong>！</p>
<h2>第二步）配置Tex Live</h2>
<p dir="auto">首先，检查一下 TeX Live 的程序目录<strong>有没有被加入到系统变量里</strong>。对着桌面左下角的 Windows 徽标点右键，在打开的菜单中选择「系统」一项；然后，打开「高级系统属性」一项，并在弹出的窗口中打开环境变量，查看一下 <code>Path</code> 或者 <code>PATH</code>（都一样）的值。过程比较复杂，如下图所示。</p>
<p dir="auto"><img src="https://img.xjtu-blacksmith.cn/image-20210513172719559.png" alt="image-20210513172719559" class=" img-fluid img-markdown" /></p>
<p dir="auto">可以看到，<code>C:\texlive\2021\bin\win32</code> 已经出现在其中，这就表明可以通过命令行或其他应用直接执行 LaTeX 软件程序了。如果你的电脑中没有找到，请自己将这个路径加入其中。</p>
<blockquote>
<p dir="auto"><strong>写给不熟悉命令行操作和环境变量的朋友</strong>：如果环境变量里没有把 TeX Live 的安装目录加进去，会怎么样呢？在命令提示符（<code>cmd</code>）中想运行 <code>latex</code>，会这样：</p>
<p dir="auto"><img src="https://img.xjtu-blacksmith.cn/image-20210513203906090.png" alt="image-20210513203906090" class=" img-fluid img-markdown" /></p>
<p dir="auto">加进环境变量又怎么样呢？这个时候 <code>latex</code> 就可以用了。</p>
<p dir="auto"><img src="https://img.xjtu-blacksmith.cn/image-20210513203956840.png" alt="image-20210513203956840" class=" img-fluid img-markdown" /></p>
<p dir="auto">当然，前面用 <code>latex</code> 失败，并不是因为你的电脑上没有 <code>latex</code>，而是系统不能在 <code>PATH</code> 所列的这些地方找到名叫 <code>latex</code> 的程序。所以环境变量的作用就是：当你从命令行执行名为 <code>xxx</code> 的程序时，系统<strong>仅会</strong>在 <code>PATH</code> 中所列的目录里寻找这个叫 <code>xxx</code> 的程序，如果没有找到则认为<strong>这个程序不存在</strong>。不过，如果我们把 <code>latex</code> 这个程序的路径写完整，那么总是可以运行的：</p>
<p dir="auto"><img src="https://img.xjtu-blacksmith.cn/image-20210513204242414.png" alt="image-20210513204242414" class=" img-fluid img-markdown" /></p>
<p dir="auto">既然如此，为什么一定把 TeX Live 的程序目录加到 <code>PATH</code> 里去呢？有两个原因：</p>
<ul>
<li>客观的原因：因为其他的软件——比如你自己配置的编辑器——并不知道你电脑上是否安装了 LaTeX，以及它们的位置。如果在 <code>PATH</code> 里有 TeX Live 目录，那么这些软件就可以尝试直接执行 <code>latex</code> 一类的命令，而不需要知道你究竟把 LaTeX 安在了哪里。</li>
<li>主观的原因：越是用得多，越免不了用命令行直接操作；这个时候，当然不想去记像 LaTeX 这样的软件究竟装在哪里了。</li>
</ul>
</blockquote>
<p dir="auto">接下来到开始菜单里看一看刚刚安装的东西：</p>
<p dir="auto"><img src="https://img.xjtu-blacksmith.cn/image-20210513171713842.png" alt="image-20210513171713842" class=" img-fluid img-markdown" /></p>
<p dir="auto">比较重要的是 TeXworks editor，打开来看一看！下图展示了 TeXworks 的基本用法。这属于 LaTeX 使用的范畴了，仅做演示。</p>
<p dir="auto"><img src="https://img.xjtu-blacksmith.cn/image-20210513173346500.png" alt="image-20210513173346500" class=" img-fluid img-markdown" /></p>
<p dir="auto">点击编译按钮，生成了 PDF 文档。这就表明，<strong>我们已经成功的安装了 LaTeX 软件了！</strong> 安装过程到此结束。</p>
<p dir="auto"><img src="https://img.xjtu-blacksmith.cn/image-20210513173604396.png" alt="image-20210513173604396" class=" img-fluid img-markdown" /></p>
]]></description><link>https://cfd-china.com/topic/4865/写给工程技术人员的-latex-安装指南</link><generator>RSS for Node</generator><lastBuildDate>Tue, 19 May 2026 22:56:23 GMT</lastBuildDate><atom:link href="https://cfd-china.com/topic/4865.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 13 May 2021 13:24:03 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to 写给工程技术人员的 LaTeX 安装指南 on Fri, 01 Mar 2024 02:32:52 GMT]]></title><description><![CDATA[<p dir="auto"><strong>提醒读者：</strong> 因近期图床地址变动，以上贴子中的图片可能失效，这里附上我个人博客中的相应页面（可以正常浏览），以供后来者参考：<a href="https://www.xjtu-blacksmith.cn/essay/latex-installation-guide-for-engineers" target="_blank" rel="noopener noreferrer nofollow ugc">写给工程技术人员的 LaTeX 安装指南</a></p>
]]></description><link>https://cfd-china.com/post/37319</link><guid isPermaLink="true">https://cfd-china.com/post/37319</guid><dc:creator><![CDATA[黑山雁]]></dc:creator><pubDate>Fri, 01 Mar 2024 02:32:52 GMT</pubDate></item><item><title><![CDATA[Reply to 写给工程技术人员的 LaTeX 安装指南 on Wed, 15 Dec 2021 02:47:11 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://cfd-china.com/uid/1">@李东岳</a> 其实目前只是浏览了一下</p>
]]></description><link>https://cfd-china.com/post/28475</link><guid isPermaLink="true">https://cfd-china.com/post/28475</guid><dc:creator><![CDATA[chengan.wang]]></dc:creator><pubDate>Wed, 15 Dec 2021 02:47:11 GMT</pubDate></item><item><title><![CDATA[Reply to 写给工程技术人员的 LaTeX 安装指南 on Wed, 15 Dec 2021 02:43:03 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://cfd-china.com/uid/1290">@chengan-wang</a>  理解起来怎么样</p>
]]></description><link>https://cfd-china.com/post/28474</link><guid isPermaLink="true">https://cfd-china.com/post/28474</guid><dc:creator><![CDATA[李东岳]]></dc:creator><pubDate>Wed, 15 Dec 2021 02:43:03 GMT</pubDate></item><item><title><![CDATA[Reply to 写给工程技术人员的 LaTeX 安装指南 on Wed, 15 Dec 2021 02:32:02 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://cfd-china.com/uid/1">@李东岳</a> 谢谢</p>
]]></description><link>https://cfd-china.com/post/28473</link><guid isPermaLink="true">https://cfd-china.com/post/28473</guid><dc:creator><![CDATA[chengan.wang]]></dc:creator><pubDate>Wed, 15 Dec 2021 02:32:02 GMT</pubDate></item><item><title><![CDATA[Reply to 写给工程技术人员的 LaTeX 安装指南 on Wed, 15 Dec 2021 02:25:47 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://cfd-china.com/uid/1290">@chengan-wang</a> 没有，这是用Adobe AI做的</p>
]]></description><link>https://cfd-china.com/post/28471</link><guid isPermaLink="true">https://cfd-china.com/post/28471</guid><dc:creator><![CDATA[李东岳]]></dc:creator><pubDate>Wed, 15 Dec 2021 02:25:47 GMT</pubDate></item><item><title><![CDATA[Reply to 写给工程技术人员的 LaTeX 安装指南 on Wed, 15 Dec 2021 02:21:28 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://cfd-china.com/uid/1">@李东岳</a> 这些图有对应的latex源代码么？</p>
]]></description><link>https://cfd-china.com/post/28470</link><guid isPermaLink="true">https://cfd-china.com/post/28470</guid><dc:creator><![CDATA[chengan.wang]]></dc:creator><pubDate>Wed, 15 Dec 2021 02:21:28 GMT</pubDate></item><item><title><![CDATA[Reply to 写给工程技术人员的 LaTeX 安装指南 on Wed, 15 Dec 2021 02:00:18 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://cfd-china.com/uid/1290">@chengan-wang</a>  <a href="http://www.dyfluid.cn/theory.pdf" target="_blank" rel="noopener noreferrer nofollow ugc">http://www.dyfluid.cn/theory.pdf</a></p>
]]></description><link>https://cfd-china.com/post/28469</link><guid isPermaLink="true">https://cfd-china.com/post/28469</guid><dc:creator><![CDATA[李东岳]]></dc:creator><pubDate>Wed, 15 Dec 2021 02:00:18 GMT</pubDate></item><item><title><![CDATA[Reply to 写给工程技术人员的 LaTeX 安装指南 on Wed, 15 Dec 2021 01:54:09 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://cfd-china.com/uid/1">@李东岳</a> 请教东岳大佬，我看见你在朋友圈发了几张图挺漂亮的，能公开一下开代码吗？</p>
<p dir="auto"><img src="/assets/uploads/files/1639533211816-mmexport1638775239683.jpg" alt="mmexport1638775239683.jpg" class=" img-fluid img-markdown" /> <img src="/assets/uploads/files/1639533211769-mmexport1638775221605.jpg" alt="mmexport1638775221605.jpg" class=" img-fluid img-markdown" /></p>
]]></description><link>https://cfd-china.com/post/28468</link><guid isPermaLink="true">https://cfd-china.com/post/28468</guid><dc:creator><![CDATA[chengan.wang]]></dc:creator><pubDate>Wed, 15 Dec 2021 01:54:09 GMT</pubDate></item><item><title><![CDATA[Reply to 写给工程技术人员的 LaTeX 安装指南 on Tue, 13 Jul 2021 03:49:05 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://cfd-china.com/uid/2872">@peiying</a> 这个用着好用吗</p>
]]></description><link>https://cfd-china.com/post/26407</link><guid isPermaLink="true">https://cfd-china.com/post/26407</guid><dc:creator><![CDATA[Sloan]]></dc:creator><pubDate>Tue, 13 Jul 2021 03:49:05 GMT</pubDate></item><item><title><![CDATA[Reply to 写给工程技术人员的 LaTeX 安装指南 on Thu, 27 May 2021 21:06:55 GMT]]></title><description><![CDATA[<p dir="auto"><strong>Mac下配置LaTeX + Sublime Text +skim or mac自带预览</strong></p>
<ol>
<li>下载MacTex，完整安装包4GB左右<br />
<a href="https://www.tug.org/mactex/" target="_blank" rel="noopener noreferrer nofollow ugc">https://www.tug.org/mactex/</a></li>
</ol>
<p dir="auto"><img src="/assets/uploads/files/1622144219703-%E6%88%AA%E5%B1%8F2021-05-27-21.35.37.png" alt="截屏2021-05-27 21.35.37.png" class=" img-fluid img-markdown" /><br />
<img src="/assets/uploads/files/1622144257174-%E6%88%AA%E5%B1%8F2021-05-27-21.37.25.png" alt="截屏2021-05-27 21.37.25.png" class=" img-fluid img-markdown" /><br />
<img src="/assets/uploads/files/1622144219655-%E6%88%AA%E5%B1%8F2021-05-27-21.36.35.png" alt="截屏2021-05-27 21.36.35.png" class=" img-fluid img-markdown" /><br />
2. 下载文本编辑器Sublime Text<br />
<a href="https://www.sublimetext.com/" target="_blank" rel="noopener noreferrer nofollow ugc">https://www.sublimetext.com/</a><br />
2.1 在Sublime Text中安装package Control，网上很多教程<br />
2.2 在Sublime Text里Command+Shift+P调出命令窗口，输入Install，之后选择LaTexTools， 我的因为已经安装过了，所以没有下面的选项，<br />
<img src="/assets/uploads/files/1622146820505-%E6%88%AA%E5%B1%8F2021-05-27-22.19.47.png" alt="截屏2021-05-27 22.19.47.png" class=" img-fluid img-markdown" /><br />
<img src="/assets/uploads/files/1622146829054-%E6%88%AA%E5%B1%8F2021-05-27-22.20.06.png" alt="截屏2021-05-27 22.20.06.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">3.下载skim， PDF阅读器，可以实时编译，有点类似overleaf在线一样的效果，设置同步，如下图。<br />
<a href="https://skim-app.sourceforge.io/" target="_blank" rel="noopener noreferrer nofollow ugc">https://skim-app.sourceforge.io/</a><br />
<img src="/assets/uploads/files/1622147008081-%E6%88%AA%E5%B1%8F2021-05-27-22.20.06.png" alt="截屏2021-05-27 22.20.06.png" class=" img-fluid img-markdown" /><br />
<img src="/assets/uploads/files/1622147026176-%E6%88%AA%E5%B1%8F2021-05-27-22.23.19.png" alt="截屏2021-05-27 22.23.19.png" class=" img-fluid img-markdown" /><br />
<img src="/assets/uploads/files/1622147046312-%E6%88%AA%E5%B1%8F2021-05-27-22.23.39.png" alt="截屏2021-05-27 22.23.39.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">至此，英文环境就没问题了。<br />
在sublime中 工具- 编译系统-选择LaTeX<br />
然后 command+B即可编译<br />
效果如下<br />
<img src="/assets/uploads/files/1622147186117-%E6%88%AA%E5%B1%8F2021-05-27-22.26.12.png" alt="截屏2021-05-27 22.26.12.png" class=" img-fluid img-markdown" /><br />
<img src="/assets/uploads/files/1622148739383-%E6%88%AA%E5%B1%8F2021-05-27-22.52.05.png" alt="截屏2021-05-27 22.52.05.png" class=" img-fluid img-markdown" /><br />
<img src="/assets/uploads/files/1622148795438-%E6%88%AA%E5%B1%8F2021-05-27-22.52.54.png" alt="截屏2021-05-27 22.52.54.png" class=" img-fluid img-markdown" /></p>
<ol start="4">
<li>中文环境<br />
***下面中文环境的配置仅仅简单测试过，平时不会使用中文LaTeX环境， 仅供参考<br />
打开terminal 输入如下命令，tlmgr 是MacTex的包管理工具，顺手安装一下ctex的包</li>
</ol>
<pre><code>sudo tlmgr update --self
sudo tlmgr install latexmk
sudo tlmgr install ctex

</code></pre>
<p dir="auto">然后在Sublime中，Preferences——Package Settings——LaTeXTools——Reconfigure LaTeXTools and migrate settings重建配置文件），在builder-settings下面新增两项配置：</p>
<pre><code>"program" : "xelatex",
"command" : ["latexmk", "-cd", "-e", "$pdflatex = 'xelatex -interaction=nonstopmode -synctex=1 %S %O'", "-f", "-pdf"],
</code></pre>
<p dir="auto">简易的中文设置: 在tex文件前加上如下代码：</p>
<pre><code>%!TEX program = xelatex
%!TEX TS-program = xelatex
%!TEX encoding = UTF-8 Unicode
</code></pre>
<p dir="auto">使用ctex包</p>
<pre><code>\usepackage[UTF8]{ctex}

</code></pre>
<ol start="5">
<li>测试<br />
随便选了一个中文模板，中间会要求下载字体。<br />
<a href="https://www.latexstudio.net/archives/51626.html" target="_blank" rel="noopener noreferrer nofollow ugc">https://www.latexstudio.net/archives/51626.html</a><br />
<img src="/assets/uploads/files/1622146585988-%E6%88%AA%E5%B1%8F2021-05-27-22.16.13.png" alt="截屏2021-05-27 22.16.13.png" class=" img-fluid img-markdown" /></li>
</ol>
<p dir="auto">清华的LaTeX模版编译总会提示Error，错误Log如下</p>
<pre><code>[Compiling /Users/xxxxxxxx/Downloads/thuthesis-master/thuthesis-example.tex]

TraditionalBuilder: Your custom command does not allow the engine to be selected

Invoking latexmk... done.

Errors:

/usr/local/texlive/2021/texmf-dist/tex/latex/thuthesis/thuthesis.cls:1019: Package fontspec Error: The font "Kaiti SC Regular" cannot be found. [\thu@set@cjk@font]
/usr/local/texlive/2021/texmf-dist/tex/latex/thuthesis/thuthesis.cls:1019: Package fontspec Error: The font "Kaiti SC Regular" cannot be found. [\thu@set@cjk@font]
/usr/local/texlive/2021/texmf-dist/tex/latex/thuthesis/thuthesis.cls:1019: Cannot use \XeTeXfeaturename with nullfont; not an AAT or Graphite font. [\thu@set@cjk@font]
/usr/local/texlive/2021/texmf-dist/tex/latex/thuthesis/thuthesis.cls:1019: Cannot use \XeTeXisexclusivefeature with nullfont; not an AAT or Graphite font. [\thu@set@cjk@font]
/usr/local/texlive/2021/texmf-dist/tex/latex/thuthesis/thuthesis.cls:1019: Cannot use \XeTeXselectorname with nullfont; not an AAT or Graphite font. [\thu@set@cjk@font]
/usr/local/texlive/2021/texmf-dist/tex/latex/thuthesis/thuthesis.cls:1019: Cannot use \XeTeXfeaturename with nullfont; not an AAT or Graphite font. [\thu@set@cjk@font]
/usr/local/texlive/2021/texmf-dist/tex/latex/thuthesis/thuthesis.cls:1019: Cannot use \XeTeXisexclusivefeature with nullfont; not an AAT or Graphite font. [\thu@set@cjk@font]
/usr/local/texlive/2021/texmf-dist/tex/latex/thuthesis/thuthesis.cls:1019: Cannot use \XeTeXselectorname with nullfont; not an AAT or Graphite font. [\thu@set@cjk@font]
/usr/local/texlive/2021/texmf-dist/tex/latex/thuthesis/thuthesis.cls:1019: Missing \endcsname inserted. [\thu@set@cjk@font]
/usr/local/texlive/2021/texmf-dist/tex/latex/thuthesis/thuthesis.cls:1019: Missing \endcsname inserted. [\thu@set@cjk@font]
/usr/local/texlive/2021/texmf-dist/tex/latex/thuthesis/thuthesis.cls:1019: LaTeX Error: Missing \begin{document}. [\thu@set@cjk@font]
/usr/local/texlive/2021/texmf-dist/tex/latex/thuthesis/thuthesis.cls:1019: Extra \endcsname. [\thu@set@cjk@font]
/usr/local/texlive/2021/texmf-dist/tex/latex/thuthesis/thuthesis.cls:1019: Package fontspec Error: The font "Kaiti SC Bold" cannot be found. [\thu@set@cjk@font]
/usr/local/texlive/2021/texmf-dist/tex/latex/thuthesis/thuthesis.cls:1019: Package fontspec Error: The font "Kaiti SC Bold" cannot be found. [\thu@set@cjk@font]
/usr/local/texlive/2021/texmf-dist/tex/latex/thuthesis/thuthesis.cls:1019: Cannot use \XeTeXfeaturename with nullfont; not an AAT or Graphite font. [\thu@set@cjk@font]
/usr/local/texlive/2021/texmf-dist/tex/latex/thuthesis/thuthesis.cls:1019: Cannot use \XeTeXisexclusivefeature with nullfont; not an AAT or Graphite font. [\thu@set@cjk@font]
/usr/local/texlive/2021/texmf-dist/tex/latex/thuthesis/thuthesis.cls:1019: Cannot use \XeTeXselectorname with nullfont; not an AAT or Graphite font. [\thu@set@cjk@font]
/usr/local/texlive/2021/texmf-dist/tex/latex/thuthesis/thuthesis.cls:1019: Cannot use \XeTeXfeaturename with nullfont; not an AAT or Graphite font. [\thu@set@cjk@font]
/usr/local/texlive/2021/texmf-dist/tex/latex/thuthesis/thuthesis.cls:1019: Cannot use \XeTeXisexclusivefeature with nullfont; not an AAT or Graphite font. [\thu@set@cjk@font]
/usr/local/texlive/2021/texmf-dist/tex/latex/thuthesis/thuthesis.cls:1019: Cannot use \XeTeXselectorname with nullfont; not an AAT or Graphite font. [\thu@set@cjk@font]
/usr/local/texlive/2021/texmf-dist/tex/latex/thuthesis/thuthesis.cls:1019: Missing \endcsname inserted. [\thu@set@cjk@font]
/usr/local/texlive/2021/texmf-dist/tex/latex/thuthesis/thuthesis.cls:1019: Missing \endcsname inserted. [\thu@set@cjk@font]
/usr/local/texlive/2021/texmf-dist/tex/latex/thuthesis/thuthesis.cls:1019: Extra \endcsname. [\thu@set@cjk@font]

Warnings:

/Users/xxxxxx/Downloads/thuthesis-master/data/appendix.tex: LaTeX Warning: `h' float specifier changed to `ht'.

/Users/xxxxxxx/Downloads/thuthesis-master/thuthesis-example.log:1: Double-click here to open the full log.

[Done!]

</code></pre>
<ol start="6">
<li>如果不想使用Skim的话，可以在LatexTools中做如下设置<br />
在Settings中的第487行，将"viewer": "",改为"viewer": "preview",这个操作会让你在Sublime Text3中build完.tex后自动弹出预览(preview)，以便检查PDF文件。<br />
<img src="/assets/uploads/files/1622149541391-%E6%88%AA%E5%B1%8F2021-05-27-23.05.21.png" alt="截屏2021-05-27 23.05.21.png" class=" img-fluid img-markdown" /><br />
<img src="/assets/uploads/files/1622149545858-%E6%88%AA%E5%B1%8F2021-05-27-23.05.29.png" alt="截屏2021-05-27 23.05.29.png" class=" img-fluid img-markdown" /></li>
</ol>
]]></description><link>https://cfd-china.com/post/25939</link><guid isPermaLink="true">https://cfd-china.com/post/25939</guid><dc:creator><![CDATA[星星星星晴]]></dc:creator><pubDate>Thu, 27 May 2021 21:06:55 GMT</pubDate></item><item><title><![CDATA[Reply to 写给工程技术人员的 LaTeX 安装指南 on Wed, 26 May 2021 09:09:21 GMT]]></title><description><![CDATA[<p dir="auto">打酱油路过-<br />
latex在线编辑试一下? <a href="https://www.overleaf.com/" target="_blank" rel="noopener noreferrer nofollow ugc">https://www.overleaf.com/</a></p>
]]></description><link>https://cfd-china.com/post/25923</link><guid isPermaLink="true">https://cfd-china.com/post/25923</guid><dc:creator><![CDATA[peiying]]></dc:creator><pubDate>Wed, 26 May 2021 09:09:21 GMT</pubDate></item><item><title><![CDATA[Reply to 写给工程技术人员的 LaTeX 安装指南 on Mon, 17 May 2021 06:59:21 GMT]]></title><description><![CDATA[<p dir="auto">该安装指南已被测试，没有问题。<br />
测试平台：WIN10 2004专业教育版。</p>
]]></description><link>https://cfd-china.com/post/25800</link><guid isPermaLink="true">https://cfd-china.com/post/25800</guid><dc:creator><![CDATA[YPZ]]></dc:creator><pubDate>Mon, 17 May 2021 06:59:21 GMT</pubDate></item><item><title><![CDATA[Reply to 写给工程技术人员的 LaTeX 安装指南 on Fri, 14 May 2021 00:40:10 GMT]]></title><description><![CDATA[<hr />
<h2>Ubuntu 下的安装</h2>
<p dir="auto">手头没有 Ubuntu 的机子，所以这里在虚拟机中演示；考虑到用 Ubuntu 的用户中很多在终端环境（命令行）下工作，这里就尽可能在终端中完成各个步骤。</p>
<p dir="auto">需要管理员权限的地方会明确的用 <code>sudo</code> 指出来。</p>
<h3>挂载安装文件</h3>
<p dir="auto">打开终端。首先，创建挂载的位置：</p>
<pre><code class="language-shell">sudo mkdir -p /tmp/texlive
</code></pre>
<p dir="auto">切换到下载文件所在的位置，比如你将 <code>texlive.iso</code> 下载到了 <code>~/Downloads</code> 下，那么就首先切换到这里：</p>
<pre><code class="language-shell">cd ~/Downloads
</code></pre>
<p dir="auto">然后将安装包挂载到前面所创建的位置上去：</p>
<pre><code class="language-shell">sudo mount -o loop texlive.iso /tmp/texlive
</code></pre>
<p dir="auto">然后切换到 <code>/tmp/texlive</code> 目录下，就可以看到安装包里的所有内容了：</p>
<pre><code class="language-shell">cd /tmp/texlive
ls  # 可以看到安装目录下的内容，其中 install-tl 是安装脚本
</code></pre>
<p dir="auto">如果你不想只用终端，则在图形界面（Ubuntu 下的 GNOME 桌面）中，打开文件管理器，对着安装包点右键，也会有挂载的选项；此时一般会把盘挂载到 <code>/media/xxx/TeXLive2021</code> 位置（<code>xxx</code> 是你的用户名），在文件管理器的左侧栏中可以看到，进入即可。</p>
<p dir="auto"><img src="https://img.xjtu-blacksmith.cn/image-20210513162107033.png" alt="image-20210513162107033" class=" img-fluid img-markdown" /></p>
<h3>运行安装脚本</h3>
<p dir="auto">接下来就可以运行安装脚本 <code>install-tl</code> 了。这是一个 Perl 脚本，需要有 Perl 解释器才能运行，不过 Ubuntu 上默认装了有，不担心。假如你的 Ubuntu 上没有 Perl 环境，请先安装一下：</p>
<pre><code class="language-shell">sudo apt install perl
</code></pre>
<p dir="auto">然后就可以执行脚本了。需要考虑一下你的需求：</p>
<ul>
<li>如果你想给当前用户安装，安装在你的家目录（<code>~</code>，或者说 <code>/home/xxx</code>）下，那么不需要 <code>sudo</code>；</li>
<li>如果你想给所有用户安装，安装在系统目录（比如 <code>/usr/local</code>、<code>/opt/</code> 等等）下，那么就需要 <code>sudo</code>。</li>
</ul>
<p dir="auto">对新手来说，不用考虑太多，越安全越好。所以就不要 <code>sudo</code> 吧！直接安装在你的家目录里：</p>
<pre><code class="language-shell">./install-tl
</code></pre>
<p dir="auto">如果发现找不到 <code>install-tl</code>，请检查一下所在位置是否正确！</p>
<h3>配置安装选项</h3>
<p dir="auto">和 Windows 不同，Linux 下执行安装脚本时的配置界面限制在终端内，没有图形界面，如下图所示。</p>
<p dir="auto"><img src="https://img.xjtu-blacksmith.cn/image-20210513164210089.png" alt="image-20210513164210089" class=" img-fluid img-markdown" /></p>
<p dir="auto">注意一下上面用蓝字标出来的，由于前面启动安装脚本的时候没有 <code>sudo</code>，所以无法安装在它的默认安装位置 <code>/usr/local/texlive/2021</code> 下。因此，首先要做的事情是输入 &lt;kbd&gt;D&lt;/kbd&gt; ，回车，修改安装目录，切换到下面这个界面：</p>
<p dir="auto"><img src="https://img.xjtu-blacksmith.cn/image-20210513164446457.png" alt="image-20210513164446457" class=" img-fluid img-markdown" /></p>
<p dir="auto">根据提示，按 1 再回车修改 <code>TEXDIR</code> 变量的值，这里我们把 <code>/usr/local</code> 整体替换为家目录 <code>~</code> 就好了：</p>
<p dir="auto"><img src="install-latex%5Cimage-20210513164727478.png" alt="image-20210513164727478" class=" img-fluid img-markdown" /></p>
<p dir="auto">输入完成之后，回车，可以看到配置中的各项路径都跟着修改了：</p>
<p dir="auto"><img src="https://img.xjtu-blacksmith.cn/image-20210513164833391.png" alt="image-20210513164833391" class=" img-fluid img-markdown" /></p>
<p dir="auto">再输入 R，回车，返回最开始的界面；此时所有配置都没问题了，所以直接输入 I，回车，开始安装！</p>
<p dir="auto"><img src="https://img.xjtu-blacksmith.cn/image-20210513164954776.png" alt="image-20210513164954776" class=" img-fluid img-markdown" /></p>
<p dir="auto">跟 WIndows 上的情况差不多。可以注意到这里的模块数是 4164，比 Windows 上的还多几个。和 Windows 一样，耐心等待安装结束，过程中不要关掉终端（或在终端中杀掉当前进程）。等到出现「欢迎进入 TeX Live 的世界！」（或者其英语形式）的时候，说明安装成功，此时该进程应当就自动终止了。</p>
<p dir="auto">如果安装过程因意外中断，请首先清理安装目录：</p>
<pre><code class="language-shell">rm -rf ~/texlive
</code></pre>
<p dir="auto">然后再重新安装。</p>
<h3>配置环境</h3>
<p dir="auto">安装结束时，会出现欢迎语；与 Windows 系统不同，请注意最后一段：</p>
<p dir="auto"><img src="https://img.xjtu-blacksmith.cn/image-20210513170353552.png" alt="image-20210513170353552" class=" img-fluid img-markdown" /></p>
<p dir="auto">这一段是说，请手工配置以下三个环境变量：</p>
<ul>
<li>将 <code>~/texlive/2021/texmf-dist/doc/man</code> 加入到 <code>MANPATH</code> 中；</li>
<li>将 <code>~/texlive/2021/texmf-dist/doc/info</code> 加入到 <code>INFOPATH</code> 中；</li>
<li>将 <code>~/texlive/2021/bin/x86_64-linux</code> 加入到 <code>PATH</code> 中（如果你安装在不是 <code>x86_64</code> 架构的机子上，最后一部分可能不太一样）</li>
</ul>
<p dir="auto">前两个无所谓，大家现在都习惯于上网查资料；但若不配置最后一条，就无法从命令行正确启动 LaTeX 软件。所以，请通过以下命令将 TeX Live 的程序目录加入到环境变量中去：</p>
<pre><code class="language-shell">echo "export PATH=$PATH:~/texlive/2021/bin/x86_64-linux" &gt;&gt; ~/.bashrc
</code></pre>
<p dir="auto">如果你用的是 <code>zsh</code> 等其他的 shell，就加到它们自己的配置文件里去。关掉当前的终端，再重启；或者在当前的终端内 <code>source ~/.bashrc</code>。然后，检查一下 <code>PATH</code> 的值：</p>
<p dir="auto"><img src="https://img.xjtu-blacksmith.cn/image-20210513171140024.png" alt="image-20210513171140024" class=" img-fluid img-markdown" /></p>
<p dir="auto">可以看到，TeX Live 的安装目录已经出现在了 <code>PATH</code> 中。尝试运行一下 <code>xelatex</code> 程序：</p>
<p dir="auto"><img src="https://img.xjtu-blacksmith.cn/image-20210513171246429.png" alt="image-20210513171246429" class=" img-fluid img-markdown" /></p>
<p dir="auto">一切正常！现在就可以在命令行中使用各种 LaTeX 程序了。让我们用两句话生成一个 PDF 文档：</p>
<pre><code class="language-shell">echo '\documentclass{article}\\begin{document}Hello, world!\end{document}' &gt; test.tex  # 生成一个最简单的 LaTeX 文档
pdflatex test.tex  # 编译这个文档
</code></pre>
<p dir="auto">看看结果：</p>
<p dir="auto"><img src="https://img.xjtu-blacksmith.cn/image-20210513174053937.png" alt="image-20210513174053937" class=" img-fluid img-markdown" /></p>
<p dir="auto">这样就表明，我们的 TeX Live 已经在 Ubuntu 上正确安装了！安装过程到此结束。</p>
<p dir="auto">需要说明的是，TeX Live 在 Linux 上安装时不会附带安装 Windows 上有的 TeXWorks IDE。如果你想要配置一个用起来顺手的 LaTeX 编辑器，就需要自己再花些心思。这个属于安装以外的范畴了，不多讲。</p>
<h2>附录 1：安装过程常见问题</h2>
<p dir="auto">欢迎各位读者补充！</p>
<ol>
<li>
<p dir="auto">安装路径中可以有中文吗？</p>
<p dir="auto"><strong>答</strong>：最好不要有，<strong>在 Windows 系统下尤其如此</strong>。能避免就避免！安装过程中可能一切正常，但装好之后就可能出现各种问题，不得不通过重装解决。</p>
</li>
<li>
<p dir="auto">以前安装的版本可以直接升级吗？</p>
<p dir="auto"><strong>答</strong>：通常不行，一般的建议是：要么保留旧版本，安装新版本，然后把环境变量 <code>PATH</code> 指向最新的版本；要么先把旧版本删干净，然后再重新安装。如开头所言，TeX 软件历史悠久，所以很多方面的发展没有跟上时代潮流；有人喜欢这样，也有人不喜欢——尤其是新手们。</p>
</li>
<li>
<p dir="auto">怎么配置编辑器 / IDE？推荐用哪些？</p>
<p dir="auto"><strong>答</strong>：这个可以参考 <a href="https://gitee.com/OsbertWang/install-latex-guide-zh-cn/releases" target="_blank" rel="noopener noreferrer nofollow ugc">install-latex-guide-zh-cn</a> 中的第 5 节：使用编辑器，那里的介绍非常全面。</p>
</li>
</ol>
<h2>附录 2：其他安装方式简介</h2>
<p dir="auto">除了以上所介绍的通过安装包安装 TeX Live 的方式之外，还有以下一些方式：</p>
<ul>
<li>
<p dir="auto">安装 MikTeX：直接到 MikTeX 官网 <a href="https://miktex.org/" target="_blank" rel="noopener noreferrer nofollow ugc">https://miktex.org/</a> 下载安装包，然后走一遍安装流程即可，这个过程要比 TeX Live 的安装容易很多、快很多；但是，正如前面所说的，MikTeX 的特点是：刚开始只安装很少的一些模块（总共几百 MB 左右），在以后的使用过程中自动安装其所发现的缺失模块——这个过程通常很麻烦，比如你的某一文档中有几十个模块没有安装，则 MikTeX 可能要反复运行好几次才能把所有的模块装齐，有时候可能还找不到相应的模块（比如你调用了某个字体模块，用的并不是 <code>\usepackage</code> 命令，MikTeX 就识别不了）。所以，除非你经验丰富，并且希望用运行时安装模块的时间来换一次性装齐所有模块的硬盘空间，否则不要选择这种方式。</p>
</li>
<li>
<p dir="auto">安装 ProTeXt：ProTeXt 是一套整合起来的工具，包括 MikTeX（提供 LaTeX 程序）、TeXStudio（IDE）、Sumatra PDF（阅读器）。只能在 Windows 上使用。安装过程基本上是图形界面，操作起来比较容易；但是使用的人似乎不多。下载地址：<a href="http://mirrors.ctan.org/systems/win32/protext/protext.zip" target="_blank" rel="noopener noreferrer nofollow ugc">http://mirrors.ctan.org/systems/win32/protext/protext.zip</a></p>
</li>
<li>
<p dir="auto">通过 Linux 系统的包管理器：包括 Ubuntu、Fedora 在内的主流 Linux 发行版中都有 TeXLive 的软件包，比如 Ubuntu 上可以直接通过这个命令安装 TeX Live 完整版：</p>
<pre><code class="language-shell">sudo apt install texlive-full
</code></pre>
<p dir="auto">Fedora 上则是：</p>
<pre><code class="language-shell">sudo dnf install texlive
</code></pre>
<p dir="auto">这种方法的问题在于：发行版提供的 TeX Live 软件包一般比较旧，比如 Ubuntu 现在提供给 20.04 LTS 的版本是 TeX Live 2019，即使是以新著称的 Fedora 也只提供到 TeX Live 2020。如果你使用 Linux 系统，嫌以上的安装过程繁琐，或者想统一管理软件，可以采用这种方式。</p>
</li>
</ul>
<h2>附录 3：怎么查看 TeX Live 自带的文档</h2>
<p dir="auto">在环境变量已经正确配置的情况下（见前面的安装说明），在 Windows 系统下打开命令提示符 / 在 Linux 系统下打开终端，执行如下命令：</p>
<pre><code class="language-shell">texdoc xxx
</code></pre>
<p dir="auto">其中 <code>xxx</code> 是你要查找的模块名称，可以是：</p>
<ul>
<li>一个程序的名字，比如 <code>texdoc xelatex</code> 就会打开 <code>xelatex</code> 程序的说明书；</li>
<li>一个文档类的名字，比如 <code>texdoc thuthesis</code> 就会打开清华大学学位论文 LaTeX 模板 <code>thuthesis</code> 的文档；</li>
<li>一个宏包的名字，比如 <code>texdoc geometry</code> 就会打开用来调页面边距的 <code>geometry</code> 宏包的参考文档（这样你就不需要再在网上搜它的参数怎么设置了！）；</li>
<li>一个字体的名字，比如 <code>texdoc fandol</code> 就会打开 Fandol 中文开源字体的说明文档。</li>
</ul>
<p dir="auto">当然可能还不限于上面几类。最常用应该是第三种，因为大家用 LaTeX 时经常为各种宏包的选项犯难，这时候通过 <code>texdoc</code> 命令查文档就比去网上漫无目的地搜索「经验」要快得多、好得多。</p>
<blockquote>
<p dir="auto">当然，绝大多数文档都是英文的，这对于工程技术人员来说应该不算一个大困难。如果你一定想读中文文档，可以到<a href="https://github.com/latexstudio/LaTeXPackages-CN" target="_blank" rel="noopener noreferrer nofollow ugc">这个地方</a>找现有的一些文档的中文翻译版本。</p>
</blockquote>
]]></description><link>https://cfd-china.com/post/25749</link><guid isPermaLink="true">https://cfd-china.com/post/25749</guid><dc:creator><![CDATA[李东岳]]></dc:creator><pubDate>Fri, 14 May 2021 00:40:10 GMT</pubDate></item></channel></rss>