已经安装好了gnuplot,请问如何在vscode设置--shell-escape
测试代码为
\documentclass{standalone}
\usepackage{tkz-fct}
\begin{document}
\begin{tikzpicture}[scale=1.25]
\tkzInit[xmin=-5,xmax=5,ymax=2]
\tkzGrid
\tkzAxeXY
\tkzFct[color=red]{2*x**2/(x**2+1)}
\end{tikzpicture}
\end{document}
json代码不太会改,只能全部抄出来了,如下
//注意更改VScode与sumatra的路径,还有就是将以下代码复制到
//sumatra->设置->选项->请输入您双击PDF文件后调用的命令行(E):
//"D:/Microsoft VS Code/Code.exe" "D:/Microsoft VS Code/resources/app/out/cli.js" -r -g "%f:%l"
{
// ======================== LaTeX 设置 BEGIN ========================
// bibtex 格式
"latex-workshop.bibtex-format.tab": "tab",
// 自动编译,全部关闭,当且仅当你认为有需要的时候才会去做编译
"latex-workshop.latex.autoBuild.run": "never",
"latex-workshop.latex.autoBuild.cleanAndRetry.enabled": false,
"latex-workshop.synctex.afterBuild.enabled": true,
"latex-workshop.view.pdf.viewer": "external", //设置默认的pdf查看器,tab、browser、external
"latex-workshop.view.pdf.ref.viewer": "auto", //设置PDF查看器用于在 \ref 命令上的[View on PDF]链接,此命令作用于 \ref 引用查看
"latex-workshop.view.pdf.external.viewer.command": "D:/SumatraPDF/SumatraPDF.exe", //使用外部查看器时要执行的命令,设置外部查看器启动文件SumatraPDF.exe文件所在位置
"latex-workshop.view.pdf.external.viewer.args": [ //此代码是设置使用外部查看器时,latex-workshop.view.pdf.external.view .command的参数。%PDF%是用于生成PDF文件的绝对路径的占位符。
"%PDF%"
],
"latex-workshop.view.pdf.external.synctex.command": "D:/SumatraPDF/SumatraPDF.exe", //将生成的辅助文件.synctex.gz转发到外部查看器时要执行的命令,设置其位置参数
//当 .synctex.gz 文件同步到外部查看器时latex-workshop.view.pdf.external.synctex的参数设置。%LINE%是行号,%PDF%是生成PDF文件的绝对路径的占位符,%TEX%是当触发syncTeX被触发时,扩展名为 .tex 的 LaTeX 文件路径。
"latex-workshop.view.pdf.external.synctex.args": [
"-forward-search",
"%TEX%",
"%LINE%",
"-reuse-instance",
"-inverse-search",
"\"D:/Microsoft VS Code/Code.exe\" \"D:/Microsoft VS Code/resources/app/out/cli.js\" -r -g \"%f:%l\"", // 注意修改路径
"%PDF%"
],
// 这是一些独立的编译选项,可以作为工具被编译方案调用
"latex-workshop.latex.tools": [
{
// Windows 原生安装 TeX Live 2020 的编译选项
"name": "Windows XeLaTeX",
"command": "xelatex",
"args": [
"--shell-escape",
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"-pdf",
"%DOCFILE%"
]
},
{
// Windows Biber 编译
"name": "Windows Biber",
"command": "biber",
"args": [
"--shell-escape",
"%DOCFILE%"
]
},
{
// WSL XeLaTeX 编译一般的含有中文字符的文档
"name": "WSL XeLaTeX",
"command": "wsl",
"args": [
"/usr/local/texlive/2020/bin/x86_64-linux/xelatex",
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"-pdf",
//"-output-directory=%OUTDIR%",
//"-aux-directory=%OUTDIR%",
"%DOCFILE%"
]
},
{
// WSL biber / bibtex 编译带有 citation 标记项目的文档
"name": "WSL Biber",
"command": "wsl",
"args": [
"/usr/local/texlive/2020/bin/x86_64-linux/biber",
"%DOCFILE%"
]
},
{
// macOS 或者 Linux 的简单编译
// 两种操作系统的操作方式相同
"name": "macOS / Linux XeLaTeX",
"commmand": "xelatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"-pdf",
"%DOCFILE%"
]
},
{
// macOS 或者 Linux 的索引编译
// 两种操作系统的操作方式相同
"name": "macOS / Linux Biber",
"command": "biber",
"args": [
"--shell-escape",
"%DOCFILE%"
]
}
],
// 这是一些编译方案,会出现在 GUI 菜单里
"latex-workshop.latex.recipes": [
{
// 1.1 Windows 编译简单的小文档,这个选项不太常用,因为绝大多数文章都需要有参考文献索引
"name": "Windows XeLaTeX 简单编译",
"tools": [
"Windows XeLaTeX"
]
},
{
// 1.1 Windows 编译简单的小文档,这个选项不太常用,因为绝大多数文章都需要有参考文献索引
"name": "Windows XeLaTeX 两次编译",
"tools": [
"Windows XeLaTeX",
"Windows XeLaTeX"
]
},
{
// 1.2 Windows 编译带有索引的论文,需要进行四次编译;-> 符号只是一种标记而已,没有程序上的意义
"name": "Windows xe->bib->xe->xe 复杂编译",
"tools": [
"Windows XeLaTeX",
"Windows Biber",
"Windows XeLaTeX",
"Windows XeLaTeX"
]
},
{
// 2.1 WSL 编译简单的小文档,这个选项不太常用,因为我绝大多数文章都需要有引用。
"name": "XeLaTeX 简单编译",
"tools": [
"WSL XeLaTeX"
]
},
{
// 2.2 带有 citation 索引的文档,需要进行四次编译;-> 符号只是一种标记而已,没有程序上的意义
"name": "xe->bib->xe->xe 复杂编译",
"tools": [
"WSL XeLaTeX",
"WSL Biber",
"WSL XeLaTeX",
"WSL XeLaTeX"
]
},
{
// 3.1 macOS 简单 小文档
"name": "macOS XeLaTeX 简单编译",
"tools": [
"macOS XeLaTeX"
]
},
{
// 3.2 macOS 四次编译
"name": "macOS xe->bib->xe->xe 复杂编译",
"tools": [
"macOS / Linux XeLaTeX",
"macOS / Linux Biber",
"macOS / Linux XeLaTeX",
"macOS / Linux XeLaTeX"
]
}
],
// 清空中间文件
"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",
"*.bcf",
"*.run.xml",
"*.page",
"*.synctex.gz"
],
"editor.minimap.enabled": false,
"security.workspace.trust.enabled": false,
"git.enableSmartCommit": true,
"git.confirmSync": false,
"window.zoomLevel": 1
// ======================== LaTeX 设置 END ========================
}