掉坑里了,切记texlive必须要安装,不然就是下面这样子
步骤一:
texlive安装链接:
https://mirrors.tuna.tsinghua.edu.cn/CTAN/systems/texlive/Images/
下载完后双击ISO文件,再双击install-tl-windows.bat
双击install-tl-windows.bat之后会自动跳转1-2个页面到下面这个页面
安装过程很久,我的花了1小时大概
出现下面这个界面之后再在总端查看版本,有总端类似版本出现texlive即安装成功
步骤二:下载vscode直接下载安装就完事
https://code.visualstudio.com/
步骤三: 1、不使用SumatraPDF的情况
按下面快捷键之后,输入json
CTRL+shift+p
输入json打开open user settings就出来下面的settings.json配置文件,我打开的时候只有一个{},接下来所有配置都输入到{}中
{
"latex-workshop.latex.tools": [
{
"name": "pdflatex",
"command": "pdflatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOC%"
]
},
{
"name": "xelatex",
"command": "xelatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOC%"
]
},
{
"name": "bibtex",
"command": "bibtex",
"args": [
"%DOCFILE%"
]
}
],
"latex-workshop.latex.recipes": [
{
"name": "pdflatex",
"tools": [
"pdflatex"
]
},
{
"name": "xelatex",
"tools": [
"xelatex"
]
},
{
"name": "xe->bib->xe->xe",
"tools": [
"xelatex",
"bibtex",
"xelatex",
"xelatex"
]
},
{
"name": "pdflatex -> bibtex -> pdflatex*2",
"tools": [
"pdflatex",
"bibtex",
"pdflatex",
"pdflatex"
]
}
],
}
配置并保存好之后,创建一个tex文件或者导入一个tex文件,运行文件
文件运行成功,就会出现下面类似图(使用的是内置的pdf)成功!!!!!
2、使用SumatraPDF的情况
(不同的是配置文件不一样,json文件如下配置)
{
"latex-workshop.latex.tools": [
{
"name": "pdflatex",
"command": "pdflatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOC%"
]
},
{
"name": "xelatex",
"command": "xelatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOC%"
]
},
{
"name": "bibtex",
"command": "bibtex",
"args": [
"%DOCFILE%"
]
}
],
"latex-workshop.latex.recipes": [
{
"name": "pdflatex",
"tools": [
"pdflatex"
]
},
{
"name": "xelatex",
"tools": [
"xelatex"
]
},
{
"name": "xe->bib->xe->xe",
"tools": [
"xelatex",
"bibtex",
"xelatex",
"xelatex"
]
},
{
"name": "pdflatex -> bibtex -> pdflatex*2",
"tools": [
"pdflatex",
"bibtex",
"pdflatex",
"pdflatex"
]
}
],
"latex-workshop.view.pdf.viewer": "external",
"latex-workshop.view.pdf.external.viewer.command": "D:\\ps\\SumatraPDF\\SumatraPDF.exe",
"latex-workshop.view.pdf.external.viewer.args": ["%PDF%"],
"latex-workshop.view.pdf.external.synctex.command": "D:\\ps\\SumatraPDF\\SumatraPDF.exe", // 注意修改路径
"latex-workshop.view.pdf.external.synctex.args": [
"-forward-search",
"%TEX%",
"%LINE%",
"-reuse-instance",
"-inverse-search",
"code \"D:\\ps\\Microsoft VS Code\\resources\\app\\out\\cli.js\" -r -g \"%f:%l\"", // 注意修改路径
"%PDF%"
],
"latex-workshop.latex.recipe.default": "lastUsed",
}
前面代码都一样,加了下面这些代码,然后红框部分修改成你自己的路径
之后配置一下SumatraPDF,点击选项
"D:\ps\Microsoft VS Code\Code.exe" "D:\ps\Microsoft VS Code\resources\app\out\cli.js" --ms-enable-electron-run-as-node -r -g "%f:%l"
然后打开高级选项跳转到SumatraPDF.settings.txt加入两行代码,第一行代码和前面的设置选项里的命令行是一样的
InverseSearchCmdLine = "D:/ps/Microsoft VS Code/Code.exe" "D:/ps/Microsoft VS Code/resources/app/out/cli.js" --ms-enable-electron-run-as-node -r -g "%f:%l"
EnableTeXEnhancements = true