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文件

相关推荐
Kiri霧3 小时前
IntelliJ IDEA
java·ide·kotlin·intellij-idea
晨风先生5 小时前
如何Visual Studio 的配置从 Qt-Debug 切换到 x64-Debug
ide·qt·visual studio
fhf5 小时前
2025年了你会卸载Macbook上的应用吗?
macos·shell
归辞...6 小时前
「iOS」——内存五大分区
macos·ios·cocoa
要加油哦~8 小时前
工具 | 解决 VSCode 中的 Delete CR 问题
ide·vscode·编辑器
穆雄雄9 小时前
备份一下我的 mac mini 的环境变量配置情况
macos
未来之窗软件服务11 小时前
基于 Nginx 与未来之窗防火墙构建下一代自建动态网络防护体系—仙盟创梦IDE
网络·ide·nginx·服务器安全·仙盟创梦ide·东方仙盟
yao0003713 小时前
Claude 4.0 终极编程指南:模型对比、API配置与IDE集成实战
ide·ai编程
我有一只肥螳螂13 小时前
idea监控本地堆栈
java·ide·intellij-idea
界面开发小八哥19 小时前
通用CI/CD软件平台TeamCity v2025.3全新发布——主要界面交互体验升级
ide·ci/cd·开发平台·teamcity