Latex入门教程(1)

警告
本文最后更新于 2021-07-02,文中内容可能已过时,请谨慎使用。

Latex配置问题总结

1.配置环境变量

https://jokerzhangimg.oss-cn-beijing.aliyuncs.com/image/enviroment.png
环境变量

windows利用powershell可以查看是否安装Latex成功,使用==管理员==身份运行,输入下面的指令

1xelatex 
2xelatex -v
https://jokerzhangimg.oss-cn-beijing.aliyuncs.com/image/20210702151907.png
验证是否安装成功
提示
如果环境变量未生效可以试着将其移至首位

2.配置settings.json

新版的配置文件如下

 1"latex-workshop.latex.recipes": [
 2        {
 3          "name": "xelatex",
 4          "tools": [
 5            "xelatex"
 6          ]
 7        },
 8        {
 9          "name": "xelatex -> bibtex -> xelatex*2",
10          "tools": [
11            "xelatex",
12            "bibtex",
13            "xelatex",
14            "xelatex"
15          ]
16        }
17      ],
18      "latex-workshop.latex.tools": [
19        {
20          "name": "latexmk",
21          "command": "latexmk",
22          "args": [
23            "-synctex=1",
24            "-interaction=nonstopmode",
25            "-file-line-error",
26            "-pdf",
27            "%DOC%"
28          ]
29        },
30        {
31          "name": "xelatex",
32          "command": "xelatex",
33          "args": [
34            "-synctex=1",
35            "-interaction=nonstopmode",
36            "-file-line-error",
37            "%DOC%"
38          ]
39        },
40        {
41          "name": "bibtex",
42          "command": "bibtex",
43          "args": [
44            "%DOCFILE%"
45          ]
46        }
47      ],
48      "latex-preview.command": "xelatex"