Latex配置与使用

环境

mac osx的vscode上配置latex

安装mactex

brew install mactex

vscode中安装 LaTex Workshop插件,并使用cmd + , 打开vscode配置搜索latex,按照下面方式加入配置参数

vscode配置

网上介绍的都不太全面,关键要点:

  • tools每个工具的commond使用命令的绝对地址
  • bibtex需要配置输入参数%DOCFILE%
    "latex-workshop.latex.recipes": [
        {
            "name": "pdflatex -> bibtex -> pdflatex 2",
            "tools": [
                "pdflatex",
                "bibtex",
                "pdflatex",
                "pdflatex"
            ]
        }
    ],
    "latex-workshop.latex.tools": [
        {
            "name": "xelatex",
            "command": "/Library/TeX/texbin/xelatex",    //添加编译的参数
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "%DOCFILE%",
                "-outdir=%OUTDIR%"
            ]
        },
        {
            "name": "pdflatex",
            "command": "/Library/TeX/texbin/pdflatex",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "%DOC%"
            ]
        },
        {
            "name": "biber",
            "command": "biber",
            "args": [
                "%DOCFILE%"
            ]
        },
        {
            "name": "latexmk",
            "command": "/Library/TeX/texbin/latexmk",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "-pdf",
                "-outdir=%OUTDIR%",
                "%DOCFILE%"
            ]
        },
        {
            "name": "bibtex",
            "command": "/Library/TeX/texbin/bibtex",
            "args": [
                "%DOCFILE%"
            ]
        }
    ],
    "terminal.integrated.env.osx": {
        "PATH": "/Library/TeX/texbin:$PATH"
    },
posted @ 2025-02-18 15:16  fariver  阅读(57)  评论(0)    收藏  举报