mac 下配置vscode书写latex及模板

预先装好:
先安装好 MacTex 和 VSCode
打开 VSCode,安装 latex workshop 插件

  1. 安装mactex

安装mactex太大了,所以我选择 BasicTex。但是后来用basictex发现它使用起来有问题,还是下载了mactex

brew cask install basictex

export PATH=/usr/local/texlive/2019basic/bin/x86_64-darwin:$PATH
// 打开usr.local隐藏路径,可以打开finder然后shift+command+G


// 安装相关包,安装包使用 tlmgr install命令进行安装
sudo tlmgr update --self --repository http://mirrors.tuna.tsinghua.edu.cn/CTAN/systems/texlive/tlnet

sudo tlmgr install latexmk --repository http://mirrors.tuna.tsinghua.edu.cn/CTAN/systems/texlive/tlnet
  1. 安装latex workshop
    网上很多教程
    注意:找setting.json

mac 下配置vscode书写latex及模板_第1张图片

    改为:

    {
    "latex-workshop.latex.recipes": [{
    "name": "xelatex",
    "tools": [
        "xelatex"
    ]
    }, 

    {
    "name": "latexmk",
    "tools": [
        "latexmk"
    ]
    },

    {
    "name": "pdflatex -> bibtex -> pdflatex*2",
    "tools": [
        "pdflatex",
        "bibtex",
        "pdflatex",
        "pdflatex"
    ]
    }
    ],
    "latex-workshop.latex.tools": [
    {
    "name": "latexmk",
    "command": "latexmk",
    "args": [
        "-synctex=1",
        "-interaction=nonstopmode",
        "-file-line-error",
        "-pdf",
        "%DOC%"
        ]
    }, 
    {
        "name": "xelatex",
        "command": "xelatex",
        "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.view.pdf.viewer": "tab",
    "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"
    ],
    }
不赘述,一定重启vscode才生效!
  1. 但是上面安装完成后,只能书写英文.作如下修改

mac 下配置vscode书写latex及模板_第2张图片

修改过后的显示状况:

mac 下配置vscode书写latex及模板_第3张图片

  1. 相关latex模板

    • 一份其实很短的 LaTeX 入门文档

    • 如何使用美赛模板 mcmthesis

    • Latex使用说明教程—ACM模板实测

你可能感兴趣的:(工具软件等)