1. 安装texlive,验证的方式:

    1
    2
    3
    4
    tex -v
    latex -v
    xelatex -v
    pdflatex -v
  2. vscode 安装 Latex Workshop插件以及Code Spell Checker插件

  3. 配置json,打开配置的方法是Ctrl+shift+p然后搜索setj选择 首选项:打开设置:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    "latex-workshop.latex.recipes": [
    {
    "name": "xelatex -> bibtex -> xelatex*2",
    "tools": [
    "xelatex",
    "bibtex",
    "xelatex",
    "xelatex"
    ]
    }
    ],
    "latex-workshop.latex.tools": [
    {
    "name": "xelatex",
    "command": "xelatex",
    "args": [
    "-synctex=1",
    "-interaction=nonstopmode",
    "-file-line-error",
    "%DOCFILE%"
    ]
    },
    {
    "name": "latexmk",
    "command": "latexmk",
    "args": [
    "-synctex=1",
    "-interaction=nonstopmode",
    "-file-line-error",
    "%DOCFILE%"
    ]
    },
    {
    "name": "pdflatex",
    "command": "pdflatex",
    "args": [
    "-synctex=1",
    "-interaction=nonstopmode",
    "-file-line-error",
    "%DOCFILE%"
    ]
    },
    {
    "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"
    ],
    "latex-workshop.latex.autoClean.run": "onBuilt"
  1. 快捷键:

    • ctrl+alt+b 编译latex;
    • ctrl+alt+x:显示LaTeX面板(左侧编译命令面板和文档大纲)
    • ctrl+alt+c:清除辅助文件(目前的设置是自动清除的所以不太需要)
    • ctrl+alt+v:查看编译的pdf文件
    • ctrl+alt+j:正向搜索。固定光标到tex文件的某一个位置能够在pdf那里自动定位到该位置,需要在上面的自动清楚设置里面不清除.gz文件
    • ctrl: 反向搜索,在阅读vscode里面预览的pdf的时候按住ctrl然后点击某位置,左边的tex会自动定位到该位置;
  2. 中文支持:

    1. xelatex:

      加入:

      1
      \usepackage{ctex}
    2. pdflatex:

      1
      2
      3
      4
      \usepackage{CJKutf8}
      \begin{CJK}{UTF8}{gbsn}

      \end{CJK}