Mac m1 vscode 配置latex 详细教程

1、LaTeX官网下载MacTex

https://www.tug.org/mactex/mactex-download.html

2、VScode安装插件

  • LaTeX language support
  • LaTeX Workshop

3、MacTeX和插件安装完成后,在VScode点击设置,找到settings.json文件,在文件配置中加入:

复制代码
"latex-workshop.latex.tools": [
        {
          "name": "xelatex",
          "command": "xelatex",
          "args": [
            "-synctex=1",
            "-interaction=nonstopmode",
            "-file-line-error",
            "%DOC%"
          ]
        },
        {
          "name": "pdflatex",
          "command": "pdflatex",
          "args": [
            "-synctex=1",
            "-interaction=nonstopmode",
            "-file-line-error",
            "%DOC%"
          ]
        },
        {
          "name": "latexmk",
          "command": "latexmk",
          "args": [
            "-synctex=1",
            "-interaction=nonstopmode",
            "-file-line-error",
            "-pdf",
            "%DOC%"
          ]
        },
        {
          "name": "bibtex",
          "command": "bibtex",
          "args": [
            "%DOCFILE%"
          ]
        }
      ],
 
      "latex-workshop.latex.recipes": [
        {
          "name": "XeLaTeX",
          "tools": [
            "xelatex"
          ]
        },
        {
          "name": "PDFLaTeX",
          "tools": [
            "pdflatex"
          ]
        },
        {
          "name": "latexmk",
          "tools": [
            "latexmk"
          ]
        },
        {
          "name": "BibTeX",
          "tools": [
            "bibtex"
          ]
        },
        {
          "name": "xelatex -> bibtex -> xelatex*2",
          "tools": [
            "xelatex",
            "bibtex",
            "xelatex",
            "xelatex"
          ]
        },
        {
          "name": "pdflatex -> bibtex -> pdflatex*2",
          "tools": [
            "pdflatex",
            "bibtex",
            "pdflatex",
            "pdflatex"
          ]
        },
    ],

文件中的其余配置不做修改。

4、测试:运行一个.tex文件,点击运行即可

5、可以同步查看对应的pdf文件

相关推荐
进阶的小木桩35 分钟前
Visual Studio Code配置自动规范代码格式
ide·vscode·编辑器
hljqfl2 小时前
pip安装第三方库,但PyCharm中却无法识别
ide·pycharm·pip
mingyuewu3 小时前
MAC安装docker 后提示com.docker.vmnetd”将对您的电脑造成伤害
macos·docker·容器
JCBP_4 小时前
数据结构4
运维·c语言·数据结构·vscode
还是鼠鼠5 小时前
Node.js 中间件-中间件的概念与格式
前端·javascript·vscode·node.js·express
前端 贾公子6 小时前
Mac 设置静态IP的方法 和 Mac 设置静态IP后 无法联网
tcp/ip·macos·智能路由器
1024小神6 小时前
vscode/cursor编辑器中vue3文件里面的css不能注释解决办法
css·vscode·编辑器
奔跑的小G8 小时前
【VS Code】为什么vscode已经关闭,http://localhost:5173/还可以打开或项目还在运行,端口被占用
vscode
小妤妤8 小时前
webStorm 控制台失效,无法输入
ide·webstorm
djs007178 小时前
mac环境 若依node版本兼容设置
macos