使用vscode和mactex

配置

首先安装好vscode ,mactex和插件latex workshop 。之后修改settings.json 。

image
image

"latex-workshop.view.pdf.viewer": "tab",

    "latex-workshop.latex.tools": [

        {

            "name": "xelatex",

            "command": "xelatex",

            "args": [

                "-synctex=1",

                "-interaction=nonstopmode",

                "-file-line-error",

                "-pdf",

                "%DOC%"

            ]

        },

        {

            "name": "latexmk",

            "command": "latexmk",

            "args": [

                "-synctex=1",

                "-interaction=nonstopmode",

                "-file-line-error",

                "-pdf",

                "%DOC%"

            ]

        },

        {

            "name": "pdflatex",

            "command": "pdflatex",

            "args": [

                "-synctex=1",

                "-interaction=nonstopmode",

                "-file-line-error",

                "%DOC%"

            ]

        },

        {

            "name": "bibtex",

            "command": "bibtex",

            "args": [

                "%DOCFILE%"

            ]

        }

    ],

    "latex-workshop.latex.recipes": [

        {

            "name": "xelatex",

            "tools": [

                "xelatex"

            ]

        },

        {

            "name": "pdflatex -> bibtex -> pdflatex*2",

            "tools": [

                "pdflatex",

                "bibtex",

                "pdflatex",

                "pdflatex"

            ]

        }

    ]

使用

在vscode中导入.tex文件。点击1,出现commands,点击build编译,点击view latex pdf出现右边的pdf,点击view log messages出现log。之后修改.tex,只要保存就会自动build,pdf会自动显示变化。

image

你可能感兴趣的:(使用vscode和mactex)