LaTeX安装配置(TeX Live 2020+VS Code插件LaTeX Workshop)

概述

  • 编译器:TeX Live 2020
  • 编辑器:VS Code及其插件LaTeX Workshop

TeX Live 2020安装

在清华镜像站下载,texlive2020.iso大小为3.7G,比较大,下载比较费时间。路径如下:
https://mirrors.tuna.tsinghua.edu.cn/CTAN/systems/texlive/Images/
LaTeX安装配置(TeX Live 2020+VS Code插件LaTeX Workshop)_第1张图片
下载结束后点击该镜像,其文件组织方式大致如下:
LaTeX安装配置(TeX Live 2020+VS Code插件LaTeX Workshop)_第2张图片
双击install-tl-windows.bat批处理文件,然后点击Advanced
LaTeX安装配置(TeX Live 2020+VS Code插件LaTeX Workshop)_第3张图片
然后修改安装路径,防止占用C盘空间,如下:
LaTeX安装配置(TeX Live 2020+VS Code插件LaTeX Workshop)_第4张图片
其余选项不用更改,也可以把右下角的“After install, set CTAN as source for package updates”勾选去掉。
然后点击安装即可。安装时间会比较久,大约1h。当得到欢迎进入TeX Live的世界后表明安装成功,退出即可。此时安装用到的iso文件可以删除。

LaTeX Workshop插件的配置

在VS Code中直接搜索并安装该插件,或者在https://marketplace.visualstudio.com/search?target=VSCode&category=All%20categories&sortBy=Installs搜索该插件下载后通过VSIX方式选择下载的插件安装,如下:
LaTeX安装配置(TeX Live 2020+VS Code插件LaTeX Workshop)_第5张图片
LaTeX安装配置(TeX Live 2020+VS Code插件LaTeX Workshop)_第6张图片
LaTeX安装配置(TeX Live 2020+VS Code插件LaTeX Workshop)_第7张图片
插件安装好后点击Ctrl+Shift+P并搜索setting,打开setting.json,如下:
在这里插入图片描述
在其中添加如下内容:

	"latex-workshop.view.pdf.viewer": "tab",
    "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",
                "%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": "latexmk",
            "tools": [
                "latexmk"
            ]
        },
        {
     
            "name": "pdflatex -> bibtex -> pdflatex*2",
            "tools": [
                "pdflatex",
                "bibtex",
                "pdflatex",
                "pdflatex"
            ]
        }
    ],
    "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"
    ]

然后就可以使用了。

Other

一个LaTeX格式化的插件latex-formatter,也可以安装使用。

你可能感兴趣的:(环境搭建与配置,数模美赛)