1)vscode下载地址
http://mirrors.ustc.edu.cn/CTAN/systems/texlive/Images/
2)Tex Live下载地址
http://mirrors.ustc.edu.cn/CTAN/systems/texlive/Images/
安装参考https://zhuanlan.zhihu.com/p/38178015
setting.json文件设置recipes和tools
快捷键cmd(ctrl)+shift+p输入setting打开settings.json把以下代码加入,注意在原本内容的最后一行加上英文逗号换行再复制粘贴,不然会报错
recipes的第一个为默认编译方式
推荐使用VS code自带pdf预览:
"latex-workshop.view.pdf.viewer": "tab",
此外如果需要支持中文路径下的文件,需要把以下内容中 的%DOC%改为%DOCFILE%",但此处笔者建议涉及代码 方面不要用中文路径
{
"latex-workshop.latex.recipes": [
{
"name": "pdflatex -> bibtex -> pdflatex*2",
"tools": [
"pdflatex",
"bibtex",
"pdflatex",
"pdflatex"
]
},
{
"name": "xelatex",
"tools": [
"xelatex"
]
},
{
"name": "latexmk",
"tools": [
"latexmk"
]
},
{
"name": "xelatex -> bibtex -> xelatex*2",
"tools": [
"xelatex",
"bibtex",
"xelatex",
"xelatex"
]
}
],
"latex-workshop.latex.tools": [{
"name": "latexmk",
"command": "latexmk",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"-pdf",
"%DOCFILE%"
]
}, {
"name": "xelatex",
"command": "xelatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOCFILE%"
]
}, {
"name": "pdflatex",
"command": "pdflatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOCFILE%"
]
}, {
"name": "bibtex",
"command": "bibtex",
"args": [
"%DOCFILE%"
]
}],
"latex-workshop.view.pdf.viewer": "tab",
"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"
],
"editor.minimap.enabled": false,
"breadcrumbs.enabled": true,
"window.zoomLevel": 0,
}
% !TEX program= xelatex
\documentclass{ctexart}
\usepackage[utf8]{inputenc}
\title{测试}
\author{作者}
\begin{document}
\maketitle
一份测试文档
\end{document}