|
之前用VScode配置了Latex(原来的配置均从网络汇总),但是换了一台电脑,重新从网上找的配置不太满意,所以把原来的copy过来了,感觉还是原来的顺手呀。就当给自己存个档,顺便留给大家,有需要自取。
- 安装texlive
- 安装vscode
- 在vscode中安装latex workshop 插件
- 在vscode-setting.json中复制如下代码
完成!
<hr/>另外可能存在一些些问题,譬如评论区有位小伙伴
”build的时候显示Recipe terminated with fatal error: spawn xelatex ENOENT.怎么办“
大概这也是我没想过的问题,我搜了一下,可能的解决方案是
把安装路径加入到系统环境变量path里重启,我的就是 D:\texlive\2020\bin\win32
以及如果点了半天Recipe:xelatex或者Recipe:pdflatex等没反应,一定要检查自己的latex框架写对了没有
\documentclass[UTF8]{ctexart}
\begin{document}
\begin{equation}
a^2+b^2=c^2
\end{equation}
\end{document}
<hr/>&#34;latex-workshop.latex.tools&#34;: [
{
&#34;name&#34;: &#34;xelatex&#34;,
&#34;command&#34;: &#34;xelatex&#34;,
&#34;args&#34;: [
&#34;-synctex=1&#34;,
&#34;-interaction=nonstopmode&#34;,
&#34;-file-line-error&#34;,
&#34;%DOCFILE%&#34;
]
},
{
&#34;name&#34;: &#34;latexmk&#34;,
&#34;command&#34;: &#34;latexmk&#34;,
&#34;args&#34;: [
&#34;-synctex=1&#34;,
&#34;-interaction=nonstopmode&#34;,
&#34;-file-line-error&#34;,
&#34;-pdf&#34;,
&#34;%DOCFILE%&#34;
]
},
{
&#34;name&#34;: &#34;pdflatex&#34;,
&#34;command&#34;: &#34;pdflatex&#34;,
&#34;args&#34;: [
&#34;-synctex=1&#34;,
&#34;-interaction=nonstopmode&#34;,
&#34;-file-line-error&#34;,
&#34;%DOCFILE%&#34;
]
},
{
&#34;name&#34;: &#34;bibtex&#34;,
&#34;command&#34;: &#34;bibtex&#34;,
&#34;args&#34;: [
&#34;%DOCFILE%&#34;
]
}
],
&#34;latex-workshop.latex.recipes&#34;: [
{
&#34;name&#34;: &#34;xelatex&#34;,
&#34;tools&#34;: [
&#34;xelatex&#34;
]
},
{
&#34;name&#34;: &#34;pdflatex&#34;,
&#34;tools&#34;: [
&#34;pdflatex&#34;
]
},
{
&#34;name&#34;: &#34;latexmk&#34;,
&#34;tools&#34;: [
&#34;latexmk&#34;
]
},
{
&#34;name&#34;: &#34;pdflatex -> bibtex -> pdflatex*2&#34;,
&#34;tools&#34;: [
&#34;pdflatex&#34;,
&#34;bibtex&#34;,
&#34;pdflatex&#34;,
&#34;pdflatex&#34;
]
}
],
&#34;latex-workshop.latex.clean.enabled&#34;: false,
&#34;latex-workshop.latex.clean.fileTypes&#34;: [
&#34;*.aux&#34;,
&#34;*.bbl&#34;,
&#34;*.blg&#34;,
&#34;*.idx&#34;,
&#34;*.ind&#34;,
&#34;*.lof&#34;,
&#34;*.lot&#34;,
&#34;*.out&#34;,
&#34;*.toc&#34;,
&#34;*.acn&#34;,
&#34;*.acr&#34;,
&#34;*.alg&#34;,
&#34;*.glg&#34;,
&#34;*.glo&#34;,
&#34;*.gls&#34;,
&#34;*.ist&#34;,
&#34;*.fls&#34;,
&#34;*.log&#34;,
&#34;*.fdb_latexmk&#34;,
&#34;*.gz&#34;
],
&#34;latex-workshop.view.pdf.viewer&#34;: &#34;tab&#34;,
&#34;latex-workshop.latex.autoClean.run&#34;: &#34;onBuilt&#34;
}<hr/> |
|