1:安装texlive.iso镜像
网址:
下载完成后鼠标左键双击,找到install-tl-windows.bat文件,以管理员模式运行,在跳出的界面中点击advanced可更改安装路径,若不想装c盘,建议更改到无中文的路径下。
小插曲:
若打开cmd输入 tex -version出现以下则成功:
若更改了默认路径会报"tex不是内部命令"之类的错误,需添加环境变量:
在path下添加bin\win32即可
2:vscode安装latex workshop
插件中搜索latex workshop并安装
3:更改默认编辑器
打开vscode的setting.json(ctrl+shift+p,搜索即可),将以下内容粘贴上即可,注意花括号位置和添加逗号:
"latex-workshop.latex.tools": [
// {
// "name": "latexmk",
// "command": "latexmk",
// "args": [
// "-pdfxe",
// "--shell-escape",
// "-pvc",
// "-cd",
// "-time",
// "%DOCFILE%"
// ]
// },
{
"name": "xelatex",
"command": "xelatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"-pdf",
"%DOCFILE%"
]
},
{
"name": "pdflatex",
"command": "pdflatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOCFILE%"
]
},
{
"name": "makeindex",
"command": "makeindex",
"args": [
"%DOCFILE%.nlo",
"-s",
"nomencl.ist",
"-o",
"%DOCFILE%.nls"
]
},
{
"name": "biber",
"command": "biber",
"args": [
"%DOCFILE%"
]
}
],
"latex-workshop.latex.recipes": [
// {
// "name": "latexmk",
// "tools": [
// "latexmk"
// ]
// },
{
"name": "xelatex",
"tools": [
"xelatex"
]
},
{
"name": "xe->mkind->bib->xe*2",
"tools": [
"xelatex",
"makeindex",
"biber",
"xelatex",
"xelatex"
]
},
{
"name": "pdf->mkind->bib->pdf*2",
"tools": [
"pdflatex",
"makeindex",
"biber",
"pdflatex",
"pdflatex"
]
},
{
"name": "xe->bib->xe->xe",
"tools": [
"xelatex",
"biber",
"xelatex",
"xelatex"
]
},
{
"name": "pdflatex",
"tools": [
"pdflatex"
]
},
{
"name": "pdf->bib->pdf->pdf",
"tools": [
"pdflatex",
"biber",
"pdflatex",
"pdflatex"
]
}
],
"latex-workshop.latex.clean.fileTypes": [
"*.aux",
"*.bbl",
"*.blg",
"*.idx",
"*.ind",
"*.lof",
"*.lot",
"*.out",
"*.toc",
"*.acn",
"*.acr",
"*.alg",
"*.glg",
"*.glo",
"*.gls",
"*.ist",
"*.fls",
"*.log",
"*.fdb_latexmk"
],
4:重启vscode,创建text.tex文件测试
先编译,后显示
测试文件:
\documentclass{article}
\begin{document}
hello,world
\end{document}