Skip to content

Commit

Permalink
强调VSC要选工具链而非工具,增加目录深度 (#437)
Browse files Browse the repository at this point in the history
  • Loading branch information
YDX-2147483647 authored Oct 17, 2024
1 parent 53782ff commit 92472ba
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
4 changes: 4 additions & 0 deletions wiki/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ export default defineConfig({
},
],
},
outline: {
level: [2, 4],
label: '本页目录',
},
footer: {
message: 'Released under the <a href="https://www.latex-project.org/lppl/">LaTeX Project Public License</a>.',
copyright: 'Copyright © 2020–2024 <a href="https://github.com/BITNP">BITNP</a>',
Expand Down
14 changes: 8 additions & 6 deletions wiki/guide/configure-and-compile.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ BIThesis 中的模板编译方式大同小异,我们都会使用 `xelatex`、`

在这里,我挑选了三种常见的 LaTeX 编写环境:

- 直接使用「命令行」徒手编写编译
- 使用 VS Code 配合 LaTeX Workshop 编写与编译
- 使用 TeXstudio 编写与编译
- [直接使用「命令行」徒手编写编译](#徒手编译)
- [使用 VS Code 配合 LaTeX Workshop 编写与编译](#使用-vs-code-撰写与编译-latex-模板)
- [使用 TeXstudio 编写与编译](#使用-texstudio-撰写与编译-latex-模板)

我会依次介绍在这三种环境下 LaTeX 编译器配置方法。

Expand Down Expand Up @@ -59,8 +59,8 @@ xelatex --interaction=nonstopmode main
VS Code 的设置项目可以通过打开 UI 设置界面(快捷键 `ctrl/cmd + ,` ),之后点击右上角 <img src="../assets/codicon-go-to-file.svg" alt="Open Settings (JSON)" title="Open Settings (JSON)" class="icon"> 按钮即可打开相应的 JSON 格式配置文件,我们在这里即可定义 LaTeX 编译工具。其中:

-编译工具”是在 `"latex-workshop.latex.tools": [ ... ]` 处进行定义,即我们在这里定义每次调用工具 `latexmk``xelatex` 时所执行的命令
-编译工具链”是在 `"latex-workshop.latex.recipes": [ ... ]` 处进行定义,即我们在这里定义编译整个文档的工具链。对我们的模板使用 `xelatex` 的编译方式来说,就是定义 `xelatex -> biber -> xelatex -> xelatex`「四步走」的串联过程
-编译**工具**”是在 `"latex-workshop.latex.tools": [ ... ]` 处进行定义,即我们在这里定义每次调用工具 `latexmk``xelatex` 时所执行的命令
-编译工具****”是在 `"latex-workshop.latex.recipes": [ ... ]` 处进行定义,即我们在这里定义编译整个文档的工具链。对我们的模板使用 `xelatex` 的编译方式来说,就是定义 `xelatex -> biber -> xelatex -> xelatex`「四步走」的串联过程

:::warning
LaTeX Workshop 的默认配置无法对我们的项目进行编译。
Expand Down Expand Up @@ -158,10 +158,12 @@ LaTeX Workshop 的默认配置无法对我们的项目进行编译。

#### 调用相应的编译 recipe

最后,我们使用快捷键 `ctrl/cmd + shift + P` 打开命令执行栏,并搜索「LaTeX Workshop: Build with recipe」,并选择你所用的 recipe(即上面配置的工具链),即可编译整个 LaTeX 项目。不论用上面介绍的哪种方法,都可以正确的编译 BIThesis 的模板
最后,我们使用快捷键 `ctrl/cmd + shift + P` 打开命令执行栏,并搜索「LaTeX Workshop: Build with recipe」,并选择你所用的 recipe(即上面配置的工具****),即可编译整个 LaTeX 项目。

![select a recipe](https://i.loli.net/2020/03/09/2c1uEYlUFjRxJ9w.png)

不论用上面介绍的`latexmk`还是`xelatex -> biber -> xelatex * 2`,都可以正确编译 BIThesis 的模板。

### 使用 TeXstudio 撰写与编译 LaTeX 模板

TeXstudio 的编译工具大部分已经为我们配置完毕,我们只需要在 TeXstudio 的设置中定义编译所用的编译器即可。在 TeXstudio 中点击「选项 » 设置 TeXstudio」,在打开的窗口中选择「构建」,并在元命令里面将「默认编译器」设置为 `xelatex`,将默认文献工具设置为 `biber` 即可。
Expand Down

0 comments on commit 92472ba

Please sign in to comment.